nuriC0 / gm-lin-bus

Using Arduino to interact with 2021 Corvette C8 LIN BUS
GNU General Public License v3.0
2 stars 2 forks source link

Help with identifying messages #1

Open gbkwiatt opened 1 year ago

gbkwiatt commented 1 year ago

I am trying to figure out LIN in my FORD - I think baud should be 10417, I've finally started getting sync byte 0x55, however it's not followed by 0x00 break and identifier doesn't make sense either. my goal is to send messages but I don't think I am even reading them properly. here are my messages, I've assumed that 0x55 is a sync byte

Repeated:
0x55 0x80 0x10 0x49 0x0F 0x17
0x55 0x80 0x10 0x49 0x00 0x26
0x55 0x80 0x10 0x41 0x0F 0x1F
0x55 0x80 0x10 0x41 0x00 0x2E
0x55 0x80 0x10 0x45 0x0F 0x1B
0x55 0x80 0x10 0x45 0x00 0x2A
0x55 0x80 0x10 0x49 0x0F 0x17
0x55 0x80 0x10 0x49 0x00 0x26
0x55 0x80 0x10 0x4D 0x0F 0x13
0x55 0x80 0x10 0x4D 0x00 0x22
0x55 0x80 0x10 0x51 0x0F 0x0F
0x55 0x80 0x10 0x51 0x00 0x1E

Other:
0x55 0x80 0x10 0x49 0x49 0x0F 0x17
0x55 0x80 0x00 0x49 0x00 0x36
0x55 0x80 0x00 0x41 0x00 0x3E
0x55 0x80 0x00 0x41 0x0F 0x2F
0x55 0x80 0x00 0x45 0x00 0x3A
0x55 0x80 0x00 0x45 0x0F 0x2B
0x55 0x80 0x00 0x49 0x0F 0x27
0x55 0x80 0x00 0x4D 0x00 0x32
0x55 0x80 0x00 0x4D 0x0F 0x23
0x55 0x80 0x00 0x51 0x00 0x2E
0x55 0x80 0x00 0x51 0x0F 0x1F

0x55 0x0F 0x0B
0x55 0x80 0x10

assuming 0x55 is a sync byte an I am missing break 0x00, id is 0x80 which also is out of scale potentially.

I a running out of ideas how to figure out that LIN. Any hints will be really appreciated

nuriC0 commented 1 year ago

So your protected ID is x80.. lets verify if your message is correct example: 0x55 0x80 0x10 0x49 0x00 0x26

x26 is a checksum

so x10+x49+00 = x59 x59 + x80 = d9

d9 in DEC is = 217 255-217 = 38 (if you had a value of 984 for example and not 217.. you would 984 - (Floor(984/255) * 255)) we are trying to get value under 255)

38 in HEX = x26 (there is a better way of doing this calc but its easier to explain this way)

So your messages are correct.. not sure why you dont see 00 before 55.. not sure if its device you are using or what

gbkwiatt commented 1 year ago

Interesting, I was trying to calculate checksum but I guess I missed something out. so that also means it's LIN V2? because it's enhanced checksum ?

Also protected ID is x80, but didn't that supposed to be something lower than x3F ?

actually now I "clicked" - PID is not ID and ID supposed to be up to 0x3F, which with decoding 0x80 with parity bits, it should be that, ID is 0x20 hex or dec 32, which makes sense.

and btw, I am using MCP2021 as a LIN transceiver, so maybe somehow it knows to remove break byte, but it's a bit weird

nuriC0 commented 1 year ago

What year is your Ford ? Most of stuff after 2003 is V2..

On Sat, Jan 21, 2023, 9:08 AM Tomasz Kwiatkowski @.***> wrote:

Interesting, I was trying to calculate checksum but I guess I missed something out. so that also means it's LIN V2? because it's enhanced checksum ?

— Reply to this email directly, view it on GitHub https://github.com/nuriC0/gm-lin-bus/issues/1#issuecomment-1399258292, or unsubscribe https://github.com/notifications/unsubscribe-auth/A5FUJ2TWHL4BIXFDFC5QEYLWTPUUBANCNFSM6AAAAAAUCMQG7I . You are receiving this because you commented.Message ID: @.***>

gbkwiatt commented 1 year ago

Mondeo 2016 so yeah V2

gbkwiatt commented 1 year ago

massive thanks again - I've finally managed to properly capture and send LIN frames and it all works. I owe you a beer

nuriC0 commented 1 year ago

any time.. glad i was able to help