Pages: [1]   Go Down
Author Topic: BLUETOOTH + IPHONE + ARDUINO  (Read 8179 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello all,
New to the forum and loving it. TOO many goodies on here. Here is the issue I would like to address. I would like to build a project that has bluetooth capability and control using the iphone. I realize due to idevice SDK limitations serial over bluetooth is not supported, but its not what I am after and could frankly care less if there is no communication between the iphone and arduino over BT. The important part for me is for one of these three instances be true in simplest form:

1) Arduino to control LED on/off. Arduino scans for available bluetooth devices and finds iphone bluetooth by MAC address (it is to my understanding that bluetooth MACs are broadcast prior to connection and ONLY in discoverable mode.  but i could be wrong and please correct me if I am. ) Upon noticing iphone bluetooth is within range, arduino turns LED on. Arduino polls for bluetooth to see if device is still within range andonce out of range or bt turned off on iphone, arduino turns LED off. The next issue in this scenario is to be able for the arduino to  identify multiple devices and with some simple code, leave the state of the led as is until no allowed devices in range.

2) Arduino to control LED on/off. iphone connects to arduino bluetooth, arduino turns LED on. Once disconnected or out of range or bt turned off on iphone, arduino turns LED off. The next issue in this scenario is to be able to  allow connection of  multiple devices and with some simple code, leave the state of the led as is until no devices connected.

3) since the first three instances seem a little out there, I'm also thinking of using an HID BT profile as I'm sure iPhone can connect to these and then somehow get the duino to recognize the connected iPhone. The only issue with this instance is that I believe this profile allows for not more than one connection at a single time.

In closing, if this works with iphone, it should work with any bt device.

Any help is greatly appreciated. And please no LMGTFY,I have spent hours doing that on my own and i dont ask questions unless a last resort.

Update 1: Found Bluetooth Stack for iDevices
This Stack allows the iphone to communicate over SPP and RFCOMM, a step in the right direction.
Thanks to : HazardsMind

ROB pk
« Last Edit: December 17, 2012, 01:56:52 am by The_SilverOne » Logged

Queens, New York
Online Online
Faraday Member
**
Karma: 65
Posts: 2925
"Of all the things I've ever lost, I miss my mind the most" -Ozzy Osbourne
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

For my senior year in college, I had to think of ideas for a seminar project. I wanted to control a robot (that I made myself) with my IPhone, but I found out that the bluetooth protocol was very difficult to crack. It turns out that only a select few outside BT devices could found by the phone. Of course other phones could be found, but not store bought BT modules. So unfortunately, I had to scrap that plan and used an Android.

However I did hear that it could be done with a Jail broken phone, but at the time I didn't want to jail break my phone, because I wanted to make an app of my own that could do it from any Iphone and not just a jail broken one. Since then, I got rid the the phones altogether and just made my own controller from various arduino components.

If you still want to control it from your Iphone, it would be better to just pay someone at Apple to make you your own app. I think they want $150 - $200 depending on complexity.
Logged

Created Libraries:
NPV2 (NewPasswordV2),  TFT_Extension, OneWireKeypad, SerialServo.
Will provide libraries if asked in PM or forum.

Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

For my senior year in college, I had to think of ideas for a seminar project. I wanted to control a robot (that I made myself) with my IPhone, but I found out that the bluetooth protocol was very difficult to crack. It turns out that only a select few outside BT devices could found by the phone. Of course other phones could be found, but not store bought BT modules. So unfortunately, I had to scrap that plan and used an Android.


Is there anyway to emulate these devices? Most HID devices (keyboards, etc) can connect with the iphone without the need to jailbreak.  My question would be with an arduino and a BT board (which one would do best for this situation?)  with an HID profile should be able to work right ? and if so is there a way to make arduino run a command on connect and disconnect (say turn a pin on and off)?


However I did hear that it could be done with a Jail broken phone, but at the time I didn't want to jail break my phone, because I wanted to make an app of my own that could do it from any Iphone and not just a jail broken one. Since then, I got rid the the phones altogether and just made my own controller from various arduino components.



Would there be any chance that you may have retained a copy or access to that information? All my idevices are jailbroken and its a non issue. If i want to develop a friendlier version i could use the BT BLE module in the future but my phone does not support BT4.0 .


If you still want to control it from your Iphone, it would be better to just pay someone at Apple to make you your own app. I think they want $150 - $200 depending on complexity.

The reason it would only work on a jailbroken phone is because apple did not release the serial over bluetooth protocol in the iOS SDK and therefore no one could write such a program unless the phone were to be jailbroken in order to grant a form of low level access not granted otherwise.

