Serial communication problem

I'm using Node-Red to connect a laptop to a Mitsubishi Alpha-2 microcontroller via an usb-serial cable.

The communication doesn't start immediately when I fire up my laptop.
Initially I suspected a permissions issue in Linux, but I'm no longer sure that this is the problem.

Powercycling the Alpha-2 does not work.
Rebooting the laptop does not work.
However, when I restart the Node-RED process ( node-red-restart ), the communication is magically restored. I suspected the first node-red process might have had a different owner but that is not the case, I checked.

Any ideas?

This sounds very like a problem a week or two back. Have you configured node red to autostart on boot? If so then if you disable autostart
sudo systemctl disable nodered
and reboot, then start nodered is it ok? If so then node-red is starting too quickly and the serial port doesn't function for some so far unknown reason. Have a look at this post which tells you how nodered can be delayed on boot, which fixed the problem in this case Serial woes.. buffer issue?

Which Node are you using to communicate with the Controller?

Thanks a lot. Problem solved.

Was it the timer that fixed it?
Are you using the standard serial node?

I'm using node-red-node-serialport and yes, the delay on boot fixed my problem.

@dceejay I don't know whether you want to consider this. This is the second Pi recently that seems to have a problem with the serial port on boot, fixed by delaying the node-red start. I haven't got any hardware to try it myself.

How does the comms work? Does node red poll it for data or does it send data automatically?

Node-RED polls for data.
By the way, Node-RED is running from a (very old) laptop, not from a Pi.
The OS is Xubuntu 20.04.1 LTS

Oh yes, sorry I got confused.
Obviously not a Pi related issue. The previous instance was one where the device was continually sending data, so it isn't that either, as yours polls.

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