I'm using Node-Red, hosted on a Raspberry Pi for an IoT project.
How do I trigger a Python script that is on the raspi from Node-Red? I want to run a script that updates the text on an Adafruit LCD shield which is sitting on the Pi
Should I be looking to expose the Python script as a web service somehow?
I'm using a Raspberry Pi B+
I had a similar challenge with a Raspberry pi 4.
I solved it by using an execute node. On the command slot, enter the path of the python script as follows.
sudo python3 /home/pi/my_script.py
Change the script path to yours. Use the inject node to run the script and the debug node to view your output.
Ensure you grant superuser permission using sudo and you have python3 installed.
How to trigger Python script on Raspberry Pi from Node-Red