Page 1 of 1
script error 512
Posted: Saturday 12 January 2019 13:19
by axel2906
Hi,
I try to run a sh in domoticz but i've always an error :

- Capture.PNG (43.97 KiB) Viewed 2135 times
Error: Error executing script command (/home/pi/domoticz/scripts/vacuum_cuisine.sh). returned: 512
this is my script
- Spoiler: show
- #!/bin/bash
mirobo --ip MYIP --token MYTOKEN zoned-clean [[26044,17953,30944,21153,1]]
i've already make a chmod 777 on this sh file
If i do ./vacuum_cuisine.sh in putty it works

- Capture1.PNG (2.72 KiB) Viewed 2135 times
somebody can maybe help me ?
Re: script error 512
Posted: Saturday 12 January 2019 13:27
by jvdz
Probably a path issue. I normally use the fully qualified path like:
Code: Select all
script:///home/pi/domoticz/scripts/vacuum_cuisine.sh
Also ensure the execute attribute is set for the script.
Jos
Re: script error 512
Posted: Saturday 12 January 2019 13:47
by axel2906
jvdz wrote: ↑Saturday 12 January 2019 13:27
Probably a path issue. I normally use the fully qualified path like:
Code: Select all
script:///home/pi/domoticz/scripts/vacuum_cuisine.sh
Also ensure the execute attribute is set for the script.
Jos
I tried with script:///home/pi/domoticz/scripts/vacuum_cuisine.sh and set file permission to 777
but with same result
Error: Error executing script command (/home/pi/domoticz/scripts/vacuum_cuisine.sh). returned: 512
Re: script error 512
Posted: Sunday 13 January 2019 9:39
by axel2906
I testing it in command line and i think that domoticz cannot execute this sh file
If I lauch it in the command line whis the pi user it works
mirobo --ip MYIP --token MYTOKEN zoned-clean [[26044,17953,30944,21153,1]]
i've made the domoticz user on the rpi3 and launch the same command and i have an error :
with domoticz user

- Capture2.PNG (9.34 KiB) Viewed 2109 times
with pi user

- Capture3.PNG (6.22 KiB) Viewed 2109 times
So wich user use Domoticz to launch bash files ? or is it an other way to do this ?
I've already set the chmod 777 on the file
Re: script error 512
Posted: Sunday 13 January 2019 11:21
by axel2906
i've find the solution !
i must add to my sh script sudo -H -u pi
so script is
sudo -H -u pi mirobo --ip MYIP --token MYTOKEN zoned-clean [[26044,17953,30944,21153,1]]