1

I have a remote for a LED panel which sends following 4 bytes data and last byte some sort of CRC/counter byte. I already know that the first 2 bytes are remote-id, the third byte is panel-id and the fourth byte is command-id. The last byte is somehow calculated in correlation with the first 4 bytes and does not change on repetitive button-press.

I already tried to use reveng -w 8 -s [some samples] to find the algorithm, but without success.

Maybe someone can help to find the correct way to calculate the last byte of these payload-bytes, and maybe even explain how it was discovered:

FFCC0000CB
FFCC0001CA
FFCC0002C9
FFCC0003C8
FFCC0004CF
FFCC0005CE
FFCC0006CD
FFCC0007CC
FFCC0008C3
FFCC0009C2
FFCC000AC1
FFCC000BC0
FFCC000CC7
FFCC000DC6
FFCC000EC5
FFCC000FC4
FFCC0010DB
FFCC0011DA
FFCC0012D9
FFCC0013D8
E8D6630021
E8D6630120
E8D6630223
E8D6630322
E8D6630425
E8D6630524
E8D6630627
E8D6630726
E8D6630829
E8D6630928
E8D6630A2B
E8D6630B2A
E8D6630C2D
E8D6630D2C
E8D6630E2F
E8D6630F2E
E8D6631031
E8D6631130
E8D6631233
E8D6631332
FFCC0300CE
FFCC0301CF
FFCC0302CC
FFCC0303CD
FFCC0304CA
FFCC0305CB
FFCC0306C8
FFCC0307C9
FFCC0308C6
FFCC0309C7
FFCC030AC4
FFCC030BC5
FFCC030CC2
FFCC030DC3
FFCC030EC0
FFCC030FC1
FFCC0310DE
FFCC0311DF
FFCC0312DC
FFCC0313DD

1 Answer 1

4

Based on the data provided, it appears to be a very simple check with the 5th byte being the sum of the first 3 bytes exclusive-or'd with the 4th byte.

// input bytes
byte b[4];

// check byte
byte c = ( b[0] + b[1] + b[2] ) ^ b[3];

To add how I worked it out -

Firstly, I observed that change of a single bit in the 4th byte flipped the same bit in the check byte. This is clear exclusive-or behaviour. The results of Xor-ing the 4th bytes with the check bytes did not then depend on the 4th bytes. This proved this was how the 4th bytes were incorporated.

At this point I thought it would be difficult as, once you exclude the 4th byte, you've only provided 3 distinct examples of the first 3 bytes.

However, in your first example it stood out that FF + CC = CB.

I then tried the sum of the first 3 bytes with your 2nd group of examples and, luckily, it worked too. E8+D6+63 = 21

A quick check on the remaining examples showed this worked for them too.

1
  • 1
    Thank you very much, it works with the few tests I've done! How did you get to the formula? I didn't even know where to start, even if it apparently was quite simple, so I'd be really interested.
    – LichtiMC
    Oct 29, 2021 at 19:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.