mongo
Well-known member
- Joined
- May 27, 2024
- Threads
- 3
- Messages
- 4,046
- Reaction score
- 4,803
- Location
- SE Michigan
- Vehicles
- Cyberbeast
- Thread starter
- #1
Tesla lightbar communication is controlled by a pair of LIN messages sent at 10ms intervals.
Control:
ID: 0x0A
Length: 8 bytes
Data: six values 0-100, packed at 10 bits each
ID: 0x0B
Length: 5 bytes
Data: temperature, voltage, and other status
However, you can respond with zeros and the truck accepts it as proof of life.
Diagnostics:
ID: 0x3C 0x3D
Length: 8 bytes
Data: various propriety including software version
Truck will complain if these are ignored, but still allows the UI to function.
Here's an Amazon list of the parts needed to make your own 2 output controller:
https://www.amazon.com/hz/wishlist/ls/36PX96UY981FV?ref_=wl_share
One DCDC converter provides 5V to the ESP32 via the 5V pin (the listed module diode ORs it with the USB feed, others don't). The second is set for 15V to power the LIN transceiver.
If your micro is 3.3V (like the ESP32), you should remove the 5V pullup resistors (R4, R6) from the LIN transceiver board (but mine survived with them).
Parts handy for development and testing: https://www.amazon.com/hz/wishlist/ls/3N0GP3YZM3SFZ?ref_=wl_share
Using a second LIN transceiver, you can control the lightbar directly allowing custom patterns instead of just dimming levels.
Control:
ID: 0x0A
Length: 8 bytes
Data: six values 0-100, packed at 10 bits each
Status:// Calculate LIN enhanced checksum (over PID + data)
typedef union {
uint8_t bytes[8]; // 8-byte array for direct access
struct {
uint16_t value0 : 10; // First 10-bit value
uint16_t value1 : 10; // Second 10-bit value
uint16_t value2 : 10; // Third 10-bit value
uint16_t value3 : 10; // Fourth 10-bit value
uint16_t value4 : 10; // Fifth 10-bit value
uint16_t value5 : 10; // Sixth 10-bit value
uint16_t padding : 4; // Fill remaining 4 bits to reach 64 bits
} __attribute__((packed)) values; // Packed to avoid padding
} __attribute__((packed)) lin_bar_command_t;
ID: 0x0B
Length: 5 bytes
Data: temperature, voltage, and other status
However, you can respond with zeros and the truck accepts it as proof of life.
Diagnostics:
ID: 0x3C 0x3D
Length: 8 bytes
Data: various propriety including software version
Truck will complain if these are ignored, but still allows the UI to function.
Here's an Amazon list of the parts needed to make your own 2 output controller:
https://www.amazon.com/hz/wishlist/ls/36PX96UY981FV?ref_=wl_share
One DCDC converter provides 5V to the ESP32 via the 5V pin (the listed module diode ORs it with the USB feed, others don't). The second is set for 15V to power the LIN transceiver.
If your micro is 3.3V (like the ESP32), you should remove the 5V pullup resistors (R4, R6) from the LIN transceiver board (but mine survived with them).
Parts handy for development and testing: https://www.amazon.com/hz/wishlist/ls/3N0GP3YZM3SFZ?ref_=wl_share
Using a second LIN transceiver, you can control the lightbar directly allowing custom patterns instead of just dimming levels.
Sponsored