How to communicate with OBD-II device

Jacob picture Jacob · Mar 17, 2015 · Viewed 16.9k times · Source

There is OBD-II device like http://www.rczd.com/c/2015/Car_Diagnostic_Tools_0223/41193.html this device provider does not have its web page or documentation source. We have short "quick start" in box and assurance that it support OBD-II PIDs.

Recently I used to follow https://en.wikipedia.org/wiki/OBD-II_PIDs#Mode_1_PID_41

The question is, if there are any general pattern how to communicate with this icar device.

Before I've used to connect with (freematics)dongle that has send the stream of data which I've parsed on fly.

Current one send only one value after one request we send to it (it is synchronous and can't handle more than one request per time).

I would like to get up-to-date OBD-II params to display them(frequently).

Any ideas ?

Answer

Łukasz Dembiński picture Łukasz Dembiński · May 1, 2015

If your device is compatible with the ELM327 you can use multiple PID requests but only if adapter is connected to the vehicle with CAN protocol. So it would work only with a subset of vehicles because not all vehicles support CAN.

Popular scan tools simply sends sequential requests. Maximum throughput you can gain with this approach is about 30-40 rps.

I don't know how freematics dongle works but I can see it has some SD card mounted - maybe it gives only emulation of parallelism and internally every request is sent sequentially?

If you are searching for reliable Java library for connecting to OBD II device I would recommend you https://github.com/pires/obd-java-api . You can also take a look at my library - https://github.com/devesion/java-obd-adapter