How to test serial port ttyAMA0
on RPI by connecting RX and TX. with wire? Thanks.
There is no communication between the two.
Export the four nodes and paste them here so we can see how you have configured them.
[
{
"id": "7806614b4a6f9ddd",
"type": "tab",
"label": "Flow 1",
"disabled": false,
"info": "",
"env": []
},
{
"id": "0f6be78ea759416a",
"type": "serial in",
"z": "7806614b4a6f9ddd",
"name": "",
"serial": "11234b1dfd906877",
"x": 530,
"y": 100,
"wires": [
[
"7b1ddc679dba86e0"
]
]
},
{
"id": "74af457044185c4e",
"type": "serial out",
"z": "7806614b4a6f9ddd",
"name": "",
"serial": "11234b1dfd906877",
"x": 350,
"y": 100,
"wires": []
},
{
"id": "792d3f6a9589ccf4",
"type": "inject",
"z": "7806614b4a6f9ddd",
"name": "",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "test_serial",
"payloadType": "str",
"x": 160,
"y": 100,
"wires": [
[
"74af457044185c4e"
]
]
},
{
"id": "7b1ddc679dba86e0",
"type": "debug",
"z": "7806614b4a6f9ddd",
"name": "debug 1",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"statusVal": "",
"statusType": "auto",
"x": 700,
"y": 100,
"wires": []
},
{
"id": "11234b1dfd906877",
"type": "serial-port",
"serialport": "/dev/ttyAMA0",
"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"
}
]
You have told the serial node to wait for \n
before passing on the data, but you are not sending any \n
characters.
If you can please return me the code with the correct settings. Thanks.
In fact, rather than splitting on a character, as a test, change that option to use a timeout and see if you get anything then.
No data again.
Does it work if you use something like minicom to drive the serial port? See this, for example.
This is the result. The link turned out to be very useful. Thanks. But problem with Node red is not solved yet.
What command line did you use for that?
PuTTY terminal. I'm sure it's working because when I remove the short I get no characters.
Try it in node-red using the Request node instead of separate In and Out. If you are sending a message and expecting a reply that is the one to use anyway.
There was a similar post recently where someone could not get it going with separate in and out.
Make sure you stop putty before starting node-red.
How did you install node-red?
@knolleary do you want to comment on this? Apparently serial loopback would not work using separate In and Out nodes, but does using a Request node.
I was sure there was a similar issue recently, but can't seem to find it. I can't test it myself as I haven't got any appropriate hardware. Perhaps someone else can try it.
I have not used the serial node for a long time. If there's an issue please raise it in the usual manner. @dceejay is more likely to be in a position to investigate.
What exactly do you mean, connection between two RPIs? If so, I'll try and find an answer.
Sorry I don't know where I said that.
The idea is to connect two separate devices and find out if the individual nodes work. Sorry for my bad English but I use a translator because I can't translate or write everything myself.
That would be a good test, if you have two devices to try it on. Start with only an Out node on one and an In node on the other.
The latest translators are usually incredibly good, but sometimes the result is not completely clear.