Thanks for your insights.
Cheers
« Last Edit: December 16, 2012, 10:12:22 pm by The_SilverOne » Logged

Queens, New York
Online Online
Faraday Member
**
Karma: 65
Posts: 2925
"Of all the things I've ever lost, I miss my mind the most" -Ozzy Osbourne
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Is there anyway to emulate these devices? Most HID devices (keyboards, etc) can connect with the iphone without the need to jailbreak.  My question would be with an arduino and a BT board (which one would do best for this situation?)  with an HID profile should be able to work right ? and if so is there a way to make arduino run a command on connect and disconnect (say turn a pin on and off)?

To be honest, I'm not sure.

Quote
Would there be any chance that you may have retained a copy or access to that information? All my idevices are jailbroken and its a non issue. If i want to develop a friendlier version i could use the BT BLE module in the future but my phone does not support BT4.0 .

No, I don't have any of it anymore, I had a problem with my computer and lost literally everything on it, including my robot stuff that I was working, and had to start from scratch.
Logged

Created Libraries:
NPV2 (NewPasswordV2),  TFT_Extension, OneWireKeypad, SerialServo.
Will provide libraries if asked in PM or forum.

Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

To Keep An update on the progress i have found a BTSTACK for jailbroken iOS devices that allows for SPP and RFCOMM over BT. Thanks HazardsMind for pointing me in that direction. This, in theory, should allow my iphone to connect to the BT on arduino. Now the only remaining issue is to get arduino to run a command on BT connect & disconnect, without any interaction from the iPhone (asides from connecting/disconnecting).

For those experienced in this realm, is there a specific BT module for arduino that would work with any if not all of these profiles (SPP, RFCOMM, L2DAP or HID)?
Logged

California
Offline Offline
Faraday Member
**
Karma: 82
Posts: 3123
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

For those experienced in this realm, is there a specific BT module for arduino that would work with any if not all of these profiles (SPP, RFCOMM, L2DAP or HID)?

I've had a good amount of success with cheap $10 dongles from DealExtreme and eBay (SPP Protocol). Although my communications were done through an Android, everything seemed to work OK on the Arduino's end.
Logged

ਪੰਜਾਬ
Offline Offline
Edison Member
*
Karma: 7
Posts: 1545
Another year! Alone! :(
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I have programmed a lot for Android and I have successfully connected it with ARM's, AVR's the bluetooth connection and done whatever I just imagined! but I do not programme for iOS basically I hate it but may be I may start in sometime for iOS too! if I see money rolling in  smiley-money
Logged

"Real Men can Accomplish  Anything"
-  Website  
- skype : nishants5  

ਫ਼ਤੇਹ ਕਰੂਂ !

Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Ok, forget the iPhone momentarily. Is there a way to make an arduino scan for bt devices and run a command once a certain bluetooth device (call it devx) is detected within range without actually connecting to devx?
Logged

Offline Offline
Newbie
*
Karma: 3
Posts: 34
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I can't help you with the bluetooth.....

But I saw this on maker shed smiley

http://www.makershed.com/RedPark_TTL_iOS_Cable_Breakout_Pack_p/msbun36.htm
Logged

That little black caterpillar you just stepped on will set you back a few bucks....

Austin, TX
Offline Offline
Faraday Member
**
Karma: 63
Posts: 6049
Baldengineer
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

For those experienced in this realm, is there a specific BT module for arduino that would work with any if not all of these profiles (SPP, RFCOMM, L2DAP or HID)?
The BlueGiga modules sold as SPP modules by SeeedStudio and Others can be reflashed to be any bluetooth profile.  They can also be flashed with the Apple iAp profile if you have the 3-way NDA in place (you, Apple, BlueGiga).

Is there a way to make an arduino scan for bt devices
The Arduino can't, but the Bluetooth radio probably can.  If you look at the command set for the BlueGiga (or whatever radio you chose) you might be able to do the scanning.  In the case of BlueGiga, it is attached to the UART of the ATmega328 chip, so it can either send data or communicate with the radio (like the old-school ATA commands with modems.)
Logged

Capacitor Expert By Day, Enginerd by night.  ||  Personal Blog: www.baldengineer.com  || Electronics Tutorials for Beginners:  www.addohms.com

Offline Offline
Full Member
***
Karma: 2
Posts: 104
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You can connect bluetooth to iphone with HID profile..
Here is a post and an app tonrecieve the data..
http://arduino.cc/forum/index.php/topic,136076.0.html
Logged

Pages: [1]   Go Up
Jump to: