Bluesmirf HID iOS App - Bluetooth Door lock/unlock - ios

I'm running into a hurdle and not too sure how to tackle it, looking for some help :). I'm trying to make a door lock/unlock mechanism using and arduino UNO and Bluesmirf HID (https://www.sparkfun.com/products/10938). I know similar products already exist that will do all the background work for me but I'm doing this for my own education and iOS app development experience.
Iphone bluetooth profiles are listed on this site (https://support.apple.com/en-us/HT204387). Since the Iphone5 does not support SPP (serial port profile) for bluetooth, my only logical choice is the HID profile (using another profile wouldn't make sense to me but I could be wrong?)
The Bluesmirf HID can operate on many different profiles, including SPP, but I've configured it to HID as that is the only profile that makes sense to me for Iphone communciation? The issue I run into though is that the bluetooth module ONLY communicates to the arduino via serial (rx/tx). So my question then becomes, is it possible to develop an app (setup for HID) that will eventually send critical serial data to the arduino to properly actuate the lock/unlock mechanism on the door? Is this even possible and what other road blocks may I run into?
As for the app development portion, I was planning to start with the apple example of temp/humidity. I THINk it uses BLE setup but I'll need to confirm. Once I got a handle on this I was going to start writing my own code. The ideal GUI I'm looking for would have connect, lock and unlock buttons that basically send data to the bluesmirf module and toggle a GPIO. I can add more features later on like security, etc...
Thanks in advance for any feedback. If this needs to be posted on another forum please let me know!

Related

Bluetooth Communication Possibilities

I have a simple question.
I know that when you pair bluetooth headphones to a phone it automatically takes over the sound and it starts playing on your headphones.
Is it possible to program a device so that, as soon as it pairs with a phone, it turns on the phone's flashlight for example?
I know that you can probably program anything to do anything, but I'm curious to know if there are any limitations? Does Apple restrict developers and engineers from creating devices that tamper with their iPhone (like the flashlight thing)? Or is it pretty much an open market?
Yes, this is very restricted to protect users.
Bluetooth works by communicating over defined profiles. Pairing does not have a side effect (like turning on the flashlight), it just bonds the two devices. To control each other, the devices have to use profiles. For example, when you connect your headphones to a phone, they probably connect both AVRCP (Audio/Video Remote Control Profile) and A2DP (Advanced Audio Distribution Profile). These profiles have very fixed scope so that developers and engineers cannot tamper with users devices in unexpected ways.
Apple is especially careful with their devices. For any Bluetooth classic device that wants to implement a profile outside of the default ones, a MFi chip is required. Bluetooth LE devices are much more open, and users can connect them to their phone either through an app or the OS itself. Apps are able to turn on the flashlight, like you describe, but it requires camera permissions and is not allowed to run in the background.
Assuming you could be talking about software as well (the question is vague enough that it doesn't point to hardware only)...
I worked extensively with CoreBluetooth, the framework allows you to create both sides of the connection (transmitter, receiver or client, server; depending on how you want to look at it). Should you wish to create an app on the phone as one of them, and another app an a phone or a mac (or iBeacons) as the other, you'd be able to create that connection and control stuff on the "client" from the "server" and vice versa. You could control as much as the Apple API allows you to control.

Inter App Communication between iOS App and Atmega 1284 microprocessor via bluetooth

What I am trying to accomplish:
User enters a password on the iOS app. If the password is correct, then send a one bit value to the microprocessor that indicates the user got the right password. The microprocessor can then start up the step motor to open the door latch.
Has anyone tried to achieve this before? If so, can you please point me in a general direction. I don't know how to approach this problem. I couldn't really find a tutorial for this. My questions are:
Is there a specific Bluetooth I need to purchase? such as only BLE devices
I see a lot of examples of Bluetooth communication between iOS and Ardunio. Would the execution of events be similar for my needs?
Is there another approach to my problem? rather than using Bluetooth?
I think reading the Core Bluetooth Programming Guide is a great start. However, this assumes the device you're connecting to is using Bluetooth 4.x which is widely known as Bluetooth Low Energy (BLE). If the device you're connecting to is using Bluetooth 2.x, you'll have to use the External Accessories Framework.
EA supports only devices that have been certified MFI (Made for iPhone) by Apple.
To make a long story short, if the device you're trying to connect to is Bluetooth 2.x and it's not MFI, you're basically SOL.
Otherwise, you can start connecting to that device pretty easily. Check out LightBlue as a way to test if you connect to the device. It will work with any BLE device.
Here's a simple tutorial to get you going with Core Bluetooth.

iOS PKPKT BLE concept

I understand that the iOS App "PKPKT" is using BLE (Bluetooth Low Enery). But what I am curious about it is, is it purely using BLE only? Or does it switching between BLE and Classic Bluetooth?
I tested with a iPhone 5 and a iPhone 5s with both installed the app. I turned on bluetooth on both devices. And then i checked the "DEVICES" list to see if the other iPhone is paired with one another, I found that they are not. Until i launched the PKPKT on one of the device, and the i check the "DEVICE" list again, now they are paired and connected. So, i'm thinking is this pairing done by the BLE pairing? Meaning one of "Just works", "Out of Band", or "Passkey entry" methods.
There is also a "Chat" functionality in that app. This make me curious if the chatting function using BLE or Classic Bluetooth?
So my question is actually "Is switching between BLE and Classic bluetooth possible?". This is part of the study on this BLE technology. Hopefully someone could help me and other newbie on this new technology.
Thanks in advance!
I wrote PKPKT. I only use BLE. No classic. iBeacon is cool but doesn't have the background scanning needed to discover other players. I use game center, but only for scores, no sessions. It's optional in the app to enable game center (those banners can be distracting!)
The chat is also over BLE.
Because the connections are not encrypted, you don't need to manually pair the devices, and "just works"
I think you might find this link helpful. It implements something that looks to be a simpler version of PKPKT. I believe the app uses a combination of GameKit/iBeacon. The app requires iOS7.0+ and states, "PKPKT does the hard work of finding other players by detecting them using Bluetooth Low Energy (BLE) in the background." iBeacon would be the most battery-efficient way of accomplishing this and is a new feature in iOS 7. There is a wealth of information online(particularly on SO) about peer to peer bluetooth gaming using GameKit, if you are interested.
We can't say for sure unless the developer lets us know. If one were to attempt to recreate the application, GameKit and iBeacon would be the technologies that I believe most would recommend.
You might find this project helpful as an overview of how to use Bluetooth LE to communicate between two devices. You don't need to pair the devices, and unlike iBeacons, it works when the app is in the background.
SimpleShare - Easy Proximity-based Sharing for iOS
You can use the delegate methods of the SimpleShare project to easily share arrays of strings between nearby users running your app, such as user IDs, which you could then use to get more info, photos, etc, about that user from a web service.

Transfer pictures from external camera circuit within my iOS app programmatically

I'm working on my senior engineering design project and I need your help! For this I have my iPhone app receiving images from a external camera circuit, which I built.
To interface my iPhone app to the camera circuit, I have looked into the following approaches:
Build a bluetooth module on the camera circuit, to transfer images to the iPhone
Use Eye-Fi SD card to transfer images to my app somehow! link:http://www.eye.fi/products/iphone
Build a circuit, to make a wired connection to the iPhone with the 30-Pin dock connector
Here are the problems I'm facing with each of these. My actual questions for you guys are highlighted in BOLD:
The iOS BlueTooth framework (4S only), only supports Low Energy Devices. Looking at the the modules out there like this one, I'm doubting it will work for image transfer, which seems to be a bulky task for low energy bluetooth. I know there are jailbreak apps on the cydia store, which do regular bluetooth transfers, but I was unable to find those private APIs for such a task. (NOTE: I'm making this app for my purposes, so feel free to suggest any private/unofficial APIs). Question#1: How can I interface to a regular bluetooth device (not another iPhone) and transfer data?
EYE-FI card sounded amazing as a consumer because the company has their proprietary iPhone app to transfer the images from the EYE-FI SD card. Problem is I can't figure out how to easily interface with the EYE-Fi card in my code. I researched the iOS CFNetwork framework, but haven't had any luck. Question#2:How can I interface with the EYE-FI card in my app?
Building a circuit seems simple enough with this development board, but I read somewhere that the iPhone may not recognize an "un-registered" accessory. I have a developer license but not a MFi licence. Question#3: Do I need to be registered as a MFi developer to create and use this external accessory in my App for my own purposes???
You might try setting something up through a serial port since joining the MPi program is prohibited for individuals. You could possible use a connector like this one http://www.amazon.com/neXplug-Ultra-Small-Micro-Adapter/dp/B0055PCVDO/ref=sr_1_1?ie=UTF8&qid=1339309918&sr=8-1
The Apple website recommends individuals/hobbyists to use " recommend that you use a third-party solution which will allow you to connect iOS devices to serial devices and to write iOS apps that communicate with these serial devices" (from mfi.apple.com/faq).
I am also working on an external camera that can hook to the iphone/ipad. I will be using a serial port in order to get around the MFi requirement for external iphone/pad devices. Trying to use bluetooth is too complicated and the data stream isn't big enough for pictures. the wired version will work much better.
I hope this helps and that your college term and project are not already finished. Best of luck.
As T Reddy has already mentioned, if you want to create hardware the interfaces with external hardware framework, you have to sign up with the Apple MFi program which you, as an individual, can not do.
I'm not sure of how the Eye-Fi system works but it sounds to me that it basically syncs the images to their server and once you download their Apple App, the app can sync the photos for you.
Whether you are using Bluetooth or the 30-pin connector, there is no way to interface to an external device unless that device is MFi compliant and a part of the MFi program. I suggest you try the following options to solve this delimma--
If this is a "Senior Project" at some University, see if your University is part of MFi. Apple will not let individuals join the program, so if you are going to gain access, you have to access it through another organization or, possibly, an educational institution. I don't know if Apple has worked with schools in this regard, but you never know. It might be possible.
If your school isn't in the MFi program then you may want to consider re-writing your application for an Android device. Android devices are not locked down like iOS devices, so that may be a more reasonable approach.
I hate to bring bad news but circumventing these hardware restrictions on an iOS device is excessively prohibited. Your options are quite limited and none of them are probably what you either want or need to hear.

RS232 for iOS device

Is it possible to pair an iDevice to an rs232-bluetooth adapter for the purpose of sending serial commands like it would through an iDevice dock connector to rs232 (just like the Redpark Serial Cable does)? I ask because the company I work for is thinking of having an iDevice control one of our systems for demo. I know it doesn't relate to anything specific but any information would be greatly appreciated.
(See also iPhone to RS-232 via Bluetooth)
Bluetooth modules exists that support MFi (Made For iPhone) such as this one from connectBlue http://www.connectblue.com/products/bluetooth-products/bluetooth-modules/bluetooth-iphone-ios-accessory-module-obs414/ So the standard iPhone Bluetooth stack can make a SPP/RFCOMM connection to that device. That device could be added to a board along with RS232 level-conversion etc... And thus success.
I don't know whether someone sells such a device. The RS232 device that connectBlue sells seems not to support MFi, http://www.connectblue.com/products/bluetooth-products/bluetooth-devices/bluetooth-rugged-serial-port-adapter-rbs433/
Not really. The GameKit is one way to access bluetooth in iOS, but it is very limited in what that API allows you to do.
Depending on what you are building, you might be able to use the Apple Made for iPod program, but it's probably a long shot.
http://developer.apple.com/programs/mfi/
The best way to go is probably to design a device that connects via WiFi. I've gone this route, and it worked out well. If you must interface with something with an RS-232 interface, you might design an intermediary "adapter" that connects via WiFi to the iOS device, and via RS-232 to the other device.
If you don't have a need to distribute your app via the App Store, you can use Redpark's iOS serial cable: http://redpark.com/c2db9.html. (Disclaimer, I've never tried one, but according to someone at Redpark, jailbreaking is not required, you just can't distribute your app on the app store.)
You could design a small dongle that attaches via the dock connector, and broadcasts over bluetooth to your other device.
Or you could use WiFi instead of bluetooth... perhaps communicating over WiFi to something that's physically plugged into whatever you want to control.
I worked on a jailbroken app which used BTStack to communicate with a serial device. You might be able to use this for your demo.
If you're still looking to use bluetooth, this helped me out alot to facilitate the standard serial connection for prototyping without jailbreaking:
http://www.seeedstudio.com/depot/bleshield-based-on-bluegigas-ble112-module-p-1367.html
It works on the Bluetooth 4.0 enabled iOS devices and all of the schematic, boardfiles, firmware sources and the iOS App sources are available here:
https://github.com/michaelkroll/BLE-Shield

Resources