jlong23 / node-red-node-ademco

Ademco Alarm Panel Parser for Node-Red
0 stars 0 forks source link

Reading from tcp stream (ser2sock) #4

Closed jdesai61 closed 3 years ago

jdesai61 commented 3 years ago

I have a RPI connected to AD2USB device and sending data on a TCP port.

I created a "tcp in" node and fed the output to AdemcoListener node. However, since tcp node is not buffering data in any meaningful way, the AdemcoListener node sometimes fails to parse the input data. For example, the input buffer only contains
"[10000001100000000A--],2fc,[f73f400"
(the rest of data comes in next buffer from tcp in node).

I suppose I can put some kind of buffering node in between that only sends fully formed messages, but it would be nice for this node to wait for fully formed input.

If I were to write my own buffering node - would I simply wait for newline, before I pass the message on?

jdesai61 commented 3 years ago

I was able to set the "tcp in" node to wait for a newline and things are working fine.