Help with CRC16-CCITT Reversed checksum and packet

Hello all,

Today I begin a new project, similar to the last project where 2 devices communicate with each other using 'some' packet structure.

Using logic analyzer and changing various serial settings, they are using standard serial settings at a baud rate of 9600.

Edit 7/12/2020: I have confirmed this to be 9600 baud, n81, LSB, non-inverted.

This is a host / slave setup. No need for addresses here.

Here is a packet -

Host sends this over and over when the slave is not connected..

0xF0   ; start of packet
0x5    ;  not sure
0x1    ; data
0x4    ; data
0x1    ; data
0x2    ; data
0x44  ; data?
0x63  ; CHECKSUM!!
0xF3  ; End of packet

However, this seems wrong, because when I send the message above to the slave device, I get this response from the slave -

0xF0     ; Def is the start of packet
0x5
0x1
0x1
0x3
0x31
0x30
0x37
0xED
0xF5      ; CHECKSUM
0xF3      ; Def is the End of packet

More samples from host during a 'boot' process..

0xF0
0x05
0x00
0x02
0x01
0x00
0x34
0x8A       ;CHECKSUM
0xF3

The slave device spins a big disc. Almost like a roulette wheel, and some lights. I expect a data packet to contain things like - motor speed, R, G, B light colors (maybe up to 6 sections of light information), possibly a byte where the host thinks the wheel is? There is a speed-up and de-acceleration process. The host tells the slave where to stop the disc. (go to location x)

Possible very chatty, dont know yet, this is as far as I have gotten before the 'high-voltage' side of the board gets really hot and I cut power.. working on fixing this.

Update 7/12/2020 - board got hot because of pull up resistors being wrong values causing excessive load on the voltage regulator, making it get hot. Change 100ohm resistors to 470ohm and the issue went away. Rise/fall times are fine.

Problem: I am using an Uno with SoftwareSerial to read and try to replay the data out another interface, but it seems SoftwareSerial only let's one port work at a time... The last mySerialx.begin(9600); is the only one that ever works. Will probably move to a Mega but Uno was right there, and only 9600 baud, only reading..

Edit 7/12/2020 - Moved to Arduino Mega..

Thanks! Eddiie

What are you trying to accomplish with the Uno - sniff the packets? The Uno has 1 hardware Serial port and if you use 1 SoftwareSerial, that gives you two ports.

It is unclear what you are using the hardware Serial port for - debugging to your serial monitor or as the other port in some sort of pass-through communication.

A logic analyzer or 'scope will tell you the baud rate for certain - if both 4800 and 9600 look plausible, something's definitely wierd because they have different waveforms.

WOwee it has been some months on this project and just today I discovered what they use for CRC checking thanks to a Checksum Calculator website Google found for me.

I am confident that the baud rate is 9600, n81, LSB, non-inverted (Thanks Saleae !)

The checksum is CRC-16-CCITT, Reversed 0x8408, Little Endian... Unfortunately I have no idea what this means. I google some more and find a lot of things that are over my head, or they seem to be. Polynomial ? What is 0x8408?

This forum post almost gets me there, I think - https://forum.arduino.cc/index.php?topic=463408.0 But I could not get the test code to return the correct result.

For these given strings, this web site returns the correct checksum - https://www.scadacore.com/tools/programming-calculators/online-checksum-calculator/

Starting byte 0xF0 and ending byte 0xF3 removed... (0x and the commas removed when pasting into the calculator)

Test 1:

0x05, 0x82, 0x0, 0x0, 0x3

CRC-16-CCIT Reversed 0x8408 (Little Endian) = 0x00D7 Copy paste into calculator: 0582000003

Test 2:

0x05, 0x83, 0x0, 0x01, 0x01, 0xA6

CRC-16-CCIT Reversed 0x8408 (Little Endian) = 0x0026 Copy paste into calculator: 0583000101a6

Test 3:

0x05, 0x83, 0x0, 0x0, 0xDF

CRC-16-CCIT Reversed 0x8408 (Little Endian) = 0x008D Copy paste into calculator: 05830000DF

Can someone out there make me an Arduino function to reproduce this? I've looked at a couple libraries but as of this moment they are not producing the correct results. I will keep at it.

Appreciate the help! -Ed

This forum post almost gets me there, I think - https://forum.arduino.cc/index.php?topic=463408.0

The code in that forum post uses the x1021 polynomial. You want CCITT code that uses the x8408 polynomial. You may also need to read the bytes in reverse order, and have particular input and output XOR values.

Here is one place to start: https://stackoverflow.com/questions/30496223/c-sharp-crc-16-ccitt-0x8408-polynomial-help-needed

@jremington

Yes! I need the bytes in reverse order. (I was editing posts and replies with more information when you answered)

Reversing bytes is done with ~ ?

This works for the three examples you posted. If you include the correct CRC in the message, the resulting CRC is always zero.

