I want to control the switching on and off of my monitor in Telnet via the new TCP binding, I communicate well with it but the hexadecimal string received by the monitor contains an additional value that I cannot explain to myself
The frame expected by the monitor is: “hAAh11h00h00h01h12”
and when I send this frame the monitor receives
“hC2hAAh11h00h00h01h12”
This is against the rule I use.
rule “TV Samsung Power”
when
Item Val_samsung_PWR received update
then
if (Val_samsung_PWR.state == ON){
var String MyNumber = “u00AA\u0011\u0000\u0001\u0001\u0013” // SAMSUNG POWER ON
TCPUDPClient_TCPsendString.sendCommand(MyNumber)
logInfo (“TV Samsung Power”, “TV On”)
}
if (Val_samsung_PWR.state == OFF){
var String MyNumber = “\u00AA\u0011\u0000\u0001\u0000\u0012” // SAMSUNG POWER OFF
TCPUDPClient_TCPsendString.sendCommand(MyNumber)
logInfo (“TV Samsung Power”, “TV Off”)
}
end
Why is there an additional hC2 value before the hAA header.
Thanks for your help.
But you’re not 'sending either of these, you are creating a string command in some fashion, and exactly how you do that may be relevant.
I’m sure it’s as you already showed n the rule, but lets be clear.
It does all rather feel like encoding issue of bytes > x80.
I made the modification in “thing” and indeed it is the correct frame now. However, there remains a problem, I use the “Hercules” utility under Windows to test the control of the monitor and it works very well but with OpenHAB nothing happens even though the good frames sent are indeed linked.
How can I check what the monitor is responding when I am connected with OpenHAH?
I’ve done various tests and checks but I don’t understand what’s going on.
I compared the frames sent by the TCP thing and the frame sent from the “Hercules” utility with a PC and they are identical.
With the “Hercules” utility I have the answer to send (see img_1) how can I see the answer in the TCP thing?
The problem seems solved.
I have to send the frame twice, obviously according to the openhab log file, the first opens the connection and the second triggers the command.