r/AskReverseEngineering • • Oct 20 '24

Figuring Out LIN Slave Command Format

Hi,

I'm making an interceptor device for a set of Automotive Headlights (now Magnetti) that have AFS. The headlight bending motors are controlled via LIN, and are unfortunately inaccessible to check what LIN driver they are using. There's a central LIN master node in the car which reads the steering angle data, car angle positions and speed and informs the headlights based on this in which directions to point the beam.

I've managed to get a sniff of the headlight network in an attempt to reverse engineer it however am struggling to find out what each message actually does. Here's a breakdown of what I know so far:

  • 0x3C is some kind of master diagnostics PID?
  • 0x37 is the master node inside the car which informs the lights which way to point
  • 0x7D - Unsure but appears to show up at the same time as 0x3C
  • 0xA3 - Headlight motor (vertical)
  • 0xA6 - Headlight motor (horizontal)
  • 0xE7 - Headlight motor (vertical)
  • 0xE2 - Headlight motor (horizontal)

A sample message array would be:

37 30 5A 38 5A 19 04 11 00

A6 71 FF FD 00

E2 79 00 20 00

And another with the other PIDs showing up:

37 30 66 38 66 19 07 F1 FD

A3 70 0B 17 00

E7 78 0B 30 00

E2 79 00 38 00

A6 71 FF E8 00

The initial startup sequence where 0x3C appears has a message of:

3C 80 91 F0 C0 DD 4D 93 8C

This seems to align somewhat with a TMC221 doing dynamic assignment of LIN IDs; the above message is the first message on the network so it would make sense.

TMC221 Datasheet

If anyone has any pointers it'd be much appreciated. Here's the first 5 seconds worth of messages on the network in case anything pops out:

0.034	A3								
0.053	E7								
0.072	E2								
0.091	A6								
0.101	3C	80	91	F0	C0	DD	4D	93	8C
0.12	A3	70	00	00	E0				
0.129	37	10	00	1F	00	1F	00	1F	00
0.187	3C	80	91	F8	C0	DD	4D	97	9C
0.196	3C	80	82	F0	FF	FF	FF	FF	FF
0.206	7D	FE	FF	B1	C0	B6	26	00	03
0.244	E7	78	00	00	E0				
0.254	37	10	00	18	00	1F	00	1F	00
0.292	3C	80	91	F9	C0	DD	4D	92	88
0.301	3C	80	82	F8	FF	FF	FF	FF	FF
0.31	7D	FE	EF	F1	C0	98	26	00	03
0.32	3C	80	89	F0	E0	3A	84	00	E3
0.377	E2	79	00	00	E0				
0.387	37	10	00	18	00	19	00	1F	00
0.406	3C	80	91	F1	C0	DD	4D	96	98
0.415	3C	80	89	F8	E0	3A	84	00	E3
0.425	3C	80	81	F0	FF	FF	FF	FF	FF
0.434	7D	F0	E0	3A	04	E0	0F	F4	FF
0.453	A3	70	00	00	00				
0.51	A6	71	00	00	E0				
0.519	3C	80	89	F9	E2	6A	83	00	F3
0.529	3C	80	81	F8	FF	FF	FF	FF	FF
0.538	7D	F8	E0	3A	04	E0	0F	F4	FF
0.548	37	10	00	18	00	19	00	11	00
0.576	E7	78	00	00	00				
0.624	3C	80	89	F1	E2	6A	83	00	F3
0.634	3C	80	81	F9	FF	FF	FF	FF	FF
0.643	7D	F9	E2	6A	83	E0	0F	F4	FF
0.7	E2	79	00	00	00				
0.729	3C	80	81	F1	FF	FF	FF	FF	FF
0.738	7D	F1	E2	6A	83	E0	0F	F4	FF
0.814	A6	71	00	00	00				
3.433	E7	78	00	00	00				
3.471	A6	71	00	00	10				
3.49	A3	70	00	00	10				
3.509	E7	78	00	00	10				
3.528	E2	79	00	00	10				
3.727	37	10	00	18	00	19	00	11	00
3.746	37	10	00	18	00	19	00	11	00
3.87	7D	F1	E2	6A	83	10	02	F0	FF
3.946	A6	71	00	00	00				
3.956	3C	80	81	F0	FF	FF	FF	FF	FF
3.965	7D	F0	E0	3A	04	10	02	F0	FF
3.984	A3	70	00	00	00				
4.051	3C	80	81	F8	FF	FF	FF	FF	FF
4.06	7D	F8	E0	3A	04	10	02	F0	FF
4.098	E7	78	00	00	00				
4.145	3C	80	81	F9	FF	FF	FF	FF	FF
4.155	7D	F9	E2	6A	83	10	02	F0	FF
4.212	E2	79	00	00	00				
4.315	3C	80	88	F0	9C	F4	C0	E9	80
4.325	3C	80	88	F8	9C	F4	C0	E9	80
4.344	A3	70	FF	AF	00				
4.363	E7	78	FF	7B	00				
4.42	A3	70	FE	03	00				
4.439	E7	78	FD	C5	00				
4.496	A3	70	FC	53	00				
4.515	E7	78	FC	10	00				
4.572	A3	70	FA	A3	00				
4.591	E7	78	FA	5A	00				
4.648	A3	70	F8	F3	00				
4.668	E7	78	F8	A5	00				
4.724	A3	70	F7	43	00				
4.744	E7	78	F6	F2	00				
4.801	A3	70	F5	93	00				
4.82	E7	78	F5	3D	00				
4.877	A3	70	F4	B9	00				
4.896	E7	78	F4	97	00				
4.953	A3	70	F4	18	00				
4.972	E7	78	F3	F4	00
1 Upvotes

0 comments sorted by