void setup() {
  // put your setup code here, to run once:
Serial.begin(9600);
char x[]={0x05,0x82,0x00,0x00,0x03,0xD7}; //6
char y[]={0x05,0x83,0x00,0x01,0x01,0xA6,0x26}; //7
char z[]={0x05,0x83,0x00,0x00,0xDF,0x8D}; //6

Serial.println(CRC16K(x,6),HEX);
Serial.println(CRC16K(y,7),HEX);
Serial.println(CRC16K(z,6),HEX);
}

uint16_t CRC16K(uint8_t *x, uint8_t len) {
    uint8_t *data = x;
    uint16_t crc=0;

    while (len--) {
        crc ^= *data++;
        for (uint8_t k = 0; k < 8; k++)
            if (crc & 1) crc =(crc >> 1) ^ 0x8408;
            else crc = crc >> 1;
    }

    return crc;
}

“Reflect” means read the bits in reverse order, that is, the choice of shifting right or left.
Note that 0x8408 is just 0x1021 reflected.

Edit: To calculate the CRC for a packet, use the same code but leave out the CRC value:

void setup() {
  // put your setup code here, to run once:
Serial.begin(9600);
char x[]={0x05,0x82,0x00,0x00,0x03,0xD7}; //6
char y[]={0x05,0x83,0x00,0x01,0x01,0xA6,0x26}; //7
char z[]={0x05,0x83,0x00,0x00,0xDF,0x8D}; //6


Serial.println(CRC16K(x,5),HEX);
Serial.println(CRC16K(y,6),HEX);
Serial.println(CRC16K(z,5),HEX);
}

uint16_t CRC16K(uint8_t *x, uint8_t len) {
    uint8_t *data = x;
    uint16_t crc=0;

    while (len--) {
        crc ^= *data++;
        for (uint8_t k = 0; k < 8; k++)
            if (crc & 1) crc =(crc >> 1) ^ 0x8408;
            else crc = crc >> 1;
    }

    return crc;
}

void loop() {
  // put your main code here, to run repeatedly:
}

YES!!!!!

Thank you!!!!

@jremington One more thing, I need to exclude the first element (0) of the string from the checksum calculation. It is the start of packet byte. If I simply lessen the len value by 1, it does not work.

For example, the string - char a[]={0x05,0x82,0x00,0x00,0x03}; //5 0xD7

The test - Serial.println(CRC16K(a,5),HEX);

Returns 0xD7 as it should.

But, if we add the start of packet byte 0xF0 - char a[]={0xF0,0x05,0x82,0x00,0x00,0x03}; //5 0xD7

And leave the length at 5, Serial.println(CRC16K(a,5),HEX);

Returns 48A5 NOT D7

I am sorry I excluded the start of packet byte from my examples.

Can you fix? The first element (0) will always be 0xF0, if that helps?

I've tried a few different ideas but they all basically do the same thing, exit the function when len == 1..

Thank you!

Here are some more tests

char b[]={0xF0,0x05,0x83,0x00,0x01,0x01,0xA6}; //6  0x26
char c[]={0xF0,0x05,0x83,0x00,0x00,0xDF}; //5  0x8D
char d[]={0xF0,0x05,0x84,0x00,0x01,0x01,0x87}; //6  0x71
char e[]={0xF0,0x05,0x84,0x00,0x00,0xDA}; //5  0x01
char f[]={0xF0,0x05,0x85,0x00,0x01,0x01,0x3C}; //6  0x6D
char g[]={0xF0,0x05,0x85,0x00,0x00,0x06}; //5  0x5B
char h[]={0xF0,0x05,0x86,0x00,0x01,0x01,0xF1}; //6  0x48
char i[]={0xF0,0x05,0x86,0x00,0x00,0x62}; //5  0xB4
char j[]={0xF0,0x05,0x87,0x00,0x01,0x01,0x4A}; //6  0x54
char k[]={0xF0,0x05,0x87,0x00,0x00,0xBE}; //5  0xEE
char l[]={0xF0,0x05,0x88,0x00,0x01,0x01,0xB3}; //6  0xE6
char m[]={0xF0,0x05,0x88,0x00,0x00,0x79}; //5  0xA4
char n[]={0xF0,0x05,0x89,0x00,0x01,0x01,0x08}; //6  0xFA
char o[]={0xF0,0x05,0x89,0x00,0x00,0xA5}; //5  0xFE
char p[]={0xF0,0x05,0x8A,0x00,0x01,0x01,0xC5}; //6  0xDF
char q[]={0xF0,0x05,0x8A,0x00,0x00,0xC1}; //5  0x11
char r[]={0xF0,0x05,0x8B,0x00,0x01,0x01,0x7E}; //6  0xC3
char s[]={0xF0,0x05,0x8B,0x05,0x08,0x01,0x09,0x0F,0x00,0x00,0x00,0x00,0x00,0x5F}; //13  0x4E
char t[]={0xF0,0x05,0x8C,0x00,0x01,0x01,0x5F}; //6  0x94
char u[]={0xF0,0x05,0x8C,0x05,0x08,0x01,0x0D,0x00,0x00,0x00,0x00,0x00,0x00,0x46}; //13  0xBC
char v[]={0xF0,0x05,0x8D,0x00,0x01,0x01,0xE4}; //6  0x88
char w[]={0xF0,0x05,0x8D,0x00,0x00,0xC4}; //5  0x9D
char x[]={0xF0,0x05,0x8E,0x00,0x01,0x01,0x29}; //6  0xAD
char y[]={0xF0,0x05,0x8E,0x00,0x00,0xA0}; //5  0x72
char z[]={0xF0,0x05,0x8F,0x00,0x01,0x01,0x92}; //6  0xB1

