0

I'm trying to work out the calculation method for a checksum in a CAN message but I'm having some difficulties.

I am unsure if there are actually 4 separate checksums, or one big one at the end of this message.

I have run the message in different ways through reveng, and it doesn't seem to return anything CRC related.

Are there any gurus out there that could point me in the right direction to work out what is being done.

What I have worked out is that the first nibble in byte 4 is a counter, and in the examples below, I have managed to keep the count the same.

0x116  8  00 00 00 00 CF 6E 7A 13 
0x116  8  01 01 00 00 CF 79 DA 12 
0x116  8  02 02 00 00 C6 7A 99 BB 
0x116  8  03 03 00 00 C5 F8 8B 8C 
0x116  8  04 04 00 00 C6 FB D0 62 
0x116  8  05 05 00 00 C9 45 B3 0C 
0x116  8  06 06 00 00 CD 6E 2A 25 
0x116  8  07 07 00 00 C3 C7 F1 09 
0x116  8  08 08 00 00 CB 5F D7 BA 
0x116  8  09 09 00 00 C5 29 B0 69 
0x116  8  0A 0A 00 00 C6 6C AE F7 
0x116  8  0B 0B 00 00 CC FA 16 76 
0x116  8  0C 0C 00 00 C7 9B AB 62 
0x116  8  0D 0D 00 00 C1 4C C4 9A 
0x116  8  0E 0E 00 00 C3 A0 2A BF 
0x116  8  0F 0F 00 00 C5 46 AE F2 
0x116  8  10 10 00 00 C4 CF 23 B7 
0x116  8  11 11 00 00 CE 78 52 3C 
0x116  8  12 12 00 00 CD 5D D4 75 
0x116  8  13 13 00 00 C1 5B E3 E3 
0x116  8  14 14 00 00 CE F9 4C 2A 
0x116  8  15 15 00 00 CD 1B 89 2F 
0x116  8  16 16 00 00 C0 9D 3F 9C 
0x116  8  17 17 00 00 C8 A9 18 99 

Edit: I seem to think there is another message that is affecting the results of the checksums within the 116 message. I have attached a longer log with the other message included. I can see that one of the counters in byte 4 increments each time there is a new message from the 0xf message.

20:04:48:5054 Tx 1 0x00F s 8 02 36 00 A4 54 5B B1 3F 
20:04:48:6024 Rx 1 0x116 s 8 00 00 00 00 5C F3 FC 67 
20:04:48:6059 Tx 1 0x00F s 8 02 36 00 A4 54 5B B1 3F 
20:04:48:6260 Rx 1 0x116 s 8 00 00 00 00 97 51 BF D4 
20:04:48:6495 Rx 1 0x116 s 8 00 00 00 00 D2 73 9B 87 
20:04:48:6731 Rx 1 0x116 s 8 00 00 00 00 15 6A E4 82 
20:04:48:6967 Rx 1 0x116 s 8 00 00 00 00 55 37 86 56 
20:04:48:7063 Tx 1 0x00F s 8 02 36 00 A4 6D 2F FA 4B 
20:04:48:7203 Rx 1 0x116 s 8 00 00 00 00 68 27 BB B9 
20:04:48:7438 Rx 1 0x116 s 8 00 00 00 00 A4 F7 95 52 
20:04:48:7674 Rx 1 0x116 s 8 00 00 00 00 E2 79 96 5A 
20:04:48:7909 Rx 1 0x116 s 8 00 00 00 00 21 7A 35 4D 
20:04:48:8071 Tx 1 0x00F s 8 02 36 00 A4 6D 2F FA 4B 
20:04:48:8145 Rx 1 0x116 s 8 00 00 00 00 61 16 BF E0 
20:04:48:8381 Rx 1 0x116 s 8 00 00 00 00 A7 89 40 E4 
20:04:48:8616 Rx 1 0x116 s 8 00 00 00 00 E4 1D 2C 84 
20:04:48:8851 Rx 1 0x116 s 8 00 00 00 00 2F 56 4A 14 
20:04:48:9076 Tx 1 0x00F s 8 02 36 00 A4 6D 2F FA 4B 
20:04:48:9087 Rx 1 0x116 s 8 00 00 00 00 68 5B A4 A3 
20:04:48:9322 Rx 1 0x116 s 8 00 00 00 00 A2 1C 8E 83 
20:04:48:9558 Rx 1 0x116 s 8 00 00 00 00 E3 8A 9C 1D 
20:04:48:9793 Rx 1 0x116 s 8 00 00 00 00 2D 31 1A 56 
20:04:49:0029 Rx 1 0x116 s 8 00 00 00 00 63 EB C8 0B 
20:04:49:0081 Tx 1 0x00F s 8 02 36 00 A4 7F 1F E1 99 
20:04:49:0265 Rx 1 0x116 s 8 00 00 00 00 79 EE EC 3A 
20:04:49:0500 Rx 1 0x116 s 8 00 00 00 00 B3 57 40 F7 
20:04:49:0736 Rx 1 0x116 s 8 00 00 00 00 F6 43 AD 49 
20:04:49:0971 Rx 1 0x116 s 8 00 00 00 00 3B 57 E0 E3 
20:04:49:1086 Tx 1 0x00F s 8 02 36 00 A4 7F 1F E1 99 
20:04:49:1207 Rx 1 0x116 s 8 00 00 00 00 78 39 71 F6 
20:04:49:1442 Rx 1 0x116 s 8 00 00 00 00 B0 5C 1D C6 
20:04:49:1678 Rx 1 0x116 s 8 00 00 00 00 F1 2B EE 68 
20:04:49:1913 Rx 1 0x116 s 8 00 00 00 00 3D A6 5D 5A 
20:04:49:2088 Tx 1 0x00F s 8 02 36 00 A4 7F 1F E1 99 
20:04:49:2149 Rx 1 0x116 s 8 00 00 00 00 72 83 1A D3 
20:04:49:2385 Rx 1 0x116 s 8 00 00 00 00 BF E8 45 18 
20:04:49:2620 Rx 1 0x116 s 8 00 00 00 00 F9 21 09 C2 
20:04:49:2856 Rx 1 0x116 s 8 00 00 00 00 33 50 A4 63 
20:04:49:3091 Rx 1 0x116 s 8 00 00 00 00 73 32 6C 05 
20:04:49:3095 Tx 1 0x00F s 8 02 36 00 A4 87 6B 47 DE 
20:04:49:3326 Rx 1 0x116 s 8 00 00 00 00 4A 66 73 20 
20:04:49:3562 Rx 1 0x116 s 8 00 00 00 00 8A AF 81 9D 
20:04:49:3798 Rx 1 0x116 s 8 00 00 00 00 C4 76 E7 16 
20:04:49:4033 Rx 1 0x116 s 8 00 00 00 00 05 8A 34 CC 
20:04:49:4094 Tx 1 0x00F s 8 02 36 00 A4 87 6B 47 DE 
20:04:49:4269 Rx 1 0x116 s 8 00 00 00 00 45 20 72 2F 
20:04:49:4504 Rx 1 0x116 s 8 00 00 00 00 8C F5 1B 07 
20:04:49:4740 Rx 1 0x116 s 8 00 00 00 00 C1 DF 4F A0 
20:04:49:4975 Rx 1 0x116 s 8 00 00 00 00 01 E2 E4 39 
20:04:49:5095 Tx 1 0x00F s 8 02 36 00 A4 87 6B 47 DE 
20:04:49:5211 Rx 1 0x116 s 8 00 00 00 00 4B 4C F5 F7 
20:04:49:5446 Rx 1 0x116 s 8 00 00 00 00 8D 5C E3 82 
20:04:49:5682 Rx 1 0x116 s 8 00 00 00 00 C6 9C FD 5F 
20:04:49:5917 Rx 1 0x116 s 8 00 00 00 00 01 87 CE 35 
20:04:49:6098 Tx 1 0x00F s 8 02 36 00 A4 9A E8 11 66 
20:04:49:6153 Rx 1 0x116 s 8 00 00 00 00 5B 1E 9E 35 
20:04:49:6388 Rx 1 0x116 s 8 00 00 00 00 90 C6 BC 25 
20:04:49:6624 Rx 1 0x116 s 8 00 00 00 00 D8 78 AF 67 
20:04:49:6859 Rx 1 0x116 s 8 00 00 00 00 10 50 18 B0 
20:04:49:7095 Rx 1 0x116 s 8 00 00 00 00 5D E7 20 D3 
20:04:49:7107 Tx 1 0x00F s 8 02 36 00 A4 9A E8 11 66 
20:04:49:7331 Rx 1 0x116 s 8 00 00 00 00 92 50 D4 B4 
20:04:49:7567 Rx 1 0x116 s 8 00 00 00 00 DB 78 F3 DB 
20:04:49:7802 Rx 1 0x116 s 8 00 00 00 00 14 AE E4 C2 
20:04:49:8038 Rx 1 0x116 s 8 00 00 00 00 5F 43 6F 8C 
20:04:49:8115 Tx 1 0x00F s 8 02 36 00 A4 9A E8 11 66 
20:04:49:8273 Rx 1 0x116 s 8 00 00 00 00 9E 76 6A E0 
20:04:49:8509 Rx 1 0x116 s 8 00 00 00 00 D5 D2 55 86 
20:04:49:8744 Rx 1 0x116 s 8 00 00 00 00 11 A2 5B DA 
20:04:49:8980 Rx 1 0x116 s 8 00 00 00 00 5F 09 79 95 
20:04:49:9120 Tx 1 0x00F s 8 02 36 00 A4 AF AF 66 FC 
20:04:49:9215 Rx 1 0x116 s 8 00 00 00 00 66 20 30 3C 
20:04:49:9451 Rx 1 0x116 s 8 00 00 00 00 A1 CE 38 C3 
20:04:49:9686 Rx 1 0x116 s 8 00 00 00 00 ED 0A D9 D2 
20:04:49:9922 Rx 1 0x116 s 8 00 00 00 00 28 F5 53 FB 
20:04:50:0124 Tx 1 0x00F s 8 02 36 00 A4 AF AF 66 FC 
20:04:50:0157 Rx 1 0x116 s 8 00 00 00 00 64 B9 97 A3 
20:04:50:0393 Rx 1 0x116 s 8 00 00 00 00 A3 CF EF 7D 
20:04:50:0628 Rx 1 0x116 s 8 00 00 00 00 E4 84 B8 BB 
20:04:50:0864 Rx 1 0x116 s 8 00 00 00 00 24 3C E5 37 
20:04:50:1099 Rx 1 0x116 s 8 00 00 00 00 61 FD AB 6C 
20:04:50:1129 Tx 1 0x00F s 8 02 36 00 A4 AF AF 66 FC 
20:04:50:1335 Rx 1 0x116 s 8 00 00 00 00 A0 51 EB D1 
20:04:50:1570 Rx 1 0x116 s 8 00 00 00 00 E2 0C 85 C2 
20:04:50:1806 Rx 1 0x116 s 8 00 00 00 00 2F E1 F4 60 
20:04:50:2042 Rx 1 0x116 s 8 00 00 00 00 68 4E C5 9A 
20:04:50:2135 Tx 1 0x00F s 8 02 36 00 A4 BE C2 8A 81 
20:04:50:2277 Rx 1 0x116 s 8 00 00 00 00 7F 8A EA 78 
20:04:50:2512 Rx 1 0x116 s 8 00 00 00 00 B0 8F 24 D2 
20:04:50:2748 Rx 1 0x116 s 8 00 00 00 00 FD 12 11 A2 
20:04:50:2984 Rx 1 0x116 s 8 00 00 00 00 3A CA C6 DD 
20:04:50:3141 Tx 1 0x00F s 8 02 36 00 A4 BE C2 8A 81 
20:04:50:3219 Rx 1 0x116 s 8 00 00 00 00 79 E9 56 55 
20:04:50:3455 Rx 1 0x116 s 8 00 00 00 00 BC 3D 5C 00 
20:04:50:3691 Rx 1 0x116 s 8 00 00 00 00 F0 3D 49 AD 
20:04:50:3926 Rx 1 0x116 s 8 00 00 00 00 34 5F 55 2F 
20:04:50:4145 Tx 1 0x00F s 8 02 36 00 A4 BE C2 8A 81 
20:04:50:4161 Rx 1 0x116 s 8 00 00 00 00 74 81 D6 17 
20:04:50:4397 Rx 1 0x116 s 8 00 00 00 00 B3 7D FC 56 
20:04:50:4632 Rx 1 0x116 s 8 00 00 00 00 F2 2C 94 19 
20:04:50:4868 Rx 1 0x116 s 8 00 00 00 00 3D 47 34 A7 
2
  • Post more data please (100 messages). Ideally messages of different values and lengths. – pythonpython Feb 20 at 1:49
  • I have edited the original post to include some more messages, along with another message that i believe is influencing the checksum. – RNtech Feb 22 at 9:49
0

Assuming this is CAN, then there is already a CRC as part of the CAN Spec.

Here is a writeup on the CAN CRC. There's some python implementations which build CAN CRCs you could try adapting.

2
  • I get the feeling you may not have read the whole original post. Yes, its CAN and I do not believe its CRC. Also, note the length of the potential checksum. – RNtech Feb 23 at 8:16
  • Oh I read it. 1) It would be strange to use 4 bytes for a checksum of messages 8 bytes long. Monumentally inefficient. Even messages of 255 bytes, using 4 bytes for a checksum/crc would be overkill. 2) You've already identified that the first nibble is a counter, not sure I agree, since you don't show any data in sequence with that changing. But lets say that's try, that indicates sub-byte fields, which would again indicate that space is precious, and a 4 byte (or 4 checksums) would be a waste. Are you cutting stuff off from the start of the end of the messages? – pythonpython Feb 23 at 22:36

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.