TCP request re-use

#1

I have a device I want to query with a specific sequence of commands. I have used the TCP request node, which sends the first message fine. I can see the message go out in Wireshark and get an acknowledgment. The acknowledgement carries no data though, so node-red seems doesn't seem to realise there's been any response. If I carry on anyway and try to send the next message in the set I get the error "TypeError: Invalid data, chunk must be a string or buffer, not object". I understand what this is saying, but the payload is certainly a string (tried buffer too) and the payload works fine if I send it before the first message. If I try to send the same message twice, it works the first time but gives that error on the second send. Indicating that the data itself isn't the problem.

How can I get the node to send sequential payloads without expecting anything more than an empty acknowledgement?

I have tried opening fresh connections each time, which doesn't error on the tcp request, but also doesn't work for keeping a session.

0 Likes

#2

the tcp request node in 0.19 currently has a bug that gives that error. A fix is in master and will be released soon. see here if you want to apply it manually.

0 Likes

#3

Ah! So if I install from github then the fix will be present? Hopefully that fixes my issue!

0 Likes

#4

Sorted. Cloned from github and now it send the sequential messages correctly. Many thanks!

0 Likes