0

I have been trying to decode the Raw Code from the AC remote on raspberry pi 2.

I am not able to decode it in hex value.

Here is the Raw code for On and Off :

name bhutOn

  8423     4226      566      544      576     1617
  571     1622      576      537      573     1620
  568      545      574     1618      571      549
  571     1621      577      536      574     1619
  569     1624      574      538      572     1629
  559     1627      572      548      571      540
  570      542      567      545      575      537
  572      541      568      542      568      544
  576      543      566      546      574      538
  571      541      569      542      567      545
  575      542      567      539      571      549
  570     1622      577     1617      571      541
  568      544      566      551      569     1619
  569      543      566      553      567      544
  576      563      546      566      543      568
  542      576      544      562      547      564
  545      575      545      566      543      569
  541      571      548      564      546      538
  571      542      568      543      576      543
  577      535      574      538      572      539
  570      542      567      545      575      536
  574      545      564      549      571      540
  569      543      577      535      574      537
  573      539      570      542      567      545
  575      545      575      536      574      537
  572      540      569      543      577      534
  575      537      573      539      570      549
  571      541      568      544      575      536
  574      538      571      541      569      543
  577      534      575      545      575      536
  573      539      571      541      568      544
  576      535      574      538      571      541
  569      550      569      543      567      544
  575      544      566      539      571      541
  568      560      560      535      574      545
  574      538      572      540      569      543
  567      572      547      563      547      565
  544      568      541      578      542     1625
  573     1620      569      546      564      545
  574      538      572     1621      567      545
  575      529      570

name bhutOff

  8421     4223      566      543      566     1626
  572     1622      577      536      574     1618
  569      543      567     1626      573      547
  572     1621      573      539      575     1618
  570     1624      574      538      572     1621
  567     1627      571      548      571      541
  569      542      567      545      575      536
  573      539      570      542      568      544
  575      544      576      536      573      538
  572      540      569      543      566      546
  574      537      572      540      580      539
  570     1623      576     1618      570      569
  540      571      549      563      546     1620
  568      571      549      570      550      562
  547      565      545      567      542      569
  541      571      548      563      547     1620
  568     1633      576      563      546      565
  544      568      542      570      549      562
  547      565      545      568      541      550
  570      542      577      535      575      537
  572      540      569      542      568      544
  575      537      573      546      573      538
  572      540      569      543      577      535
  574      537      572      540      570      569
  540      552      568      571      548      563
  547      565      544      568      541      571
  549      562      547      565      545      574
  545      567      543      569      540      545
  575      537      572      539      571      541
  568      544      576      543      576      536
  573      539      571      540      569      543
  567      545      574      537      572      540
  570      550      569      542      568      544
  575      537      573      539      570      541
  569      543      566      546      574      545
  574      538      572      539      570      542
  567      545      575      537      573      538
  571      541      568      551      569     1624
  574     1619      570     1624      574     1619
  570      543      566     1626      572      540
  569      535      57

Raspberry pi is not able to decode the Raw code and showing following error as :

pi@raspberrypi ~ $ sudo irrecord -a /home/pi/temp1.conf
Unknown encoding found.
irrecord: decoding of on failed
irrecord: decoding of off failed
#
# this config file was automatically generated
# using lirc-0.9.0-pre1(emulation) on Sun Mar 13 13:19:20 2016
#
# contributed by 
#
# brand:                       lgac
# model no. of remote control: 
# devices being controlled by this remote:
#

begin remote

  name  lgac
  bits            0
  flags RC5
  eps            30
  aeps          100

  one             0     0
  zero            0     0
  gap          28205
  toggle_bit_mask 0x0

      begin codes
      end codes

end remote
pi@raspberrypi ~ $

I am new to Raspberry pi. Any help would be great. Thanks in advance. :)

  • you sure it is rc5 encoded? – old_timer Mar 20 '16 at 11:57
  • I don't know about rc5 . Can you please tell me how to check whether it is rc5 encoded or not. This is the data i received after giving signal through remote. I followed the steps from this below link to install "LIRC" : http://alexba.in/blog/2013/01/06/setting-up-lirc-on-the-raspberrypi/. – JAY KSHATRIYA SHAKTAWAT Mar 20 '16 at 14:47
  • personally I couldnt tell without looking at the signal from the receiver. http://www.sbprojects.com/knowledge/ir/ It may be possible to look up the model number of your remote, or just try the different protocols supported by lirc. – old_timer Mar 20 '16 at 14:55
  • Hello @dwelch. I am adding image link of remote. http://i.imgur.com/ANuhpSo.jpg. The raw data in the question is of the On/Off button of remote. Do you think the data is not proper or it should be something else.? I have seen the rc5 algorithm on internet, can we create the hex code for this raw message from this algorithm.. – JAY KSHATRIYA SHAKTAWAT Mar 21 '16 at 12:34

1 Answers1

1

I know this is an old question, but maybe it helps someone else who (like me) stumbles onto this via a web search.

First of all, since this is an AC remote, those are not "the on and off button". An AC remote usually sends the full state of the remote (on/off, set temperature, mode, fan speed, etc) with each button press. This is done in order to keep the remote screen synchronized with the actual AC device (since there is no feedback from the AC to the remote).

So, for example, the first code might be "AC on, 20 degrees, automatic fan speed, mode cooling".

old_timer's question was referring to the fact that you listed the remote as RC5 in your config file ("flags RC5" - RC5 is one protocol used by some remote controls). But it is most likely not RC5...

Your best bet right now (and what I ended up doing) is to record the signals for your most frequently used settings, and create a config file with the actual raw codes. Like this:

begin remote

name  MY_REMOTE
flags RAW_CODES

begin raw_codes

      name SETTING1
 8423     4226      566      544      576     1617
 571     1622      576      537      573     1620
 ...

If you wish to decode this further, your code looks similar to the one on my AC (a Samsung one). The bits (after the 8400/4200 start delimiter) seem to be encoded as 550/550 for a zero, and 550/1600 for a one. (that is, 550us of LED on time followed by 550us of off time encode a zero bit; 550us/1600us encode a one).

Once you have the bits, you will need to try and make sense of it - change settings, and see how the code changes. However, you will soon find that the rabbit hole quickly gets deeper:

  1. You still need to find out the "endianness" of each byte (my Samsung unit sends the bytes LSB-first - that is, the least significant bit of each byte is first "on the wire")
  2. Most AC units also have a checksum (to ensure that there were no errors in the transmission). If you want to generate your own codes, you will also need to compute and transmit the correct checksum.

As mentioned above, I ended up just using the raw codes in my LIRC config file :)

Bogd
  • 673
  • 9
  • 16