0
votes

I want to receive the remaining tank volume and the current mileage of my car by using OBD II.

Therefore I have bought an OBDII Bluetooth Adapter for my car. I am using the AndroidBluetoothChat for connecting to devices and establishing a connection, through I can send and receive information.

But when I try to connect to my OBD2 Adapter, I get: Unable to connect. The OBD2 Adapter is always discoverable and I can pair them normally. Why is that?

The next question is, once i have established a connection, how can I receive Informationen like speed, mileage etc.

I am still a beginner and gratefull for every hint.

1
You need Bluetooth socket connection,Using input and output stream you can send and receive data from obd deviceRohit Parmar
Yeah I used a Bluetooth socket connection, but its not working.WEIDER
Did you start the car? If you don't turn keys you receive error from OBDDario
Finally i found the problem, I only had to change the UUIDWEIDER

1 Answers

1
votes

i'm in your same project :D I start with BluetoothChat for understand how use Bluetooth and all works fine.... At the beginning you can chat with your OBD by sending Pids in the EditText from BluetoothChat...

But remember that you need a \r (carriage return) after every commands that you send. For example if you need the RPM, send a string like "010c\r" and you get a response like 10c410cxx where xx is the value that you must divide by 4 for get the real RMP... See every pids and data transformation in this table...

REMEMBER that for work the ELM327 (your obd device) need that the car is ON half turn key or total or you don't get data but only error!

For the pids that you need (if your car support them) you can see all of them in the wikipedia page that i liked.

If you want an automatic dynamic comunication with obd you must change the comunication of the BluetoothChat with some Queue or ArrayList of commands and send them continuosly.....

REMEMBER that the ELM327 can manage one command each time....so send the first command and wait the response... and again send another command an wait response...and so on...