Generating CRC wrong

I can not get the correct CRC for this “(PI30” it should be 9A 0B but the nextion gives 34 90 crcputh 28 50 49 33 30

The Nextion uses the CRC16/Modbus algorithm (init 0xFFFF, poly 0x8005). Thus 0x3490 is the correct result. Your expected result (0x9A0B) is from the CRC16/XMODEM (init 0x0000, poly 0x1021) algorithm. The latter is not supported by Nextion/TJC. While you may change the init value with the crcrest command, you can’t modify the used poly parameter.

1 Like

Thank you for your reply it tells me that the device I am talking to says it is using modbus I used a supplied command in hex to test and it now is obviously not modbus. Now I have to work out how to do CRC16/XMODEM on the nextion.