Page 1 of 1

SOLVED Error executing script command returned: 512 and 32256

Posted: Tuesday 30 October 2018 10:33
by McJohn
We made a simple Python script (below) to switch on a led at the Raspberry GPIO pin 4.
This script works perfect at the command line but unfortunately not in a Scene in Domoticz.
We got the following error:

Error executing script command (/home/pi/domoticz/scripts/ledon.py). returned: 32256

The specified path is 100% ok (script:///home/pi/domoticz/scripts/ledon.py)

Then we changed the user rights with sudo 755.

Then we got the following error;
Error executing script command (/home/pi/domoticz/scripts/ledon.py). returned: 512

Then we tried the standard delivered sample within the Domoticz python script folder:
Error executing script command (/home/pi/domoticz/scripts/python/script_time_demo.py). returned: 32256

So, even the standard python sample won't work within a Domoticz Scene!

We searched the forum and saw a lot of these kind of errors but nu solution for this simple script.

Thanks for the help!

Python script:
from gpiozero import LED

red_led=LED(4)

red_led.on()

Re: Error executing script command returned: 512 and 32256

Posted: Tuesday 30 October 2018 19:18
by McJohn
SOLVED!

For the

32256 error:

Every script must have the right user permissions, even the standard samples delivered with Domoticz has to be changed after installation:
sudo chmod 755 /home/pi/domoticz/scripts/ledon.py

And for the

512 error

Every (Python) script must begin with:
#!/usr/bin/python

Re: SOLVED Error executing script command returned: 512 and 32256

Posted: Tuesday 08 December 2020 11:34
by gomecin
Just for the record in case anyone stumbles here as I did.
Besides the needed chmod 777 or 755, I struggled with some python issues and the reason was that one argument was the name of a file to use in the script. From shell no issue, but from Domoticz nothing. That name, so as any other file used in the script, has to contain the full path, RELATIVE ROUTES DO NOT WORK WHEN CALLING SCRIPTS FROM DOMOTICZ.