0
votes

I made an Android app to communicate with an ELM327 OBD-II dongle via bluetooth. When I test the app with a bluetooth serial terminal (CoolTerm / macOS) the app is receiving and sending data without an issue.

Using my app to transfer commands to the ELM will result in broken and splitted answers.

Output:

DataReceivedHandler: 9V
DataReceivedHandler: 9V>
DataReceivedHandler: 11.
DataReceivedHandler: 9V>

Screenshot

The example above should show the result of the AT RV command which queries the battery's voltage of the vehicle (I sent the command multiple times).

Expected (good) result should look like this: >11.9V

Before I send the first command to query OBD values the ELM is initialized by these AT-commands:

AT D
AT Z
AT E0
AT L0
AT S0
AT H0
AT SP 0

If you have any idea how to get clear answers from the ELM, please let me know.

Thanks in advance!

1
Seems everything is ok, but you read and show only part of the data buffer. Please add source code of communication part to clarify issue.Andrii Omelchenko

1 Answers

0
votes

Found the solution..

The terminal program was sending \n and the ELM sends \r for the termination of the statement.