can't launch apython script from sh from blocky

Moderator: leecollings

Post Reply
paralight
Posts: 6
Joined: Wednesday 08 February 2017 13:09
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

can't launch apython script from sh from blocky

Post by paralight »

Hi!


I thought I could find the solution but I 'm stuck on a blocky script or I want to launch a script sh .. a simple script sh which launches a python script, here in image the script:

Image

then the sh script:

Code: Select all

 #! / bin / sh

/usr/bin/python3/home/pi/domoticz/scripts/turnOnChambreEliza.py > /dev/null 2> & 1 &
exit 0
well the python script is not worth it, or the start:

Code: Select all


#!/usr/bin/env python3

asyncio import
import os
.........
the command /home/pi/domoticz/scripts/turnOnChambreEliza.sh works perfectly in a terminal and I have no errors in the domoticz logs ..

Image

the two scripts (sh and py) are in / home / pi / domoticz / scripts /
the rights are in 777 on the 2 files
-rwxrwxrwx 1 pi pi 1748 Jan 5 21:21 turnOnChambreEliza.py
-rwxrwxrwx 1 ft ft 102 Jan 5 21:38 turnOnRoomEliza.sh
an idea please? I 'm stuck with it and the only solution I see is a hack to go through an http request and launch python from a web server .. or ... some will tell me to pass everything on lua. .. but a little lazy. .

thank you
User avatar
erem
Posts: 230
Joined: Tuesday 27 March 2018 12:11
Target OS: Raspberry Pi / ODroid
Domoticz version: 2021.1
Location: Amsterdam/netherlands
Contact:

Re: can't launch apython script from sh from blocky

Post by erem »

you state
>>the command /home/pi/domoticz/scripts/turnOnChambreEliza.sh works perfectly in a terminal and I have no errors in the domoticz logs ..

what user runs that command.

and what user runs domoticz.

try running the command as the user tha runs domoticz to see if it still works
Regards,

Rob
paralight
Posts: 6
Joined: Wednesday 08 February 2017 13:09
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: can't launch apython script from sh from blocky

Post by paralight »

hi Rob
and thank you very much for your answer
you're right.
actually i was running command as "pi" user on my raspberry and domoticz is running as root
so actually there was an error when I run command as root, a python package was missing , this command:
"sudo pip3 install meross_iot" solves my problem, because domticz use root user.. (and I had installing package meross_iot as pi user.. )

thank again
regards,
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest