How to communicate with OBD-II device

2020-06-03 18:13发布

问题:

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 ?

回答1:

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