node-red-nodes icon indicating copy to clipboard operation
node-red-nodes copied to clipboard

serialport node hangs after some time (no input from/no output to serial device)

Open bjoern7777 opened this issue 5 years ago • 18 comments

Which node are you reporting an issue on?

node-red-node-serialport

What are the steps to reproduce?

  • Arduino Uno with sketch, that writes every 30 seconds sensor data via serial.write
  • Arduino is connected via USB cable, Port is ACM0
  • Arduino LED 13 blinks every second, so its possible to see if the controller is crashed or not

What happens?

After some time (30 minutes or 12 hours or 2 days, interval is not the same) in node-red is no data available. The arduino LED 13 blinks. To solve the problem its possible

  • to disconnect the arduino for a short time (disconnect the usb cable, connect the cable)
  • redeploy the flow After that, everything is fine until the next crash.

In case of the "crash" there is via dmesg no entrie available, that the usb port is disconnected

What do you expect to happen?

It would be nice, if its possible to reset the serial connection via a node. So its possible to create a flow to check the last time a message arrived. If > 60 seconds reset the connection.

Please tell us about your environment:

  • [ ] Node-RED version: 0.18.5

  • [ ] node.js version: 6.14.3

  • [ ] npm version: 3.10.10

  • [ ] Platform/OS: Linux Debian Jessie

  • [ ] Browser: Chrome

bjoern7777 avatar Apr 28 '19 10:04 bjoern7777

which version of the serialport node do you have installed ?

dceejay avatar May 26 '19 15:05 dceejay

Same problem. Just installed everything today, so serialport is 0.10.0 (off the installler) and Node-RED is 1.0.4. Similar discussion here.

zaneclaes avatar Mar 14 '20 01:03 zaneclaes

I'm having similar issue. I configured a 3G USB dongle to send SMS from a Raspberry but I cannot get the data in Node Red for serial in node, data which is available in putty image image And here the configuration from Node Red image When I created first time the flow everything worked, even RSSI data was received in Node Red bu suddenly the data stop arriving in Node Red Serial-In. Any idea where can be the issue? I've restarted Node-Red, disconnect and reconnect the 3G dongle but without success.

geotibi avatar Jan 14 '22 18:01 geotibi

Only one device can access the port at a time - please ensure that no other application has grabbed the port first. Also check that it hasn't moved to say ttyUSB4 for some reason.

Finally - please try to use the Node-RED discourse forum for general how-to type questions as there will be a much wider audience who may be able to help you.

dceejay avatar Jan 14 '22 20:01 dceejay

The problem still exist. The serial port connects, register some data, and timeout. In the past (5 years ago, didn't have any version number) the serial port was reconnecting when there was a new message arrived. But now the node simply stay dead until i redeploy.

So please add a function to reconnect by the flow.

koos147 avatar Jul 08 '22 17:07 koos147

Hi. I have this problem for ages!!! I use nodered in Windows for about 3 years and always keep it up to date. I have several serial devices connected to an ethernet serial server (Digi Etherlite 32). I use other software like eventghost and home assistant without any problems but nodered keeps failing. Like some user said...it can last 2 hours, 2 days, one week....but eventually fails. And when it fails....only a restart flows command will bring to life. It seems that serialport is unreliable. Any log or setting that I can supply for debug?

mikemelga avatar Feb 16 '24 16:02 mikemelga

Which version of the serialport node are you using ? The latest version accepts a payload that can have an optional enabled property (boolean true or false) - that can be used to stop and restart the port dynamically.

dceejay avatar Feb 18 '24 12:02 dceejay

I was using 1.0.1. I've just updated to 2.0.2. Restarting the port should not be needed in first place.

I'll see how this version behaves.

Thanks.

mikemelga avatar Feb 18 '24 19:02 mikemelga

We know it "shouldn't be needed" - but until we can reliably find the source of the bug and whether it is in our code, the underlying library, some combination of driver, os, hardware then sadly that is where we are.

dceejay avatar Feb 19 '24 10:02 dceejay

Thanks. I'll let you know if it fails again.

mikemelga avatar Feb 19 '24 10:02 mikemelga

I have the same problem: the node stops receiving data from the serial even though the Arduino is still running perfectly; if in the middle of some data record, resetting the Arduino will cost me lots of money as I must start the experiment over.

hayderismael avatar Feb 19 '24 18:02 hayderismael

Same Issue: Openwrt 19.07.7 NPM 6.14.18 Node.js v14.19.3 Node-Red 2.2.2 node-red-node-serialport 1.0.1

Node hangs after 1, 2 or more weeks, period cannot be reproduced. If I address the serial port directly via Openwrt CLI, the data still arrives. So it's not the system's fault.

I'm upgrading to node-red-node-serialport v1.0.4 on Wednesday and will report if it breaks

mili2057 avatar Feb 27 '24 06:02 mili2057

I have a similar issue where data stops arriving after a few hours, can sometimes be days. Restarting the nodered.service fixes the issue.

I may need to auto restart the service every x hours

james-barrett avatar Mar 05 '24 09:03 james-barrett

I was using 1.0.1. I've just updated to 2.0.2. Restarting the port should not be needed in first place.

I'll see how this version behaves.

Thanks.

Been using it since and it hasn't failed yet. Hope it keeps this way. :)

mikemelga avatar Mar 05 '24 10:03 mikemelga

I've recently updated and it's gone from every few days to every few hours, it's worse than ever.

Also now a restart of the service won't help it needs a system reboot

james-barrett avatar Mar 08 '24 19:03 james-barrett

I've recently updated and it's gone from every few days to every few hours, it's worse than ever.

Also now a restart of the service won't help it needs a system reboot

Which Version do you use before and after the Update?

mili2057 avatar Mar 08 '24 22:03 mili2057

I'm not sure on the previous version but I'm using the current version that the raspberry pi script pulls from the node red site.

james-barrett avatar Mar 08 '24 22:03 james-barrett

Same Issue: Openwrt 19.07.7 NPM 6.14.18 Node.js v14.19.3 Node-Red 2.2.2 node-red-node-serialport 1.0.1

Node hangs after 1, 2 or more weeks, period cannot be reproduced. If I address the serial port directly via Openwrt CLI, the data still arrives. So it's not the system's fault.

I'm upgrading to node-red-node-serialport v1.0.4 on Wednesday and will report if it breaks

I have had two test devices running 1.0.4 since March 21st, and the node on one of them crashed again yesterday afternoon.

mili2057 avatar Mar 26 '24 06:03 mili2057