Issue to read serial port

I'm interfacing a Kern weight scale through serial port with Node-RED. The communication works perfectly in a terminal in both direction.
However, I'm only able to write to the serial port with NR with the "serial out" and "serial request" node but I wasn't successful to get any answer form it with either "serial in" or "serial request" nodes.

For example, when I monitor my serial device with "cat /dev/ttyUSB0" in a terminal while sending a message from NR, I get an answer in the terminal but nothing from within NR, "serial request" node goes in timeout and "serial in" remains mute ...

What am I missing ?

nodejs: 12.18.3
node red: v1.1.3
node-red-node-serialport: 0.11

I am not sure whether it would give that symptom, but perhaps the sequence \r\n does not appear in the stream. Have you tried other options there, specify a timeout for example, or fixed lengths with a short count.

I've tried these 2 additional options to configure the "input":

  • split the input into fixed length
  • and set a timeout
    but I neither get any answer from the serial port in NR.

What did typed in in the terminal that worked?
Also IO as string?

Do you have a link to the manual from that scale with protocol description.

There is a list of command as indicated here:

I0 is one of these commands that lists the available commands on the device. Commands and answers are ASCII string and end with CRLF.

In a terminal with "picocom --flow n -c --omap crcrlf /dev/ttyUSB0", communication is working fine.

The "serial out" works fine, if I trigger a command with it, I can "cat" the answer from /dev/ttyUSB0 but get nothing from the "out" node.

Can you ensure that only one thing is trying to access the port at one time. You probably can’t share serialport with node-red and picocom st the same time. And indeed maybe even out and request nodes

Thanks for the hint ! That was it !
I've clean up my flow and kept only a single "request" node and killed any other process accessing the port.
After deploying and restarting the flows, it finally captures inbound data from the serial port within NR.


1 Like

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