NodeRed serial ports keep disconnecting

Hi there. I am having issues with serial connections in NodeRed. I am using the 'node-red-node-serialport' node to connect a Raspberry Pi 5b to various serial USB devices controlled by PIC24's.

This works fine, but if I leave the setup running for long enough then eventually some will timeout. This seems restricted only to devices connected to USB ports on the PI, whilst the other devices on a USB extension (which in itself is plugged into the PI of course), stay working fine. All start timing out at the same time, it is not a gradual failure.

'dmesg | grep usb' shows:

[54676.834941] ftdi_sio ttyUSB2: usb_serial_generic_read_bulk_callback - urb stopped: -32
[54676.835316] pl2303 ttyUSB0: usb_serial_generic_read_bulk_callback - urb stopped: -32

repeated... ~ 10 times

This perfectly coincides with when I stopped receiving returns from requests in NodeRed, I only have 2 things unexplained:

  1. I stopped receiving data from 3 devices acc. to NodeRed - not just the 2 I can see in dmesg
  2. Disabling power management did not remedy the situation, and I am now stuck, as explained below:

My first thought was that this was a power management issue, so I set all the USB devices to autosuspend off:

for d in /sys/bus/usb/devices/*/power/control; do
    echo on | sudo tee "$d"
done

However I still get the same recurring issue.

Manually requesting using, echo -ne "" > /<DEVICE_PATH> & cat /<DEVICE_PATH> | xxd, stops working at the same time too. It is not just NodeRed failing to request data from these, I have to restart the computer to get them to work again at all.

Have I disabled it wrong? Are there any other suggestions as to the issue being entirely different?

Interesting... This has been reported several times over the years - and so far we have been unable to pin it down... but the fact that you have found that the echo also stops working is pointing to something outside of Node-RED which is both good and bad. Good in that it is not something we are doing (or not doing) in Node-RED - but bad in that we are still none the wiser as to what it could be and how to fix it. If it was a generic problem you would think you would see more reports elsewhere of the serial port stopping , which I don't really see "outside" of Node-RED world - so...

Yes it's interesting isn't it. It's clear its an OS/driver issue rather than a NodeRed one given even the basic request fails.

I've found other cases of people having similar issues on raspbian OS Pi's, but I don't know what the common factor is. Does anyone know if its possibly a Pi issue or just a linux issue etc. ? I haven't used NodeRed on anything other than a Raspberry Pi before so genuinely have no idea.

I am running Armbian not Raspbian for context.

I think its very interesting that the devices attached through the USB hub don't fail. The HUB itself is attached through the same set of USB ports that seem to go down for individual devices, but non of the ports the HUB exposes go down.

I feel like the solutions in there somewhere, I could just plug in another HUB by this logic and solve it, but that seems a waste.