How to communicate with OBD-II device
Asked Answered
E

1

8

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 ?

Evanne answered 17/3, 2015 at 9:26 Comment(1)
Hi @Jacob, I see below you have implemented it finally. Can you please help me with code.Educationist
F
10

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

Filberto answered 1/5, 2015 at 21:32 Comment(1)
Yep, I solved this recently with github.com/pires/obd-java-api, but it was few weeks ago so I see there are many changes in the lib :)Evanne

© 2022 - 2024 — McMap. All rights reserved.