I have python script relay.py - chmod 755, owner is pi, in scripts folder. In action i call it "script:///home/pi/domoticz/scripts/relay.py 1 1" and it not works. Error 512. When I put on first line "#!/usr/bin/python" error is changing to 32512.
In ssh works fine.
So I wrote scripts 10sh and 11.sh, owned to pi, chmoded 755, scripts code is one line:
python //home/pi/domoticz/scripts/python/relay.py 1 1
and
python //home/pi/domoticz/scripts/python/relay.py 1 0
and call it in action trigger - on: "python //home/pi/domoticz/scripts/11.sh", off: on: "python //home/pi/domoticz/scripts/11.sh"
It works. So where is the problem with execution .py file in action trigger?
Script works in ssh but not in domoticz
Moderator: leecollings
-
- Posts: 16
- Joined: Tuesday 23 February 2016 14:04
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
- Egregius
- Posts: 2592
- Joined: Thursday 09 April 2015 12:19
- Target OS: Linux
- Domoticz version: v2024.7
- Location: Beitem, BE
- Contact:
Re: Script works in ssh but not in domoticz
Why put 'python' in front of a bash script?
Why the double // in front of the path?
Anyway, a bash script in between is a good idea because you can add "> /dev/null 2>&1 &" at the end of the command. That way the bash script is instantly finished and Domoticz can continue with other stuff. Without that domoticz waits until the script is finished before doing anything else.
Why the double // in front of the path?
Anyway, a bash script in between is a good idea because you can add "> /dev/null 2>&1 &" at the end of the command. That way the bash script is instantly finished and Domoticz can continue with other stuff. Without that domoticz waits until the script is finished before doing anything else.
-
- Posts: 16
- Joined: Tuesday 23 February 2016 14:04
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Script works in ssh but not in domoticz
Thanks, I added it to sh script.
When I remove python or one dash script does not works.
When I remove python or one dash script does not works.
Who is online
Users browsing this forum: No registered users and 1 guest