I need to connect my Node-RED Instance to a TCP Server in a special way. The packet is described as follows:
Description of the packet
4 first bytes : the magic number 0xDEC0DA6E stored in little endian (lower byte first)
4 next bytes : the length of the data in bytes stored in little endian (lower byte first)
the content : a JSON tree in UTF8
The JSON tree is no problem to create, but does anybody know how to get these additional bytes combined into the msg.payload to send out via the TCP Nodes?
I deleted the "0x" from the HeaderBytes so that the raw payload seems to be correct, but don't get any connection. [EDIT]: ...and - of course - changed the order of the Header Bytes because of the "lower byte first"...
Also the SizeBytes seems to be right - the first byte changes if I give one more character into the payload. But most probably there's some information missing for them to work.
I'll give a short feedback as soon as I managed to get the connection done!