NodeRed Restarting

Hi everyone I have an instance of NodeRed recording 5 DS18B20 temperature probes sometimes the NodeRed instance restarts randomly, below is the output from the syslog can anybody help?

Jun 28 01:53:09 object1 Node-RED[353]: 28 Jun 01:53:09 - [red] Uncaught Exception:
Jun 28 01:53:09 object1 Node-RED[353]: 28 Jun 01:53:09 - TypeError: Cannot read property 'charAt' of undefined
Jun 28 01:53:09 object1 Node-RED[353]:     at /home/pi/.node-red/node_modules/ds18b20/lib/ds18b20.js:46:16
Jun 28 01:53:09 object1 Node-RED[353]:     at FSReqCallback.readFileAfterClose [as oncomplete] (internal/fs/read_file_context.js:63:3)
Jun 28 01:53:09 object1 systemd[1]: nodered.service: Main process exited, code=exited, status=1/FAILURE
Jun 28 01:53:09 object1 systemd[1]: nodered.service: Failed with result 'exit-code'.
Jun 28 01:53:29 object1 systemd[1]: nodered.service: Service RestartSec=20s expired, scheduling restart.
Jun 28 01:53:29 object1 systemd[1]: nodered.service: Scheduled restart job, restart counter is at 1.
Jun 28 01:53:29 object1 systemd[1]: Stopped Node-RED graphical event wiring tool.
Jun 28 01:53:29 object1 systemd[1]: Started Node-RED graphical event wiring tool.
Jun 28 01:53:31 object1 Node-RED[5064]: 28 Jun 01:53:31 - [info]
Jun 28 01:53:31 object1 Node-RED[5064]: Welcome to Node-RED
Jun 28 01:53:31 object1 Node-RED[5064]: ===================

Which ds18b20 node are you using? node-red-contrib-something probably.

There is a bug in that node that crashes node red, probably when it receives an illegal input. Are you using the latest version of that node?

If you are passing the node data then add a debug node showing what is going into the node and set the debug node to output Complete Message. Then you will see that value in the log before it crashes. In order to make sure the message is output before node-red crashes add a do-nothing change node or function node to the wire feeding the ds18b20 node so that the debug node will run and log its message before the DS node runs.

Hi Colin, it's this node:-

https://flows.nodered.org/node/node-red-contrib-ds18b20

It looks like a bug in that node not handling unexpected data from the sensor properly. Is see it has not been updated in 7 years so whether it is still supported I don't know.

The fundamental cause is probably an issue with your sensor or wiring but it should not crash node-red. You could try submitting an issue on the node's github page but you might be better to try one of the other ds18b20 nodes.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.