Sending an Hex Command over TCP

Hi,

i´m trying to read out my Central Heating.
It have an RS232 port and i will send an Command over Node-red (based on IoBroker), over a Usr-TCP232 (Serial Port converter).

I try to send this Hex Command:
0x7B 0x4D 0x43 0x00 0x04 0x1F 0x0a 0x08 0x00 0x0d 0x7D

But i don´t get an Answer, i sent it via String.
Sorry but i´m new and just begin to learn.

I hope some one understand my terrible Englisch an can help me :slight_smile:

Whats the actual flow you are using in Node-RED?

You can't send it as a string because 0x00 is the string terminator and the receiver will see it as end of the string.
You have to send it as bytes

Thx for your fast response.

This is a Picture of my Flow:

You will need to send it as a buffer type

eg like this

[{"id":"c43eb6d0.a40ec8","type":"inject","z":"df0a9f4b.bc75b","name":"","topic":"","payload":"[\"0x7B\",\"0x4D\",\"0x43\",\"0x00\",\"0x04\",\"0x1F\",\"0x0a\",\"0x08\",\"0x00\",\"0x0d\",\"0x7D\"]","payloadType":"bin","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":170,"y":60,"wires":[[]]}]

The heater Company gave me a document: (Picture of an .pdf)

and i read on a Homepage messages should be send as HEX so i tried it with String.
How can i sen it as bytes?

@dceejay

the same Message send as Buffer:
image

but i think this is not what you mean, sorry.

hmm no... set up an inject... in binary mode (the 0110 logo)

image

with

["0x7B","0x4D","0x43","0x00","0x04","0x1F","0x0a","0x08","0x00","0x0d","0x7D"]

as the payload

1 Like

Ok i found it

Debug logs:
22.2.2019, 19:10:50node: c8667d1.f89de8msg.payload : undefined

If i take a look on the webinterface of USR i can see:

Sending as String RX Count.
Sending as Buffer first test RX Count.
Sending as last test RX diden`t Count.

TX never counts :frowning:

Though also looking at the doc you pasted there should only be 7 bytes - so the message is too long...

sorry i cant upload the complet .pdf.
i use an example massage from a other hompage, witch i found.
But he scribe his Code in C+.
Could i post a link or is it unwanted in hear?

What is wanted is an example you know works

The command request the Heater to send him Boiler temperature every 10 sec

image

This should be the shortest command, it makes the heater stopping sending Informations:
"{" "M" "E" 0 0 "}"
0x7B 0x4D 0x45 0x00 0x00 0x7D

This is the link to his Page C+ Heater request

But it locks like nothing is sendet if i send request in binary mode.
Only if i click on the ... the paylode is then morpht and it locks like on Debug and USR (web interface) it is sendet.

Thank you for your patience.

I tryed now a few inject tippings of the Code in Binary Mode

Injects with "slash", wouldn't be send, debug log "undefined".
I read in a other tread, that it should be type like "0x7B",
But my heater never response.

@dceejay maybe you are right and my code is to long :roll_eyes:
The datasheet is not clear for me, because its new for me.
I try to contact the Heater Company next week, maybe they can help me.

Thx for all you help and Tips.

Hi
the answer to my problem was not only how to send the command in the right way like:
image

I used a wrong hardware.
At first i took a Serial cable like i read in the Dokument of the heater Company,
but they changed an internal extension cable.
So i have to take an crossed cabel.

No i get Answers from my Heater over USR-TCP232-302.

Thx for all your help and Tips, i hope it helps other People too.

2 Likes

So I am having issues even connecting node red tcp to the usr-tcp232. Can you share your tcp config and the web config of your usr-tcp?
Thanks!

Always best to start a new thread rather than adding to a 5 year old one :slight_smile: