SOLVED Error executing script command returned: 512 and 32256

Python and python framework

Moderator: leecollings

Post Reply
McJohn
Posts: 91
Joined: Wednesday 10 October 2018 17:01
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: The Netherlands
Contact:

SOLVED Error executing script command returned: 512 and 32256

Post 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()
Last edited by McJohn on Tuesday 30 October 2018 19:18, edited 1 time in total.
McJohn
Posts: 91
Joined: Wednesday 10 October 2018 17:01
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: The Netherlands
Contact:

Re: Error executing script command returned: 512 and 32256

Post 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
gomecin
Posts: 1
Joined: Sunday 03 November 2019 20:49
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

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

Post 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.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest