I have been attempting to graph data obtained from a python script using Node-RED. Whenever I attempt to deploy the nodes and inject the timestamp, I lose connection with Node-RED. Below is the python code:
import RPi.GPIO as GPIO
import time
import Adafruit_MAX31855.MAX31855 as MAX31855
CLK1 = 16
DO1 = 20
CS1 = 21
sensor1 = MAX31855.MAX31855(CLK1, CS1, DO1)
CLK2 = 13
DO2 = 19
CS2 = 26
sensor2 = MAX31855.MAX31855(CLK2, CS2, DO2)
CLK3 = 23
DO3 = 24
CS3 = 25
sensor3 = MAX31855.MAX31855(CLK3, CS3, DO3)
CLK4 = 17
DO4 = 27
CS4 = 22
sensor4 = MAX31855.MAX31855(CLK4, CS4, DO4)
while True:
temp1 = sensor1.readTempC() - 1.25
temp2 = sensor2.readTempC()
temp3 = sensor3.readTempC()
temp4 = sensor4.readTempC()
print ('Thermocouple 1 Temperature: {0:0.3F}*C'.format(temp1))
time.sleep(2.0)
I am attempting to graph the variables temp1, temp2, temp3, and temp4 together on a real-time plot, but so far I have only tested trying to plot temp1.
My python file is saved in /home/pi/noderedthermocouple.py, and this is the exact line that I am inputting into the command blank in the properties of the exec node.
Also, if anyone has a better solution to graph the data from this python script using Node-RED, that would be greatly appreciated.
Thanks for your help.