I am trying to access dht11 temperature and humidity data using python program on raspberrypi 4b on to node-red 'exec' module , but it is unable to capture the python data and error shows rc:-2 ,
1/22/2021, 6:25:50 PMnode: 60d44db2.3b0944msg : Object
object payload: object
topic: ""
_msgid: "6b5db153.10ae"
python program is working fine and displaying output in console.
Temp: 64.4 F / 18.0 C Humidity: 68%
Temp: 64.4 F / 18.0 C Humidity: 68%
Temp: 64.4 F / 18.0 C Humidity: 68%
Temp: 64.4 F / 18.0 C Humidity: 68%
Any one plz help how to access this data in nodered
---- Node-red -----------
[{"id":"98f0a244.a3302","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"832a19ea.93caa8","type":"exec","z":"98f0a244.a3302","command":"/home/pi/IOTstack/Adafruit_CircuitPython_DHT/sudo python3 dht_simpletest.py","addpay":true,"append":"","useSpawn":"true","timer":"15","oldrc":false,"name":"dht_simplest.py","x":400,"y":80,"wires":[["9ae44969.7d99a8"],["60d44db2.3b0944"],["60d44db2.3b0944"]]},{"id":"5bbe50.570a71b","type":"inject","z":"98f0a244.a3302","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"5","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":150,"y":80,"wires":[["832a19ea.93caa8"]]},{"id":"f6b7bd75.0b361","type":"function","z":"98f0a244.a3302","name":"","func":"msg['mx:temperature_c'] = msg.payload;\nmsg['mx:humidity'] = msg.humidity;\nreturn msg;\n","outputs":1,"noerr":0,"initialize":"// Code added here will be run once\n// whenever the node is deployed\n\n","finalize":"","x":380,"y":240,"wires":[["3d731fff.e628"]]},{"id":"3d731fff.e628","type":"debug","z":"98f0a244.a3302","name":"","active":true,"tosidebar":true,"console":true,"tostatus":true,"complete":"true","targetType":"full","statusVal":"","statusType":"msg","x":750,"y":240,"wires":[]},{"id":"9ae44969.7d99a8","type":"debug","z":"98f0a244.a3302","name":"","active":true,"tosidebar":true,"console":true,"tostatus":true,"complete":"true","targetType":"full","statusVal":"payload","statusType":"auto","x":710,"y":60,"wires":[]},{"id":"60d44db2.3b0944","type":"debug","z":"98f0a244.a3302","name":"","active":true,"tosidebar":true,"console":true,"tostatus":true,"complete":"true","targetType":"full","statusVal":"payload","statusType":"auto","x":710,"y":140,"wires":[]}]
[flow edited by a moderator]