0

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.

WEIDER
  • 87
  • 1
  • 7

1 Answers1

1

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...

Dario
  • 732
  • 7
  • 30
  • Wow your answer was exactly what I was searching for, many thanks.The next question would have been if there is a table or something with the commands for OBD2 and you have also anwered that question. So thank you very much. – WEIDER Oct 11 '17 at 19:39
  • I'm doing my thesis with this arguments and android :D .... You are welcome, for more information read my last Question maybe you can find something helpfull ;) Good luck! – Dario Oct 12 '17 at 16:31
  • Hey Dario I still can't create a connection. With this tutorial I can search and find the OBD2 Adapter, pair with it but it hangs by the connection Thread.[link](https://www.youtube.com/watch?v=y8R2C86BIUc&list=PLgCYzUzKIBE8KHMzpp6JITZ2JxTgWqDH2) – WEIDER Oct 21 '17 at 18:38
  • I started with BluetoothChat sample from Android Studio...and it works – Dario Oct 21 '17 at 18:44
  • I solve it , changed the UUID now I get something like: CONNECTING< ?> But get no responses to the commands like "010c\r" even if i put the carriage return – WEIDER Oct 22 '17 at 18:22