Is there an ELM327 / obdkey OBD-II adapter Objective-C programming guide?
Asked Answered
S

2

8

I'd like to start coding against an ELM327 based automotive OBD-II Bluetooth adapter in iOS/Objective-C. Is there a guide/primer on how to get started?

I would imagine the ELM327 adapter is a serial device... I can probably figure out how to establish a Bluetooth connection with the phone, but I haven't any idea where to start with sending/receiving OBD-II messages to/from it.

Is there a pre-existing API for this device?

Salts answered 22/3, 2011 at 21:47 Comment(2)
I know it's some 3+ years since you asked this question, but did you get anywhere with this? I'd like to develop an iOS app that talks to an ELM327 based device over wifi and am hoping to avoid re-inventing the wheel on the OBD-II comms.Walkabout
I have a basic wifi-based AT comms setup working in this project here, that might serve as a decent starting point for anyone wanting to do this: github.com/jeffmcfadden/CarDashKillifish
O
6

If you need some OBDKey specific commands let me know. As an example, to access the RPM data, issue the following commands

ATZ\r
ATSP0\r
0100\r
010C\r

These instructions will initialise the OBDKey interface, set the protocol search on to automatic, initialise communcations with the engine managment ECU and send the mode 1 PID 0C command to request engine speed (RPM) data. The value returned in response to the 010C command is actually four time the real engine speed value.

Using sockets and streams in iOS / Objective-C is the best way to set up communications to the OBDKey WLAN (the default IP address is 192.168.0.74, port 23).

Ornis answered 23/3, 2011 at 8:47 Comment(1)
This answer is not useful as a programming guide. What is the meaning of 0100 and 010C? Where is the list of commands? With just throwing 2 commands here without explanation you don't help.Hamster
D
4

The elm327 odb2 device uses AT and ODB commands.
The AT commands are the same as you use on modems, they always start with AT.

When the devices initializes it sends

ELM327 v2.1
>

If you send

ATZ

this will reset device and it will issue "ELM327 v2.1" and > prompt again.

AT commands are used to manage the elm327 device.

ODB commands are in asci hex such as the above example

01 0c

to get the rpm or

01 05

to get coolant temp

At http://www.elmelectronics.com/obdic.html there are data sheet pdf files with more details.
Also you can search ituns for "elm327" and get 2 free books on the subject.

I'm just starting the same project for my generic elm327 wifi device so I dont have any details yet.
I will add comments as soon as I learn anything useful.

Deb answered 19/12, 2014 at 15:56 Comment(1)
The ELM327 datasheet under your link explains the AT commands of the ELM327 chip. But what is missing is a list of the commands sent to the ECU and the responses. The ELM327 only forwards them. They look like Command= 0130<CR> Reponse= 0130<CR>83 F1 11 7F 01 11 16 <CR><CR>>Hamster

© 2022 - 2024 — McMap. All rights reserved.