rnd-ash / mercedes-hacking-docs

Documents on hacking and reverse engineering Mercedes vehicles
195 stars 35 forks source link

CAN bus connection to OBD2 Port #2

Open steigerth opened 3 years ago

steigerth commented 3 years ago

I tried to listen to my CAN bus on my W169 over the OBD2 port. I use an USB2CAN device and linux SocketCAN. I could successfully listen to my interior bus (CAN-B, speed 83'000) but somehow it is not possible to listen to CAN-C engine bus directly over the OBD2 port. For the interior bus, I connected my CAN device to the CAN connector near the SAM on the passenger seat side.

This is how I bring up the can device:

sudo ip link set can0 up type can bitrate 500000
sudo candump can0

Unfortunately I can nothing see on the command line. Candump does not display any data.

I use an OBD2 to D-SUB 9 cable. I also sent the wakeup command before:

sudo cansend can0 01C#0210920000000000

Nothing changed after trying again with candump.

Does anybody know what might be the problem?

fseidenii commented 3 years ago

I believe you will need to connect at a different X/x-x connection point... One that is n the CAN C network. This is due to separation of CAN B and CAN C via "Gateway" Modules... IIRC, it is the ZGW or the Officially named Central Gateway Module that separates CAN B and CAN C... but you would need to verify this in WIS system for your VIN or 169.xxx chassis code.

Open WIS and enter your VIN. Then do a Keyword search w/ string "CAN". Select the Function Diagram for CANbus... Letters and Numeral/Arrows will outline the route of comms and gateway modules. Additionally, if you are looking for a specific function such as or, , use this as your keyword search string, and the comms necessary for function will also be available. Good luck!