LIN bus

It's all about the code!
Post Reply
User avatar
AndreyB
Site Admin
Posts: 14292
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

LIN bus

Post by AndreyB »

We already read one important bit via K-line, let's see what would end up being first rusEFI LIN use-case :)
Very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions

Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
User avatar
AndreyB
Site Admin
Posts: 14292
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: LIN bus

Post by AndreyB »

2019 Q7 battery monitoring maybe? LIN is shared with generator and goes to gateway
image.png
image.png (43.66 KiB) Viewed 20490 times
image.png
image.png (17.65 KiB) Viewed 20490 times
Very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions

Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
puff
contributor
contributor
Posts: 2961
Joined: Mon Nov 11, 2013 11:28 am
Location: Moskau

Re: LIN bus

Post by puff »

looks like a smart shunt? do you have the part number? know anything about its datagrams?
mck1117
running engine in first post
running engine in first post
Posts: 1493
Joined: Mon Jan 30, 2017 2:05 am
Location: Seattle-ish

Re: LIN bus

Post by mck1117 »

It's either a shunt or a hall effect sensor.

Aside: Lots of hall effect ones available that you just tape around the battery cable and have regular ground/power/voltage output. Ford makes a few that are on a bazillion different vehicles.
puff
contributor
contributor
Posts: 2961
Joined: Mon Nov 11, 2013 11:28 am
Location: Moskau

Re: LIN bus

Post by puff »

afaik, hall-based current sensors work best at some certain current range: if it is good for small currents, it won't work for large currents (btw, not sure, will it provide wrong readings or just fail). those intended for large currents (e.g. of a starter motor) won't read small values (sensitivity issues?)

but once again, what information do such devices provide and who is the final 'consumer' of such information?
User avatar
Dron_Gus
contributor
contributor
Posts: 450
Joined: Wed Nov 13, 2013 1:11 pm
Location: S-Pb
Github Username: dron0gus

Re: LIN bus

Post by Dron_Gus »

Sorry, following link is Russian https://www.drive2.ru/l/591231042828962546/
puff
contributor
contributor
Posts: 2961
Joined: Mon Nov 11, 2013 11:28 am
Location: Moskau

Re: LIN bus

Post by puff »

I am curious how much current does it consume when in sleep mode? ;-)
Still, no protocol details :-( I wonder, what chip is inside. Is it possible to disassebme the firmware? or decyphering protocol is the way to go?

sort of offtopic: there are also chinese BLE battery trackers, which provide detailed info (Vbatt) over the 30-day period - nice devices for ~$30.
User avatar
Dron_Gus
contributor
contributor
Posts: 450
Joined: Wed Nov 13, 2013 1:11 pm
Location: S-Pb
Github Username: dron0gus

Re: LIN bus

Post by Dron_Gus »

Some battery monitor from "BMW 2 F22 2013":

Code: Select all

RX: ID 0x09, PID 0x49 (TX PID was 0x49), data len 8: 0f 27 57 2c 5e 00 00 b0 CRC 37
RX: ID 0x0a, PID 0xca (TX PID was 0xca), data len 8: 00 00 00 00 00 ff ff ff CRC 00
RX: ID 0x0b, PID 0x8b (TX PID was 0x8b), data len 8: 00 00 00 00 7c ff ff ff CRC 83
RX: ID 0x0f, PID 0xcf (TX PID was 0xcf), data len 8: ff ff ff ff ff ff ff ff CRC 00
RX: ID 0x10, PID 0x50 (TX PID was 0x50), data len 8: 00 ff 00 00 00 00 00 00 CRC 00
RX: ID 0x11, PID 0x11 (TX PID was 0x11), data len 8: 00 00 00 00 00 00 00 00 CRC ff
Only few bytes in first message changes... Seems it need some additional initialization?
User avatar
Dron_Gus
contributor
contributor
Posts: 450
Joined: Wed Nov 13, 2013 1:11 pm
Location: S-Pb
Github Username: dron0gus

Re: LIN bus

Post by Dron_Gus »

Battery monitor from Audi A5/S5 2008+
Baudrate seems to be around 19200. New (LIN2.0) CRC type.

Code: Select all

---LIN wake---
RX: ID 0x2d, PID 0xad (TX PID was 0xad), data len 8: 60 30 00 80 00 ff fe ff CRC 42
RX: ID 0x2e, PID 0x2e (TX PID was 0x2e), data len 8: 00 00 00 00 80 00 08 fc CRC 4c
RX: ID 0x2f, PID 0x6f (TX PID was 0x6f), data len 8: 2f 29 e6 7f 3e 1a d0 00 CRC a8
RX: ID 0x30, PID 0xf0 (TX PID was 0xf0), data len 8: 17 ff 3e 3c 1e c0 b1 0b CRC e1
RX: ID 0x34, PID 0xb4 (TX PID was 0xb4), data len 8: af 2e 03 f1 a8 03 66 0c CRC 5a
User avatar
AndreyB
Site Admin
Posts: 14292
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: LIN bus

Post by AndreyB »

Dron_Gus wrote:
Fri Mar 24, 2023 11:40 pm
New (LIN2.0) CRC type.
PRRRRRRRRRRRRRRRRR
PPPPPPPPPPPPPPPPPPR
PR?
Very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions

Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
User avatar
Dron_Gus
contributor
contributor
Posts: 450
Joined: Wed Nov 13, 2013 1:11 pm
Location: S-Pb
Github Username: dron0gus

Re: LIN bus

Post by Dron_Gus »

AndreyB wrote:
Fri Mar 24, 2023 11:45 pm
PRRRRRRRRRRRRRRRRR
PPPPPPPPPPPPPPPPPPR
PR?
This was captured with garbage lin adapter for PC... neet some time to move code in RE
puff
contributor
contributor
Posts: 2961
Joined: Mon Nov 11, 2013 11:28 am
Location: Moskau

Re: LIN bus

Post by puff »

which code? it's just raw data..
btw, googled for that BMW battery wire and got this:
"Плюсовой провод аккумуляторной батареи БМВ, Клемма аккумулятора BMW с пиропатроном" %-)))
User avatar
Dron_Gus
contributor
contributor
Posts: 450
Joined: Wed Nov 13, 2013 1:11 pm
Location: S-Pb
Github Username: dron0gus

Re: LIN bus

Post by Dron_Gus »

puff wrote:
Sat Mar 25, 2023 9:20 am
which code? it's just raw data..
btw, googled for that BMW battery wire and got this:
"Плюсовой провод аккумуляторной батареи БМВ, Клемма аккумулятора BMW с пиропатроном" %-)))
LIN bus driver code.
I have only minus battery wire. Hope it will not explode.
User avatar
Dron_Gus
contributor
contributor
Posts: 450
Joined: Wed Nov 13, 2013 1:11 pm
Location: S-Pb
Github Username: dron0gus

Re: LIN bus

Post by Dron_Gus »

https://github.com/mestrode/IBS-Sensor-Library but not compatible with these two sensors that I got from junkyard.
Post Reply