Serial.println(CRC16K(b,6),HEX);
Serial.println(CRC16K(c,5),HEX);
Serial.println(CRC16K(d,6),HEX);
Serial.println(CRC16K(e,5),HEX);
Serial.println(CRC16K(f,6),HEX);
Serial.println(CRC16K(g,5),HEX);
Serial.println(CRC16K(h,6),HEX);
Serial.println(CRC16K(i,5),HEX);
Serial.println(CRC16K(j,6),HEX);
Serial.println(CRC16K(k,5),HEX);
Serial.println(CRC16K(l,6),HEX);
Serial.println(CRC16K(m,5),HEX);
Serial.println(CRC16K(n,6),HEX);
Serial.println(CRC16K(o,5),HEX);
Serial.println(CRC16K(p,6),HEX);
Serial.println(CRC16K(q,5),HEX);
Serial.println(CRC16K(r,6),HEX);
Serial.println(CRC16K(s,13),HEX);
Serial.println(CRC16K(t,6),HEX);
Serial.println(CRC16K(u,13),HEX);
Serial.println(CRC16K(v,6),HEX);
Serial.println(CRC16K(w,5),HEX);
Serial.println(CRC16K(x,6),HEX);
Serial.println(CRC16K(y,5),HEX);
Serial.println(CRC16K(z,6),HEX);

If the first element of the buffer is always the same, just ignore it. Note the “&x[1]” in the first call.

void setup() {
  // put your setup code here, to run once:
Serial.begin(9600);
char x[]={0xF0,0x05,0x82,0x00,0x00,0x03,0xD7}; //6
char y[]={0xF0,0x05,0x83,0x00,0x01,0x01,0xA6,0x26}; //7
char z[]={0xF0,0x05,0x83,0x00,0x00,0xDF,0x8D}; //6


Serial.println(CRC16K(&x[1],5),HEX);  //starting address = second byte
Serial.println(CRC16K(&y[1],6),HEX);
Serial.println(CRC16K(&z[1],5),HEX);
}
// kermit
uint16_t CRC16K(uint8_t *x, uint8_t len) {
    uint8_t *data = x;
    uint16_t crc=0;

    while (len--) {
        crc ^= *data++;
        for (uint8_t k = 0; k < 8; k++)
            if (crc & 1) crc =(crc >> 1) ^ 0x8408;
            else crc = crc >> 1;
    }

    return crc;
}

void loop() {
  // put your main code here, to run repeatedly:
}

OK there we go!

@jremington

Something is wrong.

As I start to make my own packets, the checksum is returning 4 bytes.

Example -

char a[]={0xF0,0x05,0x00,0x00,0x00,0x08}; Serial.println(CRC16K(&a[1],5),HEX);

Prints: AA1C

I don't actually know what the checksum should be but I do know it should not be AA1C (or 1C), the device is rejecting it. (bad packet)

help?

Testing some more, char a[]={0xF0,0x05,0x0e,0x00,0x00,0x08}; returns 45E

char a[]={0xF0,0x05,0x15,0x00,0x00,0x08}; returns 7EA

Only the original packet returns a correct checksum.. char a[]={0xF0,0x05,0x23,0x00,0x00,0x08}; returns 82

What is going on?

The third byte is what I call a sequence byte. It increments by 1 every time there is an exchange of data. If this byte happens to be 0xF0 or 0xF3, it is 0xB1. After it reaches 0xFF, it rolls over to 0x00, then 0x01, etc..

The CRC checksum is 16 bits. It just happens that for all the examples you [u]posted[/u], the top 8 bits are zero.

It is impossible to say what the device manufacturer does in all possible cases, without seeing more examples of valid checksums. Perhaps the top 8 bits are discarded and only the low order byte is sent, or the two CRC bytes are XORed together and the result sent.

Is there a CRC8-CCITT? Maybe they are only using 8 bits.

The general CRC search program reveng fails to find an 8 bit CRC calculation that explains the valid messages that you posted.

