arduinoesp8266nodemcu

Understanding IR codes for Samsung TV


Can somebody help me to understand how could I use RAW IR data in an project using ESP8266-HTTP-IR-Blaster library ?

I've created a NodeMCU board with an IR sender and receiver according to https://github.com/mdhiggins/ESP8266-HTTP-IR-Blaster

Everything is working fine as long as I'm using the captured codes for ex.: http://NodeMCU-IP/msg?code=E0E040BF:SAMSUNG:32 This is the Code for the Power button (E0E040BF)

As I'm using it in a home automation system, it would very beneficial for me if I had a dedicated ON and OFF sequence, which I found here: http://www.remotecentral.com/cgi-bin/mboard/rc-discrete/thread.cgi?5780 , but unable to translate, modify, or send it via RAW data.

Using Node-red, tried many ways, also implemented a MQTT client to the original project, but did not accept these codes anyhow I try. Does not sends it.

Also tried as a JSON, didn't help.

[
    {
    "type":"raw",
    "data":"[0000, 006D, 0000, 0022, 00AC, 00AC, 0015, 0040, 0015, 0040, 0015, 0040, 0015, 0015, 0015, 0015, 0015, 0015, 0015, 0015, 0015, 0015, 0015, 0040, 0015, 0040, 0015, 0040, 0015, 0015, 0015, 0015, 0015, 0015, 0015, 0015, 0015, 0015, 0015, 0015, 0015, 0015, 0015, 0015, 0015, 0040, 0015, 0040, 0015, 0015, 0015, 0015, 0015, 0040, 0015, 0040, 0015, 0040, 0015, 0040, 0015, 0015, 0015, 0015, 0015, 0040, 0015, 0040, 0015, 0015, 0015, 0689]",
    "khz":38
    }
]

Any idea what could I try next?


Solution

  • A good introduction to the 'Pronto format' that you show above is at Remote Central

    For the specific example above, for a Samsung OFF code given at your remote central link, the full code is given as a sequence of 16-bit numbers represented in hexadecimal with spaces in between:

    0000 006D 0000 0022 00AC 00AC 0015 0040 0015 0040 0015 0040 0015 0015 0015 0015 0015 0015 0015 0015 0015 0015 0015 0040 0015 0040 0015 0040 0015 0015 0015 0015 0015 0015 0015 0015 0015 0015 0015 0015 0015 0015 0015 0015 0015 0040 0015 0040 0015 0015 0015 0015 0015 0040 0015 0040 0015 0040 0015 0040 0015 0015 0015 0015 0015 0040 0015 0040 0015 0015 0015 0689
    

    You can break that down as:

    To interpret the data manually, copy it out (e.g. into a text editor) in groups of 8 numbers:

    0015 0040 0015 0040 0015 0040 0015 0015 
    0015 0015 0015 0015 0015 0015 0015 0015 
    0015 0040 0015 0040 0015 0040 0015 0015 
    0015 0015 0015 0015 0015 0015 0015 0015 
    0015 0015 0015 0015 0015 0015 0015 0040 
    0015 0040 0015 0015 0015 0015 0015 0040 
    0015 0040 0015 0040 0015 0040 0015 0015
    0015 0015 0015 0040 0015 0040 0015 0015 
    

    Then:

    For the first line

    0015 0040 0015 0040 0015 0040 0015 0015 
    

    ignoring the 1st, 3rd, 5th and 7th columns leaves:

    0040 0040 0040 0015 
    

    replacing those with 1's and 0's

    1    1    1    0
    

    and if you convert that into hexadecimal, it's 'E'

    Next line is '0', then 'E' then '0' (already it's comforting to see it starting with the same E0E0 that starts your other Samsung code above...), and the remaining lines make it E0E019E6

    Doing the same with the ON code gives you E0E09966

    And as I've needed to solve the same problem just recently for the same codes, I can confirm that my Samsung TV responds to those codes as OFF and ON.

    Not surprisingly, there are a variety of software tools to convert between formats, and a huge range of formats to describe the same signal (explained very well by xkcd). For example, irdb on GitHUB will decode the above string to "Protocol NECx2, device 7, subdevice 7, OBC 152". It's up to you to know that you have to