How to communicate with OBD II using bluetooth or wifi using iphone - ios

I like to create a simple application for iOS, which read data from car through ODB II Wifi/bluetooth device and display in iPhone screen. But i don't know where to start. Please somebody help me to achieve below results.
I have both Bluetooth and wifi dongle.
Step 1 : Pair the bluetooth or Wifi dongle and iPhone.
Step 2 : Read the details through dongles
Please refer any tutorial or sample code which i can understand easily. I want to understand the these process in-depth and want to code by myself. So please help.
Thanks in advance.

As David mentioned, on iOS you can use WiFi OBD interface only. Standard Bluetooth (not BTLE) will not work. Bluetooth devices should be approved by Apple to be able to transfer data to/from iOS. AFAIK there is no such a OBD's.
Probably your OBD dongle is based on ELM327 chip. Good starting point is this doc. Read it carefully. This is everything what you need. Interesting things starts at page 7.
On iOS you should open TCP connection with your OBD IP address(for example using NSInputStream, NSOutputStream), then configure OBD using AT commands. Rest is described in section "Talking to the Vehicle" (page 30) in ELM link. Enjoy reading :)
If you need more help- just ask.

Related

Controlling a device with CoreBluetooth

I was looking at a couple CoreBluetooth tutorials for iOS. Based on the tutorials, it looks like one device is transmitting data and the other device is receiving. Like in this example: http://www.raywenderlich.com/52080/introduction-core-bluetooth-building-heart-rate-monitor the heart rate monitor is transmitting and the iphone is receiving. Is there a way to just connect to device to control it?
For example, I have a soundbar that is Bluetooth and can I write an app to do the same thing the remote it comes with does (volume up, volume down, input source change, power off)?
Adafruit proposes a lot of tutorials / material to learn how to use BLE (Bluetooth low energy)
tutorial about their BLE module (that could run with an Arduino): https://learn.adafruit.com/getting-started-with-the-nrf8001-bluefruit-le-breakout
tutorial about their iOS app (to connect to the previous module): https://learn.adafruit.com/bluefruit-le-connect-for-ios
iOS app source code to connect to BLE devices or play with previous module: https://github.com/adafruit/Bluefruit_LE_Connect
If you need one way transmission with the maximun data rate you need to read this article:
http://www.tbideas.com/blog/2013/04/Optimizing-Bluetooth-Low-Energy-Performance/
it talks about CBCharacteristicWriteWithoutResponse
Stackoverflow thread about the same one way communication subject:
iOS. BLE. CBCharacteristicWriteWithoutResponse - How to make it work?
Hope this helps!

Communicating using Core Bluetooth

I am new to Objective c and I want to send simple strings from an iPhone to an arduino an vice versa with Bluetooth. I have read apples information about Core Bluetooth, but I am having trouble understanding it. As I said, all I need the iPhone to do is: 1) connect to the BLE device of the arduino. 2) Send instructions (in the form of strings) 3)get a response from the arduino when the instructions have been carried out, so that the next set of instructions can be sent. I would be very happy if somebody is able to help me with this project
Thanks
You should follow the wwdc presentation on core bluetooth.
You should probably start here
I suggest operate your device with YMSCoreBluetooth.
The basic step to operation bluetooth device is:
Search all nearby device by blue tooth scan, you will find all nearby device.
Stop your scan. Connect one of the devices found in response.
Discover all services on the device.
Discover all character in service found by service discover action.
Write your content into character found in 4.
You can read character value from device.
YMSCoreBluetooth let you write your logic in one code block instead of separate delegate.

Paring iOS app to Samsung TV as remote controller

I have been using Upnpx library to discover the TV using Upnp protocol.
What I have to do now is to pare my iOS app with the TV as a remote controller.
The first objectives are to take control of the sound volume, move the mouse cursor, browse through web-browsers, etc.
I have tried to google for urn:samsung.com:device:RemoteControlReceiver1 specification but I had a hard time to find useful informations.
Has someone already done this before and could give me directions or the technical specification to control the TV from a remote app ?
Regards,
You could try to use Charles. That way you will be able to sniff your network. Then try to duplicate the functionality in your app.
Just for the people who will face the same issues.
I paired my iOS app to the samsung TV through TCP socket (I used GCDAsyncSocket to handle this) and using the great informations I found here :
http://sc0ty.pl/2012/02/samsung-tv-network-remote-control-protocol/

Bluetooth and delphi , how?

I want to send a file to a device (phone) using bluetooth nothing fancy. But i don't know where to start should i find a driver? Maybe one of you guys worked with bluetooth before and can give me a starting point.
I hacked some bluetooth support into Indy (because you can only(?) read/write bluetooth via sockets: Bluetooth Programming with Windows Sockets) a month ago.
See my post on the indy forum for the code:
Indy Bluetooth support
We use it here for reading a bluetooth barcode scanner (both master and slave mode), with auto connect etc (maybe I need to update the posted code for master support, please let me know if you need it)
I haven't worked with it before but I'd start on MSDN
The article explains how to use windows sockets to connect to Bluetooth devices.
There's probably wrappers for these methods. I'll add some more information after I've looked into it

Iphone as a start button

I would like to develop an (personal) iphone app to use the iPhone as a controller for a small device such as a fan or for example a light bulb. Does anyone know if there is some kind of controllable iphone-dock to use for something like this. And are there some kind of methods to use with such a dock? For example the fan just needs a variable voltage for different rpm.
Thanks in advance,
EAAccessory requires that you become a Apple hardware partner, which is very expensive and not easy (this is why you only see large companies releasing hardware accessories for iOS devices).
There's a few ways around this. The easiest way is to have your app send OSC signals over WIFI to an OSC server. I've set this up before using TouchOSC on the iPhone and an Arduino connected to my desktop via USB. It's not hard at all, but it requires that you have an Arduino connected to a computer; it's not ideal.
Alternatively you can use audio output to send commands over the line output in the iPhone's dock connector, effectively turning the iPhone into a software modem.
Good luck and if you get this figured out, post the code on github. :-D
EAAccessory framework might not be what you want because of the requirement for you to have the license and hardware. You could better implement some sort of small webserver that runs an arduino or something similar. check this out for an example of that. on the arduino, you could just have a 5v relay to control the switch of whatever device and have the other pins of the relay connected to a hot (or cold depending on the relay state) standard 120v plug so you can plug anything into it. here is a good project for arduino controlled relay
for direct serial control, you could do something like this but it would require being jailbroken. i think for a personal app, doing it via wifi would be the best way unless you jailbreak and install the full bluetooth stack where you do not need EAAccessory stuff
Check out EAAccessory Framework. Used to handle external devices.
You could try using an ultrasound detector attached to your device, and playing an audio file at the appropriate frequency etc. on the iPhone.

Resources