reveng -s -w 16 0582000003D7 0583000101a626 05830000DF8D
width=16  poly=0x1021  init=0x0000  refin=true  refout=true  xorout=0x0000  check=0x2189  name="KERMIT"

reveng -s -w 8 0582000003D7 0583000101a626 05830000DF8D
reveng: no models found

There are two obvious ways to distinguish between (or reject) the options I suggested in reply #13.

(1) Find valid messages that result in a non-zero upper CRC byte, and determine how it was handled.

(2) Send messages to the device trying the two options, and see if it accepts them.

I have hundreds of examples but the analyzer program I use puts one byte per line. I will look into putting all the bytes on one line for easier analysis by that reveng tool. Doing this now.

Here is one capture, "Idle".. Working on more.

F0052300000882F3
F00524000101BAD3F3
F0052400000D0EF3
F0052500010101CFF3
F005250000D154F3
F00526000101CCEAF3
F005260000B5BBF3
F0052700010177F6F3
F00527000069E1F3
F005280001018E44F3
F005280000AEABF3
F005290001013558F3
F00529000072F1F3
F0052A000101F87DF3
F0052A0000161EF3
F0052B0001014361F3
F0052B0000CA44F3
F0052C0001016236F3
F0052C0000CFC8F3
F0052D000101D92AF3
F0052D00001392F3
F0052E000101140FF3
F0052E0000777DF3
F0052F000101AF13F3
F0052F0000AB27F3
F00530000101F762F3
F005300000F9E8F3
F005310001014C7EF3
F00531000025B2F3
F00532000101815BF3
F005320000415DF3
F005330001013A47F3
F0053300009D07F3
F005340001011B5B10F3
F005340000988BF3
F00535000101A00CF3
F00535000044D1F3
F005360001016D29F3
F005360000203EF3
F00537000101D635F3
F005370000FC64F3
F005380001012F87F3
F0053800003B2EF3
F00539000101949BF3
F005390000E774F3
F0053A00010159BEF3
F0053A0000839BF3
F0053B000101E2A2F3
F0053B00005FC1F3
F0053C000101C3F5F3
F0053C00005A4DF3
F0053D00010178E9F3
F0053D00008617F3
F0053E000101B5CCF3
F0053E0000E2F8F3
F0053F0001010ED0F3
F0053F00003EA2F3
F00540000101B238F3
F0054000002168F3
F005410001010924F3
F005410000FD32F3
F00542000101C401F3
F00542000099DDF3
F005430001017F1DF3
F0054300004587F3
F005440001015E4AF3
F005440000400BF3
F00545000101E556F3
F0054500009C51F3
F005460001012873F3
F005460000F8BEF3
F00547000101936FF3
F00547000024E4F3
F005480001016ADDF3
F005480000E3AEF3
F00549000101D1C1F3
F0054900003FF4F3
F0054A0001011CE4F3
F0054A00005B1B5BF3
F0054B000101A7F8F3
F0054B00008741F3
F0054C00010186AFF3
F0054C000082CDF3
F0054D0001013DB3F3
F0054D00005E97F3
F0054E0001011BB096F3
F0054E00003A78F3
F0054F0001014B8AF3
F0054F0000E622F3
F0055000010113FBF3
F005500000B4EDF3
F00551000101A8E7F3
F00551000068B7F3
F0055200010165C2F3
F0055200000C58F3
F00553000101DEDEF3
F005530000D002F3
F00554000101FF89F3
F005540000D58EF3
F005550001014495F3
F00555000009D4F3
F0055600010189B0F3
F0055600006D3BF3
F0055700010132ACF3
F005570000B161F3
F00558000101CB1EF3
F005580000762BF3
F005590001017002F3
F005590000AA71F3
F0055A000101BD27F3
F0055A0000CE9EF3
F0055B000101063BF3
F0055B000012C4F3
F0055C000101276CF3
F0055C00001748F3
F0055D0001019C70F3
F0055D0000CB12F3
F0055E0001015155F3
F0055E0000AFFDF3
F0055F000101EA49F3
F0055F000073A7F3
F00560000101E1B7F3
F0056000001A6BF3
F005610001015AABF3
F005610000C631F3
F00562000101978EF3
F005620000A2DEF3
F005630001012C92F3
F0056300007E84F3
F005640001010DC5F3
F0056400007B08F3
F00565000101B6D9F3
F005650000A752F3
F005660001017BFCF3
F005660000C3BDF3
F00567000101C0E0F3
F0056700001FE7F3
F005680001013952F3
F005680000D8ADF3
F00569000101824EF3
F00569000004F7F3
F0056A0001014F6BF3
F0056A00006018F3
F0056B000101F477F3
F0056B0000BC42F3
F0056C000101D520F3
F0056C0000B9CEF3
F0056D0001016E3CF3
F0056D00006594F3
F0056E000101A319F3
F0056E0000017BF3
F0056F0001011805F3
F0056F0000DD21F3
F005700001014074F3
F0057000008FEEF3
F00571000101FB68F3
F00571000053B4F3
F00572000101364DF3
F005720000375BF3
F005730001018D51F3
F005730000EB01F3
F00574000101AC06F3
F005740000EE8DF3
F00575000101171AF3
F00575000032D7F3
F00576000101DA3FF3
F0057600005638F3
F005770001016123F3
F0057700008A62F3
F005780001019891F3
F0057800004D28F3
F00579000101238DF3
F0057900009172F3
F0057A000101EEA8F3
F0057A0000F59DF3
F0057B00010155B4F3
F0057B000029C7F3
F0057C00010174E3F3
F0057C00002C4BF3
F0057D000101CFFFF3
F0057D00001BB011F3
F0057E00010102DAF3
F0057E000094FEF3
F0057F000101B9C6F3
F0057F000048A4F3
F005800001016B03F3
F005800000BB62F3
F00581000101D01FF3
F0058100006738F3
F005820001011D3AF3
F00582000003D7F3
F00583000101A626F3
F005830000DF8DF3
F005840001018771F3
F005840000DA01F3
F005850001013C6DF3
F005850000065BF3
F00586000101F148F3
F00586000062B4F3
F005870001014A54F3
F005870000BEEEF3
F00588000101B3E6F3
F00588000079A4F3
F0058900010108FAF3
F005890000A5FEF3
F0058A000101C5DFF3
F0058A0000C111F3
F0058B0001017EC3F3
F0058B00001D4BF3
F0058C0001015F94F3
F0058C000018C7F3
F0058D000101E488F3
F0058D0000C49DF3
F0058E00010129ADF3
F0058E0000A072F3
F0058F00010192B1F3
F0058F00007C28F3
F00590000101CAC0F3
F0059000002EE7F3
F0059100010171DCF3
F005910000F2BDF3
F00592000101BCF9F3
F0059200009652F3
F0059300010107E5F3
F0059300004A08F3
F0059400010126B2F3
F0059400004F84F3
F005950001019DAEF3
F00595000093DEF3
F00596000101508BF3
F005960000F731F3
F00597000101EB97F3
F0059700002B6BF3
F005980001011225F3
F005980000EC21F3
F00599000101A939F3
F005990000307BF3
F0059A000101641CF3
F0059A00005494F3
F0059B000101DF00F3
F0059B000088CEF3
F0059C000101FE57F3
F0059C00008D42F3
F0059D000101454BF3
F0059D00005118F3
F0059E000101886EF3
F0059E000035F7F3
F0059F0001013372F3
F0059F0000E9ADF3
F005A0000101388CF3
F005A000008061F3
F005A10001018390F3
F005A100005C3BF3
F005A20001014EB5F3
F005A2000038D4F3
F005A3000101F5A9F3
F005A30000E48EF3
F005A4000101D4FEF3
F005A40000E102F3
F005A50001016FE2F3
F005A500003D58F3
F005A6000101A2C7F3
F005A6000059B7F3
F005A700010119DBF3
F005A7000085EDF3
F005A8000101E069F3
F005A8000042A7F3
F005A90001015B75F3
F005A900009EFDF3
F005AA0001019650F3
F005AA0000FA12F3
F005AB0001012D4CF3
F005AB00002648F3
F005AC0001010C1B5BF3
F005AC000023C4F3
F005AD000101B707F3
F005AD0000FF9EF3
F005AE0001017A22F3
F005AE00009B71F3
F005AF000101C13EF3
F005AF0000472BF3
F005B0000101994FF3
F005B0000015E4F3
F005B10001012253F3
F005B10000C9BEF3
F005B2000101EF76F3
F005B20000AD51F3
F005B3000101546AF3
F005B30000710BF3
F005B4000101753DF3
F005B400007487F3
F005B5000101CE21F3
F005B50000A8DDF3
F005B60001010304F3
F005B60000CC32F3
F005B7000101B818F3
F005B700001068F3
F005B800010141AAF3
F005B80000D722F3
F005B9000101FAB6F3
F005B900000B78F3
F005BA0001013793F3
F005BA00006F97F3
F005BB0001018C8FF3
F005BB0000B3CDF3
F005BC000101ADD8F3
F005BC0000B641F3
F005BD00010116C4F3
F005BD00006A1B5BF3
F005BE000101DBE1F3
F005BE00000EF4F3
F005BF00010160FDF3
F005BF0000D2AEF3
F005C0000101DC15F3
F005C00000CD64F3
F005C10001016709F3
F005C10000113EF3
F005C2000101AA2CF3
F005C2000075D1F3
F005C30001011130F3
F005C30000A98BF3
F005C40001013067F3
F005C40000AC07F3
F005C50001018B7BF3
F005C50000705DF3
F005C6000101465EF3
F005C6000014B2F3
F005C7000101FD42F3
F005C70000C8E8F3
F005C8000101041BB0F3
F005C800000FA2F3
F005C9000101BFECF3
F005C90000D3F8F3
F005CA00010172C9F3
F005CA0000B717F3
F005CB000101C9D5F3
F005CB00006B4DF3
F005CC000101E882F3
F005CC00006EC1F3
F005CD000101539EF3
F005CD0000B29BF3
F005CE0001019EBBF3
F005CE0000D674F3
F005CF00010125A7F3
F005CF00000A2EF3
F005D00001017DD6F3
F005D0000058E1F3
F005D1000101C6CAF3
F005D1000084BBF3
F005D20001010BEFF3
F005D20000E054F3
F005D3000101B01BB3F3
F005D300003C0EF3
F005D400010191A4F3
F005D400003982F3
F005D50001012AB8F3
F005D50000E5D8F3
F005D6000101E79DF3
F005D600008137F3
F005D70001015C81F3
F005D700005D6DF3
F005D8000101A533F3
F005D800009A27F3
F005D90001011E2FF3
F005D90000467DF3
F005DA000101D30AF3
F005DA00002292F3
F005DB0001016816F3
F005DB0000FEC8F3
F005DC0001014941F3
F005DC0000FB44F3
F005DD000101F25DF3
F005DD0000271EF3
F005DE0001013F78F3
F005DE000043F1F3
F005DF0001018464F3

