I am trying to get pythonshell working.
I am wanting to run a python script on a remote machine to display a message on the LCD screen.
On that machine I run the ..... python script eg:
python3 display_message.3 test
and test is displayed on the screen.
But that only works there.
Reading from
Executing a python script from node-red. Input to the node will become the argument for the python script,
So if I put this flow on the machine with the LCD display and the python script:
[{"id":"904a5c2c.441b28","type":"inject","z":"e9882c4e.450a6","name":"","topic":"","payload":"Banana","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":130,"y":220,"wires":[["9ca2d2c2.38037","fbd23ff1.bf0da"]]},{"id":"fbd23ff1.bf0da","type":"pythonshell in","z":"e9882c4e.450a6","name":"Display message on LCD","pyfile":"/home/pi/PiFace/message_display3.py","virtualenv":"","continuous":false,"x":510,"y":220,"wires":[["1bf9aa39.20fa36"]]}]
I would take it as I would get "banana" on the screen.
Doesn't happen. But I'm sending banana as the "input to the node" which - as stated above - will become the arguement to the python script.
This is the error I get:
exit code: 1, Traceback (most recent call last): File "message_display3.py", line 4, in <module> import pifacecad File "/home/pi/PiFace/pifacecad/__init__.py", line 44, in <module> from .ir import ( File "/home/pi/PiFace/pifacecad/ir.py", line 4, in <module> import lircImportError: No module named lirc
(Though after looking at it, I think there is another nasty happening.)
Stuck.
Thanks.
Late addition:
This is the script:
cat message_display3.py
#!/usr/bin/python
import sys
import pifacecad
#print('Arguments:', len(sys.argv))
#print('List:', str(sys.argv))
#if sys.argv < 2:
# print('To few arguments, please specify a filename')
filename = sys.argv[1]
print('The paramater you entered is called')
print( filename)
cad = pifacecad.PiFaceCAD()
cad.lcd.backlight_on()
cad.lcd.clear()
cad.lcd.write(filename)
pi@PIFACE:~/PiFace $