Reputation: 899
Hi this OBD BLE device (https://www.amazon.com/LELink-Bluetooth-Energy-OBD-II-Diagnostic/dp/B00QJRYMFC) is the one I'm using to connect over bluetooth my own iPhone. I have been able to find the right service and the characteristic to write to and to set notify value to true. However, I'm very confused as to what kind of commands I'm supposed to be sending to it. There's a list of mixed instructions online about how ELM327 devices are supposed to receive "PIDs" but also I'm confused if I should be using the list of AT commands.
First time I sent "DP\r" (an AT command) to the write characteristic and got back "DP ?" so I'm guessing it was not understood by the device. Second time, I was following one PDF which said I should send in Mode followed by PID number so I sent in "01 00\r" which was replied with "NO DATA". I'm guessing this second command might have been better because at least I received something back instead of "?".
Would anybody know what to do in this situation? Thank you
Upvotes: 0
Views: 611
Reputation: 3
The LELink OBD BLE device (https://www.amazon.com/LELink-Bluetooth-Energy-OBD-II-Diagnostic/dp/B00QJRYMFC) uses the ELM327 protocol https://www.elmelectronics.com/DSheets/ELM327DSF.pdf which explains the AT commands it supports and then sending PIDs (which are not AT commands). Very briefly as an example you would send (waiting between lines was a response):
ATZ\r
01 00\r
The LELink is a BLE device so you have to send this to one of its vendor specific characteristics which, when I performed a search for the device's services/characteristics, was advertised as:
UUID: 0000ffe1-0000-1000-8000-00805f9b34fb
Description: Vendor specific
Handle: 36
Properties: ['read', 'write', 'notify']
Descriptors:
00002902-0000-1000-8000-00805f9b34fb (Handle: 38): Client Characteristic Configuration
00002901-0000-1000-8000-00805f9b34fb (Handle: 39): Characteristic User Description
This was the only notify able UUID available listed as vendor specific. You send and get responses from this characteristic.
You mention the Nissan leaf - which is maybe where you are struggling as it does not generally support OBD PIDs. Instead I believe the pre-2018 Nissan leaf's CAN messages can be monitored using the AT MA
command (another answer links information about this). However the 2018+ Nissan leaf does not share any CAN data without it being requested first. You have to specifically request specific data. I have done this using a python script with the LELink communicating via bluetooth using the bleak library. 2018+ Nissan leaf CAN addresses and details can be found here: https://drive.google.com/file/d/1jH9cgm5v23qnqVnmZN3p4TvdaokWKPjM/view
To use the example of vehicle speed, I get the LELink ready by sending the following (each time the LELink responds OK\r
- I don't believe anything is sent to the vehicle during this time):
AT Z\r
AT ST FF\r
AT SP6\r
AT H1\r
AT D1\r
AT SH 797\r
AT fc sh 79a\r
AT fc sd 30 00 20\r
AT fc sm 1\r
797, 79a are from the CAN addresses document linked above. The AT commands are explained in the ELM327 data sheet linked above. Then I send the following to the LELink (from the CAN addresses document linked above). At which point the LELink communicates with the vehicle [make sure the vehicle is turned on]):
22 12 1A\r
The response is then:
79A 8 05 62 12 1A 00 00 \r
The last two hex bytes (00 00
) being a representation of the vehicle speed (in this case 0 km/hr). 05
is the number of bytes following. 62 12 1A
relates to the request we just sent.
Upvotes: 0
Reputation: 11
I'm also searching for information regarding the same thing. While surfing on the internet I got a PDF with the command list to be sent to ELM327 devices and another site with info on how to use those commands in simple. So as for the details in this site "DP\r" would not work instead you would need to send "ATDP\r" as every command starts with "AT".
and I suppose that this also will be a useful PDF.
Upvotes: 0