ANDROID ELM327/OBD2 PROTOCOL
Asked Answered
Y

2

12

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!

Yurikoyursa answered 27/2, 2013 at 16:42 Comment(0)
W
16

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:

AT Commands
OBD-II Commands

Werby answered 28/3, 2013 at 14:41 Comment(1)
AT Command link updated. sparkfun.com/datasheets/Widgets/ELM327_AT_Commands.pdfTricorn
D
3

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.

Diaphoretic answered 15/7, 2013 at 14:10 Comment(1)
can you please see this Question #18529292Atonic

© 2022 - 2024 — McMap. All rights reserved.