script error 512

All kinds of 'OS' scripts

Moderator: leecollings

Post Reply
axel2906
Posts: 19
Joined: Wednesday 21 February 2018 20:38
Target OS: Raspberry Pi / ODroid
Domoticz version: V3.8926
Location: Brussels
Contact:

script error 512

Post by axel2906 »

Hi,


I try to run a sh in domoticz but i've always an error :
Capture.PNG
Capture.PNG (43.97 KiB) Viewed 2084 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
Capture1.PNG (2.72 KiB) Viewed 2084 times
somebody can maybe help me ?
RPi3 - RfxComm - Milight - OWL160
User avatar
jvdz
Posts: 2266
Joined: Tuesday 30 December 2014 19:25
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.107
Location: Netherlands
Contact:

Re: script error 512

Post 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
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
axel2906
Posts: 19
Joined: Wednesday 21 February 2018 20:38
Target OS: Raspberry Pi / ODroid
Domoticz version: V3.8926
Location: Brussels
Contact:

Re: script error 512

Post 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
RPi3 - RfxComm - Milight - OWL160
axel2906
Posts: 19
Joined: Wednesday 21 February 2018 20:38
Target OS: Raspberry Pi / ODroid
Domoticz version: V3.8926
Location: Brussels
Contact:

Re: script error 512

Post 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
Capture2.PNG (9.34 KiB) Viewed 2058 times
with pi user
Capture3.PNG
Capture3.PNG (6.22 KiB) Viewed 2058 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
RPi3 - RfxComm - Milight - OWL160
axel2906
Posts: 19
Joined: Wednesday 21 February 2018 20:38
Target OS: Raspberry Pi / ODroid
Domoticz version: V3.8926
Location: Brussels
Contact:

Re: script error 512

Post 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]]
RPi3 - RfxComm - Milight - OWL160
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest