[chirp_devel] Request Help with Checksum
I am working on support for the Retevis RT23. I've captured a serial download. I've even successfully downloaded a "factory" image from the radio. But after looking at the data blocks, it appears that there is a checksum at the end of each block of data.
In this block the checksum is 0xf0
[11/03/2017 16:23:00] Read data (COM2) 57 0e 10 10 ff ff ff ff ff ff ff ff ff ff ff ff W...ÿÿÿÿÿÿÿÿÿÿÿÿ ff ff ff ff f0 ÿÿÿÿð
In this block the checksum is 0x83
[11/03/2017 16:23:00] Read data (COM2) 57 0e 40 10 89 08 ff ff ff ff ff ff ff ff ff ff W.@.‰.ÿÿÿÿÿÿÿÿÿÿ ff ff ff ff 83 ÿÿÿÿƒ
In this block the checksum is 0xf5
[11/03/2017 16:23:00] Read data (COM2) 57 0e 50 10 00 00 55 16 00 00 35 46 ff ff ff ff W.P...U...5Fÿÿÿÿ 00 00 14 ff f5 ...ÿõ
And this block the checksum is 0x00
[11/03/2017 16:23:00] Read data (COM2) 57 0d 90 10 00 00 00 00 00 00 00 00 00 00 00 00 W. ............. 00 00 00 00 00 .....
To be honest, I don't have a clue how to figure out a formula to calculate this checksum. Any help with this would be greatly appreciated.
I have attached the complete serial port capture. Thanks in advance.
Jim KC9HI
On 14/03/17 14:01, Jim Unroe via chirp_devel wrote:
I am working on support for the Retevis RT23. I've captured a serial download. I've even successfully downloaded a "factory" image from the radio. But after looking at the data blocks, it appears that there is a checksum at the end of each block of data.
Can't help right now but here are a couple of links that might put you on the right foot:
https://sourceforge.net/projects/reveng/?source=navbar http://sitsec.net/blog/2012/02/10/brute-forcing-crc-parameters/
Ignoring the first 4 bytes of the reply, it's an additive 8-bit checksum. Sum the bytes and mask the bottom 8 bits.
using the second block as an example:
data = [137, 8, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255] checksum = sum(data) & 0xff
-- Brian
On Mon, Mar 13, 2017 at 6:06 PM, Aaron Pelly via chirp_devel chirp_devel@intrepid.danplanet.com wrote:
On 14/03/17 14:01, Jim Unroe via chirp_devel wrote:
I am working on support for the Retevis RT23. I've captured a serial download. I've even successfully downloaded a "factory" image from the radio. But after looking at the data blocks, it appears that there is a checksum at the end of each block of data.
Can't help right now but here are a couple of links that might put you on the right foot:
https://sourceforge.net/projects/reveng/?source=navbar http://sitsec.net/blog/2012/02/10/brute-forcing-crc-parameters/
chirp_devel mailing list chirp_devel@intrepid.danplanet.com http://intrepid.danplanet.com/mailman/listinfo/chirp_devel Developer docs: http://chirp.danplanet.com/projects/chirp/wiki/Developers
participants (3)
-
Aaron Pelly
-
Brian Dickman
-
Jim Unroe