Sending an Hex Command over TCP

#1

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:

#2

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

#3

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

#4

Thx for your fast response.

This is a Picture of my Flow:

#5

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":[[]]}]
#6

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?

#7

@dceejay

the same Message send as Buffer:
image

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

#8

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

#9

Ok i found it

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

#10

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:

#11

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

#12

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?

#13

What is wanted is an example you know works

#14

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.

#15

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.

#16

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