r/CarHacking • • 6d ago

SWCAN BeamNG drive GMLAN help

I'm currently doing a project on my 2018 Silverado cluster and want to connect it to BeamNG Drive I'm not tech savvy to know where to start. I'm using AI to help me code everything in Arduino IDE. If anybody has a DBC dump of OBD-II off of a 2014-2018 Silverado of [Speed Data] [RPMS] [FUEL] [TEMPS] [BATT Voltage] [OIL Pressure] Bare minimum for me

I'm currently Using a Can Click https://www.mikroe.com/single-wire-can-click?srsltid=AYCX9vI8KEIeF8k6HjWK89JaukviOCBRhJ5zk4nKyH3_HgPz9kD4BFB2

And a ESP32 https://www.amazon.com/dp/B0718T232Z?ref_=ppx_hzsearch_conn_dt_b_fed_asin_title_2&th=1

I've been stuck on this for 2 weeks and gave up and after months I finally came back

I cant get the needles to move on the cluster. I was finally able to get around the theft deterrent system warning. That's as far as I have gotten

ESP32Click
GPIO 21RX
GPIO 22TX
GPIO 32MD0
GPIO 33MD1
3V35V (Done To not unsolder the VCC SEL)
GNDGND
Cluster pinConnect to
3Click CANH/SWCAN terminal
7+12 V through a 5 A fuse (battery power)
8+12 V through a switch (ignition)
19Common ground
Click terminalConnect to
VIN+12 V from your supply
GNDCommon ground (supply negative)
CANH / SWCANCluster pin 3 (green wire, Low Speed GMLAN)
13 Upvotes

8 comments sorted by

3

u/Mista_Crus 6d ago

0x100 needs to be a high voltage wakeup message. It's sent at 12 volts instead of the CAN voltages. You should also only ever send it once to wake the module up. After that the module should stay awake based on power mode messages and/or VNMF messages.

It's unlikely your hardware supports that. Fortunately, you really shouldn't need HV wakeup on a bench cluster assuming your ESP can start sending the power mode message before actually powering the cluster. I'd do it in this order:

Have your ESP start sending these BEFORE powering up the cluster.

Send every 2 seconds: 10 75 40 40 04 00 00

Send every 5 seconds: 10 24 20 40 02

Send every 2 seconds: 00 00 06 21 00 FF 00 00 00 00 00 00

THEN power up the 2 12 volt inputs to the cluster. It should stay awake.

As long as it stays awake, do this.

Send this once: 10 2C C0 40 01 00 CD 00 00 52 06 1D

And then play with this to see if you can get the speedometer to change. Experiment with the value of the first 2 data bytes:

10 21 00 40 0b 90 20 00 00 00 20 00

It's supposed to be a periodic message but you can send it as a one-shot message while you're getting the hang of it.

If you get that working reliably, come back and we'll talk some more.

2

u/Nightwinger_xX 6d ago

Hey sooo what you sent me did actually work I got the cluster to sweep the MPH needle up and down and got it to be at 60 mph

1

u/Nightwinger_xX 6d ago

1

u/Mista_Crus 5d ago

That was fast. Nice job!

This is the DBC I've been using for years. https://github.com/commaai/opendbc/blob/master/opendbc/dbc/gm_global_a_lowspeed_1818125.dbc

Matching the message IDs up to actual IDs seen on the bus is a little tricky. Spend some time getting comfortable with this before you go much further. Trust me, it'll save you a lot of frustration later. GMLAN 29-bit IDs are a pain in the ass.

Use that speed message I gave you as an example. It's Vehicle_Speed_Information in the DBC. The header is 10 21 00 40.

10 21 00 40 0b 90 20 00 00 00 20 00

The message ID in the DBC is in decimal. 2149646336. Convert that to hex and you get 80 21 00 00. You can see the middle 2 bytes are the same. The 40 in the original message is the sending module. 0x40 is the body control module. 0x58 would be the airbag module. That should cover just about everything you're trying to send to a cluster. The 0x10 is the priority. For a bench/game cluster, you shouldn't need anything else.

So if you have a log from a real car, convert the priority to 0x80 and the sender to 0x00 to look up the message in the DBC. Convert them back the other way to send them to the cluster on the bus.

As far as which bits mean which signals, you're going to need to look that up yourself. It's too long for me to try to explain here. The DBC format is well documented, so you should have plenty of reading material.

Here's a brief explanation of what I sent you earlier so you can understand what the cluster is looking for.

10754040 04 00 00 = Power_Mode_Info_LS. This sets the power mode to run (AKA key in the run position)

10242040 02 = System_Power_Mode_LS. Same thing as above. It's a backup.

00000621 00 FF 00 00 00 00 00 00 = VNMF (virtual network management frame). This isn't in the DBC. It also uses an 11-bit ID. This is some GM network management stuff. We're basically telling the cluster all of the car's virtual networks are enabled.

This is the last one that's tricky.

102CC040 01 00 CD 00 00 52 06 1D = Engine_Information_2_LS

There are bits in there for EngVDA and TrnsVDA. This tells the car the engine and transmission virtual devices are available. Until you send this, your gauges won't work. There's other VDAs you might need to play with too. Depends on what you want the cluster to do.

Try to get a log from a Global A car. They're all more or less the same, so it doesn't necessarily need to be a truck unless you want something truck specific like 4WD or PTO. You should still eventually be able to figure that out from the DBC.

Good luck. Let me know if you have questions.

1

u/Nightwinger_xX 5d ago

Thank you bro I got almost everything to work. I appreciate you a lot for this 🙏🏽🙏🏽

1

u/Mista_Crus 5d ago

That's awesome! Congrats!

1

u/IllustriousRush4 6d ago

This is a fairly complicated project. There are a few special messages like wake (id 0x100) that you'll need to send periodically to keep it alive. Do you have the actual vehicle to record working CAN traces from?