[SOLVED] Need help with IR protocol checksum or CRC of Daikin air conditioner

Before I ask my question, a little background information. If you wish to skip the explanation, go right ahead to where I write "THE QUESTION" in bold caps.

After extensively trying to decode the IR protocol of my Daikin AC, I was able to extract the data bits from the payload. I won't get into too much details of how or what I found but in essence, every remote press sends a total of 137 pulses and pauses which look something like this:

        9812, 9784, 9792, 9804, 4616, 2484, 384, 344, 384, 924,
        388, 928, 388, 352, 384, 924, 392, 348, 388, 344,
        384, 360, 384, 344, 384, 924, 388, 352, 384, 348,
        384, 928, 388, 348, 384, 348, 384, 360, 384, 576,
        116, 388, 384, 928, 388, 352, 384, 928, 384, 352,
        384, 348, 384, 360, 384, 344, 384, 928, 384, 352,
        384, 348, 388, 348, 384, 352, 384, 348, 384, 360,
        384, 920, 388, 348, 384, 356, 380, 924, 388, 924,
        388, 348, 388, 920, 388, 356, 388, 340, 388, 348,
        388, 348, 384, 348, 384, 352, 384, 932, 388, 348,
        384, 940, 388, 344, 384, 928, 388, 928, 388, 348,
        388, 924, 388, 348, 388, 344, 388, 356, 384, 920,
        388, 924, 388, 932, 384, 352, 384, 924, 388, 928,
        392, 920, 388, 356, 384, 20328, 4592

After looking for answers online and seeing how others did their decoding, I was able to conclude that the first 6 timings are the start pulses and the last 3 are stop pulses. It became pretty obvious that what remained between them were 128 bits of data:

a pulse followed by a short pause = 0
a pulse followed by a long pause = 1

I began decoding many different signals and managed to find a pattern. As a result, I was able to decode all the settings sent by the AC remote and found that the information were grouped in nibbles instead of bytes.

After taking an insane number of measurements, I was able to conclude that the first 2 nibbles never change, and the last nibble contains some kind of checksum or error checking (CRC?).

So now,

THE QUESTION:
How do I reverse engineer the checksum in that last nibble? I am hoping someone can point me in the right direction to find an answer.

Here is my analysis (so far) with some sample readings:

sample readings

Sorry for the external link but I can't fit everything into this post.

As you can see, some bits stay the same regardless of what is sent, most significantly the first two nibbles 0110 1000. The last nibble changes in every single transmission and I think that is the checksum.

Can someone here help point me in the right direction so I can figure this out?

Thank you so very much in advance.

Looks like a simple sum. NOTE: The bits are in reverse order: 1000=1, 0110=6, 1110=7

I picked a section and removed some columns that didn't change:

# Changing Temperature Settings:
x|1010|0010|x|1010|x|0110|1000|x|1001  (ModeCooFan0Swing1Temp16)
x|1010|0010|x|1010|x|1110|1000|x|0101  (ModeCooFan0Swing1Temp17)
x|1010|0010|x|1010|x|0001|1000|x|1101  (ModeCooFan0Swing1Temp18)
x|0110|0010|x|1010|x|1001|1000|x|1011  (ModeCooFan0Swing1Temp19)
x|0110|0010|x|1010|x|0000|0100|x|1010  (ModeCooFan0Swing1Temp20)
x|0110|0010|x|1010|x|1000|0100|x|0110  (ModeCooFan0Swing1Temp21)
x|1110|0010|x|1010|x|0100|0100|x|0001  (ModeCooFan0Swing1Temp22)
x|1110|0000|x|1010|x|1000|0100|x|1001  (ModeCooFan0Swing1Temp23)
x|0001|0010|x|0010|x|0010|0100|x|1101  (ModeCooFan0Swing1Temp24)

If you look at the first two samples, the only difference is one nibble going from 6 (0110) to 7 (1110):

x|1010|0010|x|1010|x|0110|1000|x|1001  (ModeCooFan0Swing1Temp16)
x|1010|0010|x|1010|x|1110|1000|x|0101  (ModeCooFan0Swing1Temp17)

The corresponding check nibble goes from 9 (1001) to 0xA (0101). That's an increase of 1.

If you look at the 2nd and 3rd lines, the only difference is a nibble going from 7(1110) to 8 (0001):

x|1010|0010|x|1010|x|1110|1000|x|0101  (ModeCooFan0Swing1Temp17)
x|1010|0010|x|1010|x|0001|1000|x|1101  (ModeCooFan0Swing1Temp18)

The corresponding check nibble goes from 0xA (0101) to 0xB (1101). That's also an increase of 1.

Wow thank you so very much!

I wish I had checked here earlier. It would have saved me a lot of trouble trying different things. I even went to the extent of brute forcing the CRC algorithm on the numbers (didn’t work of course).

In the end I tried the exact same thing you suggested here and got consistently correct results except for maybe one or two which could have just been botched pulses (see attachment).

johnwasser:
Looks like a simple sum. NOTE: The bits are in reverse order: 1000=1, 0110=6, 1110=7

I picked a section and removed some columns that didn’t change:

# Changing Temperature Settings:

x|1010|0010|x|1010|x|0110|1000|x|1001  (ModeCooFan0Swing1Temp16)
x|1010|0010|x|1010|x|1110|1000|x|0101  (ModeCooFan0Swing1Temp17)
x|1010|0010|x|1010|x|0001|1000|x|1101  (ModeCooFan0Swing1Temp18)
x|0110|0010|x|1010|x|1001|1000|x|1011  (ModeCooFan0Swing1Temp19)
x|0110|0010|x|1010|x|0000|0100|x|1010  (ModeCooFan0Swing1Temp20)
x|0110|0010|x|1010|x|1000|0100|x|0110  (ModeCooFan0Swing1Temp21)
x|1110|0010|x|1010|x|0100|0100|x|0001  (ModeCooFan0Swing1Temp22)
x|1110|0000|x|1010|x|1000|0100|x|1001  (ModeCooFan0Swing1Temp23)
x|0001|0010|x|0010|x|0010|0100|x|1101  (ModeCooFan0Swing1Temp24)








If you look at the first two samples, the only difference is one nibble going from 6 (0110) to 7 (1110):


x|1010|0010|x|1010|x|0110|1000|x|1001  (ModeCooFan0Swing1Temp16)
x|1010|0010|x|1010|x|1110|1000|x|0101  (ModeCooFan0Swing1Temp17)



The corresponding check nibble goes from 9 (1001) to 0xA (0101). That's an increase of 1.


If you look at the 2nd and 3rd lines, the only difference is a nibble going from 7(1110) to 8 (0001):


x|1010|0010|x|1010|x|1110|1000|x|0101  (ModeCooFan0Swing1Temp17)
x|1010|0010|x|1010|x|0001|1000|x|1101  (ModeCooFan0Swing1Temp18)



The corresponding check nibble goes from 0xA (0101) to 0xB (1101). That's also an increase of 1.

reverseSum.txt (80.3 KB)