CRC computation OK for small payloads but not for large ones

60 Views Asked by At

I am trying to validate the CRC associated with the messages from my heater and received through an RTL-SDR dongle. The messages are issued by a Semtech SX1211 transmitter in the Variable Length Packet Format mode. The datasheet says that CRC encoding is performed using a CRC16 algo and a 0x1021 polynom. The payload on which the CRC computation is done is: size of payload on 1 byte followed by the payload. The payloads issued by my heater can be 10, 15, 17, 23, 49 or 63 bytes long.

For size of payload equals to 10, 15 and 17 I was able to find an initial CRC value - thanks to CRC reveng - which is returning the appropriate CRC value for each received payload of a given size. e.g. for "0f2080835c8117082303291809492003" I get an initial value of 0xb71e which can be successfully applied to all the 15 bytes long messages. I have got 3 initial CRC values which are different for each size.

./reveng -w16 -p 0x1021 -i 0xb71e -c 0f2080835c8117082303291809492003
29f1 

But I am not able to find a solution for 23, 49 and 63 bytes long records. The brute force program I wrote to find the initial value for 10, 15 & 17 long records give different values for longer records of a given size. Any ideas too solve this problem would be appreciated. Follows a sample of 23 bytes long records with the CRC I am supposed to obtain given at the end of each records (after the space):

178008be0c0117a0290015a02f00040800c300c300250000 da05
178008be140017a0290005a02f00000800c4004100010000 136d
178008be1800074052002b405e00081000860186000a0000 c2b8
178008be1c0117a0290015a02f000408004300c300010000 3790
178008be200117a0290015a02f00040800c300c300050000 e110
178008be240117a0290015a02f00040800c300c300050000 37dc

Thanks for your help !

0

There are 0 best solutions below