OBDII Port code

Joined
Sep 21, 2020
Messages
14
Programming Experience
10+
Hi all

Has anyone out there got experience of communicating with the OBDII port on a vehicle?

I have seen a couple of things online but none seem to work. Also struggling to work out how to communicate with the cable via USB.

Any guidance appreciated….
 
Does it show as a USB device with a yellow warning icon? Or as a normal icon? If it's a normal icon what is the device driver associated with it?
Ok, this is a bit strange. It is actually showing up under Ports (COM and LPT). It has named it USB-SERIAL CH340 (COM5). It seems to be using a driver from winchiphead.com. I have no idea where that came from - possibly one of the things I installed while trying to get this going. I tried removing that driver and deleting it from the system32\drivers folder but it just keeps reappearing.
 
Try connecting to COM5, treating it as a serial port.
 
Try connecting to COM5, treating it as a serial port.
Sorry - took me a while to get back to this.

So, I have a bit more information...

When I plug in the cable it seems to load as COM5 using the driver CH341S64.sys from winchiphead.com (no idea where that driver came from - probably an early attempt to get it working).

I have downloaded some code which sends a couple of init commands followed by requests for Engine RPM, Vehicle Speed, and Fuel System Status.

When I try sending commands, what I am seeing is that all the commands are just echoing back to me. So the output says 'sending 010D', followed by 'received 010D'. It does this for all commands.

If I unplug the cable from the OBD port but leave it plugged in to the USB Port, then it freezes when going through the init - so that tells me it must realise it's not connected to the car.

Also, I tried to communicate using power shell. I got the same result - i.e. all the commands echoing back to me.

What do you think? Is this a driver issue or cable issue? Or something else?

Thanks
 
Sounds like the cable to me, but I am way out of my depth here.
 
I have no idea about the issue in particular, but your last post reminds me of when I was testing some code for serial port years back, and used a paper clip to short pins 2 & 3 effectively creating a loopback on the port - like this: https://desk.zoho.com/portal/factorywiz/en/kb/articles/paperclip-loopback-test
You know - it kind of has that feel about it, as if there is some kind of loopback built in to the cable... I have just ordered a new cable so will soon know if this was the problem. Thanks
 
So, just to update on this... I bough a new cable; plugged it in; ran the code - everything worked perfectly!!!

I'm kind of annoyed at all the lost time with the last cable, but relieved that it's working now!

Thanks for the advice along the way folks...
 
Woo hoo! Congratulations!
 
Back
Top Bottom