Establish communication link between a device and iOS - iphone

I'm developing an iPhone/iPad app that requires it communicate with another device. I'm actually more interested in receiving input from another device that the iPhone is connected to through USB. The solution needs to work with any iOS device and cannot require it to be jailbroken.
I've heard of apps that communicate with a piece of hardware that can be plugged to the iOS' serial connection, which is similar to what I'm going to develop except that the other device I'll be connecting to is a standalone music keyboard.
best regards,
fbr

If you are developing accessories that need to connect to iOS devices and want to use your own communication mechanism then you need to join the Apple MFi program.

Several options:
Forget MFi unless you have 1000s of $ backing up your product development. Apple won't even talk to you. I've tried.
Take a look at the Serial Cable from Redpark (http://redpark.com/c2db9.html)
I've got one of those and it's ideal for apps that you can deliver on your own, but you might also be able to get them into the App Store.
Another option is to use Wifi with a Wifi-to-Serial adapter on the other end. I've used the RN-174 and RN-134 from Roving Networks successfully.
However, these solutions only get you Serial connections, but can be quite fast, especially with the RN modules. There are also Serial-to-USB converters you can use on the device's end, but that would require the device to work as a USB host, usually. If you have a USB device that wants to act as a client, these common adapters won't do the trick.
So, unless you can actually afford the MFi program, and if you really need USB connectivity, you'll have to let someone create a small box containing a USB host adapter with a Wifi chip. I don't know of a ready-made solution for this yet, although I've seen quite a few area where people would like to have such a unit.

Related

Is it possible to create a iPhone / iPad usb video input cable

Is it feasibly (by feasible, I mean would apple allow) To create a piece of hardware that would allow the USB cable to act as a video input. I have not been able to find anything like this on the market. I know that it's possible to stream video through WIFI locally, but from what I have read it's quite laggy. I also know that in order to create hardware you need a MFi membership, but I'm note even sure if apple would allow this sort of functionality.
Technically, yes it is possible, but in this case for Apple iPhone and iPad is not. USB protocol has a master/slave architecture, for example a Windows PC is the host, while the USB device is the slave. When the USB device is plugged in, the host is informed about the capabilities of the device through the USB descriptor, later the host will request/send abstract USB packets that may be audio, video, files, whatever.
In your case, for iPhone and iPad the host feature is disabled, they may be only clients for other hosts - a PC for instance. It's a marketing decision, because people would be able to buy cheap external storage, instead of more expensive devices or cloud storage. As a consequence your video streaming device which would be a client will not work.
There are two workarounds: one would be to crack Apple iPhone, iPad software, so you cannot build a business on top of it. The second one, would be that your USB video cable to be smart enough (through an embedded controller) to act as a host with the iPhone, iPad, and would a second software on the Apple device to talk with your hardware. It's not so easy, but maybe it worth the effort, who knows...
I know it is the old thread but my answer can be usefull for someone to make further investigation...eventually to provide some schematic, etc. Definitely IT IS POSSIBLE and I have already tried it. The DJI Lightbridge device used mainly for the UAV cameras and video transmission has an USB port and their own aplication for Android/iOS (iPhone) that can transmit the video and to view/record pictures from camera on tablets or phones. The phone acts as FPV monitor in that case. I have used it with the Android tablet and also with the iPhone 5s and it works great!

Create an iPad app that can send/receive data via the USB cable?

I want to create an iPad app that connects to another machine, laptop or otherwise, via USB and communicates to some other application I develop running there.
I know that this is easy to achieve via Bluetooth or WiFi but this particular set of solutions must be done via a USB cable.
Is it possible to do so without access to the Apple MFi program? (I am about 5 weeks in and the response is not looking good).
iOS App --> USB Cable --> Mac OSX --> Desktop App (without MFi access)
Thanks
To use USB communication Apple does not provide any API within IOS SDK. The only option right now is MFI. I don't think Apple will allow this in near future.
To use serial communication, you need MFI as you may have discovered. However, there is a poor man's way of achieving this. I have done so during development.
Enable "Internet sharing" on your device and connect to it. Use "ifconfig" on your Mac to find out the interface to use. You do not need to use this as the default connection, but it needs to be active. If I remember correctly, only one end can initiate connections (it was a while so I am sorry that I don't remember the details).
EDIT: I would also like to point out that I did this on an iPhone, not an iPad.
Not over USB but over RS232 (serial port)
Look here: http://www.redpark.com/c2db9.html
But:
The cable uses the old 30 pin connector, but according to them it's compatible with the Lightning adapter
The application won't be accepted on the AppStore, it's for internal use only.
There is a (small) book that explains how to use this cable to connect an iPhone directly to an Arduino, it's been published in late 2011. "iOS Sensor Apps with Arduino Wiring the iPhone and iPad into the Internet of Things" http://shop.oreilly.com/product/0636920021179.do

Listening on USB port for data in iPhone App

I am wanting to send data over the usb on the iphone and have it captured by my application. This application will be private and not sold. I would also like to just use the standard usb cable that is standard. Is this possible?
This is possible with Apple's MFI Program. The downside is this will probably be quite expensive and you will of course have to develop a piece of hardware that can be sold as a product for your application.
EDIT: If you look at the 'iOS Accessories' section on the MFI Program link above, it suggests that you can communicate over the 30-pin usb dock connector.

Is it possible, in principle, for an Android device to interface with an iPhone over Bluetooth/GameKit?

(I am not interested in pure theory, but as a practical near or mid-term possibility, say within 12-24 months.)
As a developer familiar with (but not specializing in) two major smartphone platforms, should I expect an Android library to come out which can spoof itself onto an iPhone app's GameKit-based network. It seems reasonable that a Bluetooth interface between platforms might square the opportunity to make useful applications, in the same way that modems benefited PC/Mac platforms via Metcalfe's Law.
I am looking for one of two answers:
Is this obviously not likely (e.g. because of encryption)? If so, what is the reason? Is it possible in principle, but requiring years of reverse-engineering (like SMB/CIFS/Samba)? Or is it a no-brainer and just a matter of time? Please give evidence supporting your reason.
Is there an alternative way to have direct peer-to-peer networking besides GameKit? For example, a hand-rolled network using Bluetooth or ad-hoc WiFi? It would be nice to spoof an Android device into an existing iPhone app but my main question is, can the devices speak with each other at all!
Yes, it is possible. GameKit is a protocol using TCP and/or UDP over a BNEP Bluetooth connection. It also uses a trick to identify other iOS devices using the Extended Inquiry mechanism in Bluetooth 2.1+.
I was able to simulate the EIR responses, now, someone needs to reverse engineer the GameKit protocol. This doesn't need Bluetooth, as it is also used for GameKit connections over WLAN.
If anybody can re-implment GameKit for WLAN connections, I can finish the Bluetooth version.
No, and it wont come soon or even at all... Apple pride themselves with their security features, and bluetooth connections can access private data. There will probably not be any cross platform bluetooth framework until something is agreed upon by both companies.
Bump as said by a previous answerer uses a remote server, and the data transferred is not via BT.
GameKit is Bonjour so a Bonjour (which is on IP) over Bluetooth on Android should work.
That should be possible as Bluetooth is capable of setting up tcp/ip networks. Though I have no knowledge of the IPhone SDK whatsoever, but Android does have a BluetoothSocket and BluetoothServerSocket for TCP connections.
This article, http://blog.moritzhaarmann.de/blog/2014/04/27/sorry-state-of-p2p/ written in 2014, suggest it is possible via Bluetooth LE. Available in Android 4.3+ and iOS6+
Two issues:
According to the Android Dashboard only around 30 percent of Android devices support Bluetooth LE https://developer.android.com/about/dashboards/index.html?utm_source=ausdroid.net
Communication between Android-to-Android must be done using some other method (which is not a big problem) because Android devices cannot act as server for B LE connections.
Bounjour on the iPhone gives you full access to all of the Bluetooth protocols, so you don't have to use GameKit. As for when someone will provide an easy to use iPhone to Android GameKit like framework - hard to tell.
An iPhone can already talk to any other Bluetooth device using Bonjour today.
-t
It is absolutely possible! In fact I am amazed that more people haven't done it!
Theory:
Bluetooth is just a wireless socket that you push data across and it comes across the other side, just like tcp/ip.
Practice:
http://www.techcrunch.com/2009/11/11/bump-goes-cross-platform-with-new-android-app-upgrades-iphone-version-too/
Better yet, Bump is cross-platform, which means that you can bump an Android phone with an iPhone and it should work seamlessly.

How to integrate iPhone with other non iPhone devices using serial port?

Anybody knows how to integrate iPhone with other non-iPhone devices using serial port?
You can't directly. There may be some sort of serial line (i2c) on the dock connecter, but it is not exposed through the SDK, the Made for iPhone/ExternalAccessory.framework stuff is only for USB and BT.
You could conceivably use a WiFi/serial bridge (such things do exist) since you can send whatever you want over a TCP tunnel, but I doubt that is what you want.
Underlying ExternalAccessoryFramework for 30-pin connector it's the real UART handshaking (using Tx, Rx, Gnd, Vcc and some detect pins and no flow control) but not USB. Those pins of USB are only used for iTunes, Xcode and powering. The iOS app does not need to understand UART and only needs to send/receive bytes through NSOutputStream and NSInputStream.
But you need to pay Apple for MFi(Made For iPhone) Program first and buy some confidential IC to enable your accessory to communicate with iOS. They will require you to propose a product plan and expected sales and consider whether they would accept you as a MFi manufacturer.
You can get the info on using the ExternalAccessory framework from apple's developer portal.
You can't get the required serial handshake(?) info without joining the Made for iPhone program. This requires that you are developing a commercial device.
I have tried to get information on this protocol from apple through my university and have thus far failed.
I successfully received serial communication from the Arduino on the iPhone. I made a google doc explaining my process.
https://docs.google.com/document/d/1Yi9_hcw8XSyYNCG2OJT9oHlTG-dC-Dnuc58VIULa81Q/edit