Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Domoticz 2020.2-10 package does not contain dzVents runtime files #4728

Open
sjirkboon opened this issue Jul 10, 2021 · 10 comments · May be fixed by #4730
Open

Domoticz 2020.2-10 package does not contain dzVents runtime files #4728

sjirkboon opened this issue Jul 10, 2021 · 10 comments · May be fixed by #4730

Comments

@sjirkboon
Copy link

Setup

Package Name: Domoticz
Package Version: 2020.2-10

NAS Model: DS214se
NAS Architecture: Marvell
DSM version: 6.2.4

Expected behavior

The possibility to run dzVents scripts

Actual behavior

an error occurs:
Error: EventSystem: in /volume1/@appstore/domoticz/bin/dzVents/runtime/dzVents.lua: cannot open /volume1/@appstore/domoticz/bin/dzVents/runtime/dzVents.lua: No such file or directory
when logging in via ssh , the /volume1/@appstore/domoticz/bin/dzVents directory is indeed empty

Steps to reproduce

run dzVents script
check logfile
check directory /volume1/@appstore/domoticz/bin/dzVents : empty

@hgy59
Copy link
Contributor

hgy59 commented Jul 10, 2021

By design of domoticz there is none of the scripts installed by default.

The scripts folder with the provided example scripts is installed with the package to /var/packages/domoticz/target/scripts.

As documented in the related readme.txt you have to copy the scripts you want by yourself:

/var/packages/domoticz/target/scripts$ cat readme.txt
Place your scripts you want to be executed by domoticz in here.

Special scripts:
domoticz_main (on windows domoticz_main.bat), will be executed when a switch is pressed (On/Off)
to use this script, remove the underscore in front of the filename

dzVents has a dedicated script folder at /var/packages/domoticz/target/scripts/dzVents/scripts.
You have to copy the scripts for dzVents to this folder and there are examples in /var/packages/domoticz/target/scripts/dzVents/examples as you can see in the provided README.md file.

/var/packages/domoticz/target/scripts$ cat dzVents/scripts/README.md
**Scripts folder**

Place all your scripts in this folder. Only these scripts will be executed by dzVents. See the example folder for some script examples and check the README.md in the root for instructions.

Maybe there is a misconfiguration in the package, but the dzVents scripts should be expected in /var/packages/domoticz/target/scripts/dzVents/scripts and not in /var/packages/domoticz/target/bin/dzVents (as /volume1/@appstore/domoticz/bin/dzVents is).

@hgy59
Copy link
Contributor

hgy59 commented Jul 10, 2021

Final analysis:
Maybe I have found the misconfiguration.

@sjirkboon can you try the following to fix this?

  1. modify the file /var/packages/domoticz/scripts/service-setup to fix the userdata folder (must be PKGDEST insead of PKGVAR):

    replace
    DATA_OPTIONS="-dbase ${DB_FILE} -userdata ${SYNOPKG_PKGVAR}"
    by:
    DATA_OPTIONS="-dbase ${DB_FILE} -userdata ${SYNOPKG_PKGDEST}"

  2. Restart domoticz by stop and start in the DSM package center of your diskstation

@hgy59 hgy59 linked a pull request Jul 10, 2021 that will close this issue
6 tasks
@sjirkboon
Copy link
Author

thanks for your help. I did make the suggestion change, restarted domoticz, and recreated the lua script in the events page, but I still receive the same error message:

2021-07-10 17:42:28.149 Status: EventSystem: reset all events...
2021-07-10 17:42:28.152 Status: dzVents: Write file: /volume1/@appstore/domoticz/scripts/dzVents/generated_scripts/gas per grddag.lua
2021-07-10 17:42:37.434 Error: EventSystem: in /volume1/@appstore/domoticz/bin/dzVents/runtime/dzVents.lua: cannot open /volume1/@appstore/domoticz/bin/dzVents/runtime/dzVents.lua: No such file or directory

also trying to find this dzVents.lua file somewhere in the directory tree, not succesfull...

@hgy59
Copy link
Contributor

hgy59 commented Jul 10, 2021

@sjirkboon I got it, working...

@BenjV
Copy link

BenjV commented Jul 10, 2021

It is not wise to use the PKGDEST instead of PKGVAR.
During upgrade of the package the whole PKGDEST will be wiped clean.
Only PKGVAR will survive the upgrade process avoided.
If it cannot be avoided it would be better to create a simlink which could be restored in the postupgrade phase

@hgy59
Copy link
Contributor

hgy59 commented Jul 10, 2021

The folder specified with -userdata with it's default value /opt/domoticz must be one level above the scripts and other installation folders of domoticz, and that is $(SYNOPKG_PKGDEST) = /var/packages/domoticz/target. It was my mistake to use SYNOPKG_PKGDEST for -userdata that was a new parameter since the last package update.

@BenjV
Copy link

BenjV commented Jul 10, 2021

As I said, this data will be destroyed when the package get updated.
You where right to use SYNOPKG_PKGVAR for userdate.

If it is not possible to use SYNOPKG_PKGVAR then in the pre-ugrade phase that data must be saved to SYNOPKG_TEMP_UPGRADE_FOLDER and restored in the post upgrade phase.
Another solution would be to create a simlink to SYNOPKG_PKGVAR in the post install phase of the package.

@sjirkboon
Copy link
Author

so I understand this has been fixed by #4730 now. As I don't have a build environment myself, is there any expectation for when the binary files will be released, or is there different way to get the content of the bin/dzVents/ directory for my architecture : Marvell / DS214SE ? or are these .lua files independent of architecture ? many thanks in advance ...

@hgy59
Copy link
Contributor

hgy59 commented Jul 11, 2021

@sjirkboon you can download the packages built by github for #4730 as Artifacts (packages.zip).
In the Checks section of #4730 click on details of any build job to switch to the related github action.
With the artifacts pop menu you can download the packages (this is available only when at leas one job that generates packages succeeded).
link to the current packages

You have to extract the spk files from packages.zip and manually install the correct arch and DSM version for your diskstation.

Currently the dzVents runtime is included, but the migration of the userdata is not solved yet and will need some changes in #4730.

@sjirkboon
Copy link
Author

thanks. I did download the packages.zip, and used the armv7 architecture for my Armada 370 , that seems to work fine, and also since .lua files are just text files...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants