I am new to using Node-red and the raspberry pi. I have a python script that would like to run from node-red and receive the mag.payload. I cannot figure the correct command in the daemon node to start the python script. Any help is appreciated.
Current Python script:
import time
import board
import busio
import adafruit_mprls
import RPi.GPIO as GPIO
try:
import RPi.GPIO as GPIO
except RuntimeError:
print("Error importing RPi.GPIO! This is probably because you need
superuser privileges.")
i2c = busio.I2C(board.SCL, board.SDA)
mpr = adafruit_mprls.MPRLS(i2c, psi_min=0, psi_max=25)
"""
import digitalio
reset = digitalio.DigitalInOut(board.D5)
eoc = digitalio.DigitalInOut(board.D6)
mpr = adafruit_mprls.MPRLS(i2c, eoc_pin=eoc, reset_pin=reset,
psi_min=0, psi_max=25)
"""
while True:
print((mpr.pressure,))
time.sleep(1)
The python script is stored at home/pi/Document/pressure.py
I am not sure what the command and arguments should be in the daemon node of node-red. I have tried in
command: usr/bin/python
arguments: home/pi/Documents/prressure.py