2018-06-20, 12:05 PM
(2018-06-20, 11:45 AM)Smartell Wrote: Thanks Paddy,
I have used node red before to test the different "endings" \r , \n, $ etc. and then with the correct setting for NASA (\r) , seen the stream in the debug window...nice and clean. I guess that you are saying that i can send that stream i see back to KLPEX?
/Micael
Yep, you can send it back using UDP after adding a LF. This seems to work, I made a NMEA sentence with just a new line (\n) then sent it to openplotter/kplex. Wasn't accepted so stripped the new line and added a linefeed & newline and it is accepted.
- msg.payload = msg.payload.trim() + "\r\n";
Copy this code then in node red press cntrl "i" to insert. Then you need to add a KPLEX UDP input set to 10.10.10.1 port 10111 (or change the port if you want in node red.) Then connect the serial input to this function node/UDP output node and it should fix the missing line feed. Hopefully!
Code:
[
{
"id": "8d15bf00.b4f3f",
"type": "function",
"z": "3f30ea31.da3756",
"name": "",
"func": "msg.payload = msg.payload.trim() + \"\\r\\n\";\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 530,
"y": 1380,
"wires": [
[
"5c27d805.90e408",
"145eceea.6c9d31"
]
]
},
{
"id": "5c27d805.90e408",
"type": "udp out",
"z": "3f30ea31.da3756",
"name": "",
"addr": "10.10.10.1",
"iface": "",
"port": "10111",
"ipv": "udp4",
"outport": "",
"base64": false,
"multicast": "false",
"x": 680,
"y": 1440,
"wires": []
}
]