Capture 4 - This one has some different length packets

F0058100006738F3
F005820001011D3AF3
F00582000003D7F3
F00583000101A626F3
F005830000DF8DF3
F005840001018771F3
F005840000DA01F3
F005850001013C6DF3
F00585050801040000000000004414F3
F00586000101F148F3
F00586050801010000FF00000086DFF3
F005870001014A54F3
F00587050801040000FF000000B47AF3
F00588000101B3E6F3
F0058805080101000000FF00007A95F3
F0058900010108FAF3
F00589050801040000FFA00000BE3CF3
F0058A000101C5DFF3
F0058A050801010000000000FFD3F7F3
F0058B0001017EC3F3
F0058B050801040000FF7000009318F3
F0058C0001015F94F3
F0058C05080101000000FF00002FCBF3
F0058D000101E488F3
F0058D050801040000FFA00000EB62F3
F0058E00010129ADF3
F0058E0508010100000000FF003E59F3
F0058F00010192B1F3
F0058F0508010400000000FF000CFCF3
F00590000101CAC0F3
F0059005080101000000FF00009558F3
F0059100010171DCF3
F00591050801040000FFA0000051F1F3
F00592000101BCF9F3
F00592050801010000000000FF3C3AF3
F0059300010107E5F3
F00593050801040000FF7000007CD5F3
F0059400010126B2F3
F00594050801010000FF000000E105F3
F005950001019DAEF3
F00595050801040000FF000000D3A0F3
F00596000101508BF3
F0059605080101000000FF0000E2ADF3
F00597000101EB97F3
F00597050801040000FFA000002604F3
F005980001011225F3
F0059805080101FF0000000000E6DFF3
F00599000101A939F3
F00599050801040000D000FF004680F3
F0059A000101641CF3
F0059A0508010100000000FF002E76F3
F0059B000101DF00F3
F0059B0508010400000000FF001CD3F3
F0059C000101FE57F3
F0059C05080101FF0000000000B381F3
F0059D000101454BF3
F0059D050801040000D000FF0013DEF3
F0059E000101886EF3
F0059E0508010100FF00000000E122F3
F0059F0001013372F3
F0059F05080104000000FF00007AB4F3
F005A0000101388CF3
F005A00508010100000000FF0069F2F3
F005A10001018390F3
F005A10508010400000000FF005B57F3
F005A20001014EB5F3
F005A2050801010000000000FF1BB3A9F3
F005A3000101F5A9F3
F005A3050801040000FF700000B346F3
F005A4000101D4FEF3
F005A40000E102F3
F005A50001016FE2F3
F005A5050801010000000000006D06F3
F005A6000101A2C7F3
F005A60508010100FF00000000840DF3
F005A700010119DBF3
F005A70508010B0200000000004E4CF3
F005A8000101E069F3
F005A805080108000000FF0000C936F3
F005A90001015B75F3
F005A90508010100000000000092E4F3
F005AA0001019650F3
F005AA0508010100FF000000007BEFF3
F005AB0001012D4CF3
F005AB05080101000000000000B04FF3
F005AC0001010C1B5BF3
F005AC0508010100FF000000000C1AF3
F005AD000101B707F3
F005AD0000FF9EF3
F005AE0001017A22F3
F005AE00009B71F3
F005AF000101C13EF3
F005AF0000472BF3
F005B0000101994FF3
F005B0000015E4F3
F005B10001012253F3
F005B10000C9BEF3
F005B2000101EF76F3
F005B20000AD51F3
F005B3000101546AF3
F005B30000710BF3
F005B4000101753DF3
F005B400007487F3
F005B5000101CE21F3
F005B50508010100FF000000007282F3
F005B60001010304F3
F005B60000CC32F3
F005B7000101B818F3
F005B700001068F3
F005B800010141AAF3
F005B80000D722F3
F005B9000101FAB6F3
F005B900000B78F3
F005BA0001013793F3
F005BA00006F97F3
F005BB0001018C8FF3
F005BB0000B3CDF3
F005BC000101ADD8F3
F005BC0000B641F3
F005BD00010116C4F3
F005BD00006A1B5BF3
F005BE000101DBE1F3
F005BE00000EF4F3
F005BF00010160FDF3
F005BF0000D2AEF3
F005C0000101DC15F3
F005C00000CD64F3
F005C10001016709F3
F005C10000113EF3
F005C2000101AA2CF3
F005C2000075D1F3
F005C30001011130F3
F005C30000A98BF3
F005C40001013067F3
F005C40000AC07F3
F005C50001018B7BF3
F005C50508010C000000000000AD07F3
F005C6000101465EF3
F005C605080101FFFFFFFFFFFFB82CF3
F005C7000101FD42F3
F005C70000C8E8F3
F005C8000101041BB0F3
F005C800000FA2F3
F005C9000101BFECF3
F005C90000D3F8F3
F005CA00010172C9F3
F005CA0000B717F3
F005CB000101C9D5F3
F005CB00006B4DF3
F005CC000101E882F3
F005CC00006EC1F3
F005CD000101539EF3
F005CD0000B29BF3
F005CE0001019EBBF3
F005CE0000D674F3
F005CF00010125A7F3
F005CF00000A2EF3
F005D00001017DD6F3
F005D0000058E1F3
F005D1000101C6CAF3

