can't find the right CRC

OP #5702291
Rate this post
• ▲ useful
▼ not useful
Hi,
I'm receiving some data from a serial port and I'm trying to understand 
the last byte witch kind of control it is but up to now I didn't find 
the answers.

These is the data stream of 8 messages:
Every message start with 0x02 (STX) and at the end there is the CRC(?) 
Byte
if inside the message there is a 0x02 a 0x00 is inserted (escape). This 
0x00 byte I have already eliminated

0x02 0x1D 0x11 0x6A 0x58 0x00 0x00 0x01 0x00 0x00 0x10 0x00 0x00 0x00 
0x00 0x00 0x00 0x80 0xFA 0x02 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 
0x67


0x02 0x26 0x13 0x79 0x4F 0x00 0x00 0x00 0x02 0x02 0x54 0x00 0x00 0x00 
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x61


0x02 0x1D 0x11 0x6B 0x58 0x00 0x00 0x01 0x00 0x00 0x10 0x00 0x00 0x00 
0x00 0x00 0x00 0x80 0xFA 0x02 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 
0x68


0x02 0x26 0x14 0x7A 0x4F 0x00 0x00 0x00 0x02 0x00 0x44 0x00 0x00 0x00 
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x17


0x02 0x1D 0x11 0x6C 0x58 0x00 0x00 0x01 0x00 0x00 0x10 0x00 0x00 0x00 
0x00 0x00 0x00 0x80 0xFA 0x02 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 
0x69


0x02 0x26 0x17 0x7A 0x4F 0x01 0x00 0x00 0x64 0x00 0xE1 0x00 0x00 0x00 
0x00 0x00 0x0D 0x01 0x01 0x00 0xFA 0x00 0xFA 0x01 0x90 0x01 0xB8 0x5A 
0x0F 0x00 0x64 0x27 0x10 0x00 0x0A 0x07 0xD0 0xB4


0x02 0x1D 0x11 0x6D 0x58 0x00 0x00 0x01 0x00 0x00 0x10 0x00 0x00 0x00 
0x00 0x00 0x00 0x80 0xFA 0x02 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 
0x6A


0x02 0x26 0x13 0x7A 0x4F 0x00 0x00 0x00 0x02 0x02 0x54 0x00 0x00 0x00 
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x63

Anyone has some idea?

Regards

Gianni
Guest #5702329
Rate this post
• ▲ useful
▼ not useful
Gianni B. wrote:

> 0x02 0x1D 0x11 0x6A 0x58 0x00 0x00 0x01 0x00 0x00 0x10 0x00 0x00 0x00
> 0x00 0x00 0x00 0x80 0xFA 0x02 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
> 0x67
>
> 0x02 0x1D 0x11 0x6B 0x58 0x00 0x00 0x01 0x00 0x00 0x10 0x00 0x00 0x00
> 0x00 0x00 0x00 0x80 0xFA 0x02 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
> 0x68
>
> 0x02 0x1D 0x11 0x6C 0x58 0x00 0x00 0x01 0x00 0x00 0x10 0x00 0x00 0x00
> 0x00 0x00 0x00 0x80 0xFA 0x02 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
> 0x69
>
> 0x02 0x1D 0x11 0x6D 0x58 0x00 0x00 0x01 0x00 0x00 0x10 0x00 0x00 0x00
> 0x00 0x00 0x00 0x80 0xFA 0x02 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
> 0x6A

If you look at the above messages, only the 4th byte is incremented by 
one, and the last byte counts up as well. Therefore it is less likely 
that the last byte is a CRC. To me it looks like a sum, but I can't yet 
tell you how it's calculated.

Reply

Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one.

Formatting
  • [c]C-Code[/c]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]
  • [[Title]] – link to an article
  • Link to another post: right-click its post ID (#8078628), copy the address, paste it into the text

More about formatting

Post long source code as an attachment, not in the text.

Already registered? Log in

Not shown to anyone. We send you a link; your post appears once you confirm it there.

By submitting you create a free account and accept the terms of use.