Serial port loopback test RPI

Working fine for me with a USB serial port - connected pins 2 back to 3

[{"id":"48a1c28c5fef5eb9","type":"tab","label":"Flow 1","disabled":false,"info":"","env":[]},{"id":"22e6235412064bfa","type":"inject","z":"48a1c28c5fef5eb9","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"\"Hello\\n\"","payloadType":"json","x":700,"y":100,"wires":[["9b63980c3b7f3035"]]},{"id":"5ec65b405d70b76a","type":"debug","z":"48a1c28c5fef5eb9","name":"debug 1","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":880,"y":180,"wires":[]},{"id":"9b63980c3b7f3035","type":"serial out","z":"48a1c28c5fef5eb9","name":"","serial":"3f6ec4e6b79b4e9a","x":920,"y":100,"wires":[]},{"id":"a13daad047a079fd","type":"serial in","z":"48a1c28c5fef5eb9","name":"","serial":"3f6ec4e6b79b4e9a","x":690,"y":180,"wires":[["5ec65b405d70b76a"]]},{"id":"3f6ec4e6b79b4e9a","type":"serial-port","serialport":"/dev/ttyUSB0","serialbaud":"57600","databits":"8","parity":"none","stopbits":"1","waitfor":"","dtr":"none","rts":"none","cts":"none","dsr":"none","newline":"\\n","bin":"false","out":"char","addchar":"","responsetimeout":"10000"}]

Just as a check, could you set it to split on a Timeout of 100ms and remove the \n from the inject node? You are then doing exactly the same as the OP I think.

yes - all good.

Ok, thanks. I wonder why it didn't work for @devifast. The world is full of unsolved mysteries.

Pi AMA port can sometimes need enabling, but yeah. No real idea why.

@dceejay it uses a usb port while i use the board pins directly.

In Raspbian, bluetooth must be disabled because it is connected to ttyAMA0 in order to use the pins.https://di-marco.net/blog/it/2020-06-06-raspberry_pi_3_4_and_0_w_serial_port_usage/

It can't be anything like that because it started working as soon as you replaced the In and Out nodes with a Request node, without making any other changes.

What exactly can't be similar? For bluetooth or for ttyUSB0?

I meant that your problem was not caused by bluetooth setup or whether the serial port is properly enabled, or anything like that, as it worked as soon as you changed to using a Request node.


I tried the serial communication between two devices as mentioned above in the post. The conclusion is the following. Bluetooth should be disabled in the /boot/config.txt file like this.

# Disable Bluetooth
dtoverlay=disable-bt

I added this to the end of the file otherwise it gives the following result.


When Bluetooth is disabled and when the port settings are as shown.

The result is the following.

Can you explain what the screenshot indicates please? It is not clear exactly what it shows.

These are the two RPIs connected to RX, TX, and GND. The pictures show the two different IP addresses of the boards. one transmits temperature values ​​to the other. This is clearly visible in the debug column.

So separate In and Out nodes work ok. Can you re-confirm that if you loopback on those devices, instead of coupling across between them, that it does not work?

I don't understand the question correctly, could you elaborate a bit more please?

The problem you had at the start of this thread was that if you tested the serial port, using a Serial In node and a Serial Out node, and connecting Rx to Tx on the Pi (loopback mode) then it did not work. Later you found that it did work if you used a Serial Request node instead of In and Out nodes.

You have now tested with two Pi computers, with Serial In and Out on each Pi and the wires connected between them.

My suggestion was that you try again by connecting Rx to Tx on each device separately to confirm that it still does not work.

I can confirm that it works as I originally expected. Thanks a lot for the support.

1 Like

I don't understand what has changed so that now it works.

I'm puzzled too. I often do installations so we will know where the problem is.

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