Unofficial Nextion/TJC User Forum

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.

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.

This forum is in no way affiliated with NEXTION®, ITEAD STUDIO®, TJC®, or anyone else really. All product names, logos, and brands are property of their respective owners. All company, product, and service names used in this website are for identification purposes only. Use of these names, logos, and brands does not imply endorsement from the respective rights holder(s).