I am trying to send command from ANDROID to ELM327/OBD2 protocol (WIFI Diagnostic troubles). I downloaded an api or library from: https://github.com/pires/android-obd-reader The problem that this api not have any documentation. We need help about the command and protocol to exchange data. Thanks!
What do you really want to know?
With the ELM327 the protocol is fairly easy. You just send a PID in ASCII, and you will receive an answer in ASCII. It's based on polling. So you will receive 1 answer for 1 request. As long as you don't send, you don't receive.
For converting and what commands to send, check the links I provided.
Some more links:
If you want to use this library, you should download the source code. The source code is self-explanatory. There is also the source code of an example application. I tried to run the example application, but it didn't work for me. However, I took a look on the source code and it helped me for my application.
In this library you will find the main queries already implemented and easy to use. I only found an error on the ObdResetCommand class. This class implements the super class ObdCommand and it overrides the readResult method in this way:
@Override
public void readResult(InputStream in) throws IOException {
// do nothing
return;
}
To make it work, you should remove this overriding method in order to use the super class one. If you don't do that, the response is not read and it will be read in the following command, so that, every response would be delayed one query.
I hope it helps.
© 2022 - 2024 — McMap. All rights reserved.