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.
Related
I'm most likely not using the correct terminology in my question.
Is it somehow possible for an iphone to receive an "audio stream" from other iPhones over Bluetooth?
The idea is to make an app that makes it possible to listen to the music libraries of other iPhones in the Bluetooth range. All while not having access to the internet and not needing to pair up and transfer the actual song onto the phone.
The thing you ask of is doable, but is not something trivial. Bluetooth communication can be implemented to work like a TCP/IP socket implementation, the only problem is, there is no actual protocol to follow. Usually the apps that implement bluetooth communication use they own protocols definitions in order to serve the purpose of the app.
There are several steps that have to take in consideration:
The transfer speed over bluetooth, it's not fast but it's not slow either, the main problem with the transfer over bluetooth is that you have to implement the data transfer, for example in TCP/IP the whole package exchange (send/acknowledge/receive) is done by the system, there's no general protocol implementation to do such thing using bluetooth.
The connection handling, this is something really tricky depending on OS & OS version, especially on iOS the connect/disconnect handling is clumsy & often buggy.
Security, without pairing and bonding there's no security. Even with pairing & bonding the security is flacky. Without security you might get your app hammered down and bricked by a simple bluetooth sniffer.
Other apps that use bluetooth, for IoT or other gadgets this is not an actual problem, but when you have a client/server like approach via bluetooth using two mobile phone you might get in trouble because of other apps that wrongly use the bluetooth (don't close connections, try to scan to frequently) and you can't do anything about it.
These are the things that cross trough my mind about the bluetooth communication, I've worked on several apps that connect to IoT and I can tell you it's not something trivial to implement. You get a lot of headache for things that you can't imagine.
As an alternative you could use WI-FI without internet connection, there was a trending post some time ago about Mesh Networks that use only the WIFI signal to transmit data, not even actual wifi network, worth checking out IMO.
I have a device that can be communicated with over LTE with the same functionality as you normally get through BLE.
However, I'm having a hard time understanding how you communicate with, and get callbacks from an LTE device in the same way you do with BLE.
It doesn't seem that there is a library like CoreLTE but is there a standard way to use LTE like we use BLE (CoreBLE)?
In other words, how does one do essentially something line:
func lteCentralManager(lteCentral:LTECentralManager, didDiscoverPeripheral ltePeripheral:LTEPeripheral,
...
lteManager.connectPeripheral(ltePeripheral, options:nil)
...
NOTE: I realize that the technologies are different. The above is only meant to make the point of what I'm trying to do - not imply that the calls would be the same.
If there is no standard way to do this, does anyone know a good place to start figuring it out with iOS? I've read the standards. I'm just looking for how to use it now in iOS.
Thanks for the help.
iOS does not offer APIs to interact with the LTE modem directly, so this is impossible - not to mention, even if the hardware and software was capable of it, why would the scammercarrier allow you to talk to nearby devices directly instead of going through their network where they would charge you for that bandwidth?
If you need short-range communication between iOS and Mac devices you might want to take a look at Multipeer Connectivity. Firechat uses it successfully to enable off-network chat between nearby devices.
I am trying to set one pin of the old iPhone 30-Pin Connect from low to high so the best would be from 0V to 3,3V. Is that possible with a simple PodBreakout board like this?
https://www.sparkfun.com/products/8295
If not can you send a constant voltage out of the iPhones audio jack (This could be a good method too, cause now apple used its 9-Pin Lightning Connector).
I already searched the web, some say you have to jailbreak your iDevice, some say you need an authentication Chip, and some say it works flawlessly without an authentication chip, but I cant find any help online.
Thanks
You can't "send a constant voltage" out of the audio jack. There is a series capacitor there that filters out DC and very low frequency signal components.
To get proper help on this you can apply for the MFi program. I think it's free for educational purposes. It's under 100$ for sure. There is an NDA involved.
If you want to avoid the MFi you can always use BLE to communicate with periphery.
Or try to implement software FSK (or DTMF) modem on one side and a hardware one on the other side (using the audio lines).
Since it seems you simply want so see a binary (on/off) signal - you could generate a fixed pitch tone in the app (2kHz for example) and use a narrow-band filter on the hardware side (audio-jack connection).
Or maybe (to make sure your app is present on the other side a 2kHz tone would mean 0 and a 4kHz tone could stand for 1.
The authentication chip (and an MFi license)) you are talking about is needed when you try to communicate with the iOs device:
via BT (excluding BLE)
via USB (30 pin connector or lighting connector)
via UART (30 pin connector or lighting connector)
I'm developing a custom electronic device - think of it as a special kind of data logger, and I need to connect a computer to it to configure it and to extract the data.
I know I can do this without too much trouble on a PC, but I'd like to use an iOS device to do this.
Two questions:
Can I do this with a regular dock connector / USB cable? Will the EA framework let me do all the communicating?
Once I have extracted the data, what's the best way to get that out of the iPad? Make an email with it, save to a dropbox or something?
Thanks!
Afaik, you need to join the MFi program to make USB accessories for iPad/iPhone. That will give you all the technical resources needed.
As for data transfer there are only "opinions", I say the more options of sending, the better. Just don't force the user to choose more than once, then make it changeable in settings.
If you're doing very light communication, you might be able to get away with using the headphone jack.
Apps communicate to the headphone port through the various audio frameworks on iOS. AVFoundation is a high-level abstract framework to do various audio operations, but for fine-tuning the communication to a device over this interface, you will likely be using the C-language callback-based Audio Queue Services framework to do audio I/O.
This is nice because your device can be cross-platform (iOS, Android, Mac/PC) as long as you write the corresponding software, and because you don't need to go through Apple's MFi approval program. Think like the Square credit card scanner.
You will have to write the communication stack between the device and your iOS device but yes, you can.
there's very few docs about using the EA.framework. All the juicy parts are in the Mfi program but Apple is very strict about giving access to it.
So if you succeed, sharing a tuto will make you a EA hero ;)
About sharing your data, imho, email + CSV is a winning combo.
If you want to plug something into the dock connector, you want to have a look at https://developer.apple.com/programs/mfi/
I've just started working at a biomedical company and we need to communicate data from a device we are making to an iPhone. Obviously using the made for iPhone program would suffice, but for prototyping and for a simpler solution I was wondering if we could use an existing bluetooth audio transmitter, such as (http://www.buy.com/prod/bluetooth-a2dp-audio-hifi-dongle-adapter-transmitter-for-iphone-3g-ipod/q/loc/111/211900047.html?adid=17662) but instead of streaming audio, program it to stream data. I'm not so good with the hardware side, and wouldn't be designing the hardware on our end, only the software, so just wondering if with the current SDK, we can send data through an audio streaming device?
Any help is greatly appreciated :)
I've been looking into it, and found FSK a suitable solution.
I have a few links you could check out (most involve the Arduino, but you can ignore that).
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1274970878 (blog post on arduino forums that is helpful)
http://translate.google.com/translate?hl=en&sl=ja&tl=en&u=http%3A%2F%2Fjp.blog.reinforce-lab.com%2F (japanese description of FSK from iPhone to Arduino)
http://code.google.com/p/arms22/downloads/list (software libraries)
http://sree.cc/electronics/arduino-as-an-fsk-modem
http://www.perceptdev.com/labs/iphonehacks (old iphone hack that creates a FSK modem with the iPhone)
http://www.progical.com/ (company that sells such dongles, but wouldn't reply to me)
http://eecs.umich.edu/%7Eprabal/projects/hijack/ (awesome project)
If you really want a realiable solution, look into serial data (jailbreaking might be required, but awesome for prototyping):
http://www.ohscope.com/2009/02/24/serial-port-on-iphone-with-minicom/
http://hcgilje.wordpress.com/2010/02/15/iphone-serial-communication/
UPDATE:
Thinking outside of the box, if you want a really reliable solution; I bought this recently.
http://redpark.com/c2db9.html