I am exploring building apps (Android & iOS) for Car OBD2 Adapters that support BLE (Bluetooth Low Energy). In order for the app to be able to work with such adapters from different vendors, I presume there would be a standard set of GATT profile i.e. Services and Characteristics that these adapters would be using for standard features like engine RPM, Fuel level etc. Is this info available somewhere that I can refer while building the mobile app?
-
There is no standard profile. Each vendor uses custom profile or SPP (that is also non-standard) over BLE. – Mike Petrichenko Aug 29 '18 at 11:38
-
1Thanks Mike. But there are apps that work across different OBD BLE adapters. Do they custom develop for each of those adapters? – Aashish Singla Aug 29 '18 at 12:03
-
Yes, they have to implement each custom protocol. – Mike Petrichenko Aug 29 '18 at 12:40
-
Did you succeed in this? I'm trying since days and haven't found the right characteristics yet to write or read OBDII commands… Only able to get vendor name and stuff like that. – stefan Dec 24 '18 at 14:58
1 Answers
OBD2 BLE adapters don't use any fixed GATT profiles. The way most (if not all) BLE OBD2 adapters work, is that they offer one service with one or two characteristics:
- A write characteristic. This one is where the mobile device can write its AT commands (in the case of, e.g., an ELM327) and PIDs to.
- A notify characteristic. This is the one where the results from the car (ECUs) are returned.
Once you have access to these characteristics, you can implement the OBD2 serial protocol (e.g. using a command queue that writes and waits for the response, before transmitting the finished command to the application layer).
Some BLE adapters merge these two into one characteristic. If you want to support arbitrary adapters, you will have to add a 'select your adapter' screen where you probe the found adapters, remember the characteristics, and then communicate.
That way it's possible to write apps that work with all kinds of BLE OBD2 adapters, and not only support a selected handful of vendors, e.g., such as OBD2 Expert (Disclaimer: I'm the author of that software).

- 19,824
- 17
- 99
- 186

- 4,455
- 3
- 31
- 67
-
Did you succeed in this? I'm trying since days and haven't found the right characteristics yet to write or read OBDII commands… Only able to get vendor name and stuff like that. – stefan Dec 24 '18 at 14:59
-
@DrMickeyLauer I have been able to connect to device (am using a Veepeak BLE Dongle). It offers a Notify chatracteristic and a Write Characteristic as you mentioned. However, I was exploring using React-Native and the libraries out there need Byte Array to be passed as data in Write Characteristic function. This leaves me wondering as how to pass commands like "AT SP" or even "01 OC". I guess, these commands need to go through as String. Do you have any guidance around this? – Aashish Singla Jan 24 '19 at 16:30
-
@AashishSingla If your SDK offers a byte array, then you need to convert both AT commands and the PIDs to byte arrays using their ASCII representation. Don't forget to send `\r` after every command and/or PID. – DrMickeyLauer Jan 28 '19 at 10:43
-
1Thats a great help @DrMickeyLauer. It simply worked like a charm. Awesome !! Thanks a lot. – Aashish Singla Jan 31 '19 at 12:32
-
1@DrMickeyLauer One quick question pl. Apparently, I need to send the PID in a loop if I want to capture the changes real time on the parameter. Is that the only way to go Or is there an alternate possible wherein I can register a PID for sending me a notify in case there is a change in its value? – Aashish Singla Feb 15 '19 at 18:20
-
@AashishSingla OBD2 is a very basic protocol, there are no subscription mechanisms available. You have to poll. – DrMickeyLauer Feb 20 '19 at 10:37