[W-MBUS] “I activate the reception of the entire frame (start, header, rssi, crc & stop) using DATA_INTERFACE = 12. I wonder how to calculate this CRC? Is it a arithmetical sum of the following data : C field, Header, Ci field & payload as it is specified in M-bus documentation? “

“The UART CRC when enabled in DATA_INTERFACE is calculated from and including the original length byte (excl the two CRC bytes), to and including the RSSI append byte (if enabled). Start/stop bytes (if enabled) are not included in the CRC calcalcution. The Wirless M-Bus type of CRC is use (init value 0x0000, polynom 0x3D65, result inverted). LSByte is sent first.

The algorithm to check the CRC would be:
-Remove the start/stop byte
-Remove the two CRC bytes and reduce the length byte by 2 (maybe this was the problem?)
-Then calculate the CRC over the remaining frame (including any RSSI), starting with the length byte Invert the result
-Compare with the received CRC.

    Last Update: November 9, 2017  

    November 9, 2017   1527    Wireless M-Bus Q&A