Last one for the night -

F00582000003D7F3
F00583000101A626F3
F005830000DF8DF3
F005840001018771F3
F005840000DA01F3
F005850001013C6DF3
F005850000065BF3
F00586000101F148F3
F00586000062B4F3
F005870001014A54F3
F005870000BEEEF3
F00588000101B3E6F3
F00588000079A4F3
F0058900010108FAF3
F005890000A5FEF3
F0058A000101C5DFF3
F0058A0000C111F3
F0058B0001017EC3F3
F0058B050801090F00000000005F4EF3
F0058C0001015F94F3
F0058C0508010D00000000000046BCF3
F0058D000101E488F3
F0058D0000C49DF3
F0058E00010129ADF3
F0058E0000A072F3
F0058F00010192B1F3
F0058F00007C28F3
F00590000101CAC0F3
F0059000002EE7F3
F0059100010171DCF3
F0059105080104000000000000543BF3
F00592000101BCF9F3
F00592050801010000FF000000961BB0F3
F0059300010107E5F3
F00593050801040000FF000000A455F3
F0059400010126B2F3
F0059405080101000000FF0000C006F3
F005950001019DAEF3
F00595050801040000FFA0000004AFF3
F00596000101508BF3
F005960508010100000000FF00D194F3
F00597000101EB97F3
F005970508010400000000FF00E331F3
F005980001011225F3
F00598050801010000FF0000001EE7F3
F00599000101A939F3
F00599050801040000FF0000002C42F3
F0059A000101641CF3
F0059A0508010100000000FF002E76F3
F0059B000101DF00F3
F0059B0508010400000000FF001CD3F3
F0059C000101FE57F3
F0059C0508010100FF00000000C389F3
F0059D000101454BF3
F0059D05080104000000FF0000581FF3
F0059E000101886EF3
F0059E050801010000FF0000006912F3
F0059F0001013372F3
F0059F050801040000FF0000005BB7F3
F005A0000101388CF3
F005A00508010100FF000000001BB3F8F3
F005A10001018390F3
F005A105080104000000FF0000686EF3
F005A20001014EB5F3
F005A2050801010000000000FF1BB3A9F3
F005A3000101F5A9F3
F005A3050801040000FF700000B346F3
F005A4000101D4FEF3
F005A405080101FF0000000000D6AEF3
F005A50001016FE2F3
F005A5050801040000D000FF0076F1F3
F005A6000101A2C7F3
F005A60508010100000000FF001E07F3
F005A700010119DBF3
F005A70508010400000000FF002CA2F3
F005A8000101E069F3
F005A805080101FF0000000000294CF3
F005A90001015B75F3
F005A9050801040000D000FF008913F3
F005AA0001019650F3
F005AA0508010100FF000000007BEFF3
F005AB0001012D4CF3
F005AB05080104000000FF0000E079F3
F005AC0001010C1B5BF3
F005AC05080101000000FF0000A529F3
F005AD000101B707F3
F005AD050801040000FFA000006180F3
F005AE0001017A22F3
F005AE05080101FF00000000005EB9F3
F005AF000101C13EF3
F005AF050801040000D000FF00FEE6F3
F005B0000101994FF3
F005B00508010100000000FF002C83F3
F005B10001012253F3
F005B10508010400000000FF001E26F3
F005B2000101EF76F3
F005B20000AD51F3
F005B3000101546AF3
F005B3050801010000000000005F82F3
F005B4000101753DF3
F005B40508010100000000FF0079DDF3
F005B5000101CE21F3
F005B50508010B050000000000F88AF3
F005B60001010304F3
F005B60508010800000000FF006237F3
F005B7000101B818F3
F005B7050801010000000000000ADCF3
F005B800010141AAF3
F005B80508010100000000FF00863FF3
F005B9000101FAB6F3
F005B905080101000000000000D795F3
F005BA0001013793F3
F005BA0508010100000000FF00A494F3
F005BB0001018C8FF3
F005BB0000B3CDF3
F005BC000101ADD8F3
F005BC0000B641F3
F005BD00010116C4F3
F005BD00006A1B5BF3
F005BE000101DBE1F3
F005BE00000EF4F3
F005BF00010160FDF3
F005BF0000D2AEF3
F005C0000101DC15F3
F005C00000CD64F3
F005C10001016709F3
F005C10000113EF3
F005C2000101AA2CF3
F005C2000075D1F3
F005C30001011130F3
F005C30508010100000000FF005523F3
F005C40001013067F3
F005C40000AC07F3
F005C50001018B7BF3
F005C50000705DF3
F005C6000101465EF3
F005C6000014B2F3
F005C7000101FD42F3
F005C70000C8E8F3
F005C8000101041BB0F3
F005C800000FA2F3
F005C9000101BFECF3
F005C90000D3F8F3
F005CA00010172C9F3
F005CA0508010100000000FF006ECAF3
F005CB000101C9D5F3
F005CB00006B4DF3
F005CC000101E882F3
F005CC00006EC1F3
F005CD000101539EF3
F005CD0000B29BF3
F005CE0001019EBBF3
F005CE0000D674F3
F005CF00010125A7F3
F005CF00000A2EF3
F005D00001017DD6F3
F005D0000058E1F3
F005D1000101C6CAF3
F005D1000084BBF3
F005D20001010BEFF3
F005D20000E054F3
F005D3000101B01BB3F3
F005D300003C0EF3
F005D400010191A4F3
F005D40508010100000000FF00F6F2F3
F005D50001012AB8F3
F005D50000E5D8F3
F005D6000101E79DF3
F005D600008137F3
F005D70001015C81F3
F005D700005D6DF3
F005D8000101A533F3
F005D800009A27F3
F005D90001011E2FF3
F005D90000467DF3
F005DA000101D30AF3
F005DA00002292F3
F005DB0001016816F3
F005DB0000FEC8F3
F005DC0001014941F3
F005DC0000FB44F3
F005DD000101F25DF3
F005DD0000271EF3
F005DE0001013F78F3
F005DE000043F1F3
F005DF0001018464F3
F005DF00009FABF3
F005E00001018F9AF3
F005E00000F667F3
F005E10001013486F3
F005E100002A3DF3
F005E2000101F9A3F3
F005E200004ED2F3
F005E300010142BFF3
F005E300009288F3
F005E400010163E8F3
F005E400009704F3
F005E5000101D8F4F3
F005E500004B5EF3
F005E600010115D1F3
F005E600002FB1F3
F005E7000101AECDF3
F005E700001BB3EBF3
F005E8000101577FF3
F005E8000034A1F3
F005E9000101EC63F3
F005E90000E8FBF3
F005EA0001012146F3
F005EA00008C14F3
F005EB0001019A5AF3
F005EB0000504EF3
F005EC000101BB0DF3
F005EC000055C2F3
F005ED0001010011F3
F005ED00008998F3
F005EE000101CD34F3
F005EE0000ED77F3
F005EF0001017628F3
F005EF0000312DF3
F0051BB00001012E59F3
F0051BB0000063E2F3
F005F10001019545F3
F005F10508010C00000000000037CAF3
F005F20001015860F3
F005F205080101FFFFFFFFFFFF22E1F3
F0051BB3000101E37CF3
F0051BB30000070DF3
F005F4000101C22BF3
F005F400000281F3
F005F50001017937F3
F005F50000DEDBF3
F005F6000101B412F3
F005F60000BA34F3
F005F70001010F0EF3
F005F70000666EF3
F005F8000101F6BCF3
F005F80000A124F3
F005F90001014DA0F3
F005F900007D7EF3
F005FA000101F005FA00001991F3
F005FB0001013B99F3
F005FB0000C5CBF3
F005FC0001011ACEF3