3
votes

I had a long time decoding IR codes with optimum's Ken Shirriff Arduino Library. I modified the code a bit so that I was able to dump a Samsung air conditioner (MH026FB) 56-bit signals.

The results of my work is located in Google Docs document Samsung MH026FB AirCon IR Codes Dump.

It is a spreasheet with all dumped values and the interpretation of results. AFAIK, air conditioner unit sends out two or three "bursts" of 56 bit data, depending on command. I was able to decode bits properly, figuring out where air conditioner temperature, fan, function and other options are located.

The problem I have is related to the checksum. In all those 7-byte codes, the second one is computed somehow from the latter 5 bytes, for example:

BF B2 0F FF FF FF F0   (lead-in code)
7F B8 8A 71 F6 4F F0   (auto mode - 25 degrees)
7F B2 80 71 7A 4F F0   (auto mode - 26 degrees)
7F B4 80 71 FA 7D F0   (heat mode - 26 degrees - fan auto)

Since I re-create the IR codes at runtime, I need to be able to compute checksum for these codes.

I tried with many standard checksum algorithms, none of them gave meaningful results. The checksum seems to be related to number of zeroes in the rest of code (bytes from 3 to 7), but I really can't figure it how.

Is there a solution to this problem?

4
I know the question is a bit old, but since the 56-bit Samsung decoder is not in Sherriff's library, if the OP still has his work, could he please upload it somewhere (github) or, better, create a pull request into Shirriff's repository?Alex Mazzariol
the code has been embedded long ago inside Souliss open-source framework. You may look thereShine

4 Answers

3
votes

Ken Shirriff sorted this out. Algorithm is as follow:

  1. Count the number of 1 bits in all the bytes except #2 (checksum)
  2. Compute count mod 15. If the value is 0, use 15 instead.
  3. Take the value from 2, flip the 4 bits, and reverse the 4 bits.
  4. The checksum is Bn where n is the value from the previous step.

Congraturations to him for his smartness and sharpness.

1
votes

When bit order in bytes/packets and 0/1 are interpreted properly (from the algorithm it appears that both are reversed), the algorithm would be just sum of 0 bits modulo 15.

1
votes

It is nearly correct. Count the 0's / 1's (You can call them what you like, but it is the short signals). Do not count 2. byte and first/last bit of 3.byte (depending if you are seeing it as big or little indian). Take the result and -30 (29-30 = 15, only looking af 4 bits!) Reverse result Checksum = 0x4 "reverse resultesult", if short signals = 0, and 0xB "reverse resultesult" if long signal = 0.

0
votes

i used Ken's method but mod 15 didnt work for me.

Count the number of 1 bits in all the bytes except #2 (checksum) Compute count mod 17. if value is 16, use first byte of mode result(0). Take the value , flip the 4 bits. The checksum is 0xn9 where n is the value from the previous step.