iOS and Wi-Fi Direct

My question is fairly straight forward - can iOS create a Wi-Fi Direct group that can be joined by non-iOS devices?


The only information I can find relating to iOS direct peer connectivity is https://developer.apple.com/library/prerelease/ios/documentation/MultipeerConnectivity/Reference/MultipeerConnectivityFramework/index.html


More specifically, "The Multipeer Connectivity framework provides support for discovering services provided by nearby iOS devices..."


Based on this I would say no, but technically speaking, there should be no limitation for Wi-Fi Direct as it is an open standard, and apps like AirDrop already use it.

My question is fairly straight forward - can iOS create a Wi-Fi Direct group that can be joined by non-iOS devices?

No. The peer-to-peer Wi-Fi implemented by iOS (and recent versions of OS X) is not compatible with Wi-Fi Direct.

Note Just as an aside, you can access peer-to-peer Wi-Fi without using Multipeer Connectivity. The underlying technology is Bonjour + TCP/IP, and you can access that directly from your app. The WiTap sample code shows how.

Based on this I would say no, but technically speaking, there should be no limitation for Wi-Fi Direct as [...] apps like AirDrop already use it.

AirDrop does not use Wi-Fi Direct, but rather the Bonjour + TCP based peer-to-peer Wi-Fi discussed above.

Share and Enjoy

Quinn "The Eskimo!"
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

"AirDrop does not use Wi-Fi Direct, but rather the Bonjour + TCP based peer-to-peer Wi-Fi discussed above."


How does it do this when the two devices need not be on the same network? This is the problem we're trying to solve: there's no infrastructure Wi-Fi network. Our peripheral can host a network, but we'd like to avoid making the user leave our app to go to Settings to connect to our peripheral.


It seems the WiTap sample code requires all instances to be on the same network already, is that correct?

How does it do this when the two devices need not be on the same network?

Via an Apple-specific (not Wi-Fi Direct) peer-to-peer Wi-Fi protocol.

It seems the WiTap sample code requires all instances to be on the same network already, is that correct?

No. Although don’t take my word for it, try it yourself:

  1. grab two iOS devices

    Note the only requirement is that they each must be new enough to have a Lightning connector. Peer-to-peer Wi-Fi support is not tied to the Lightning connector, it's just a helpful coincidence that the hardware that supports peer-to-peer Wi-Fi also happens to have a Lightning connector and thus it's an easy way to identify that support.

  2. on each, forget the infrastructure Wi-Fi network

  3. on each, disable Bluetooth (which implements a different form of Apple-specific, Bonjour + TCP/IP peer-to-peer networking)

  4. on each, run WiTap and start a ‘game’

This is the problem we're trying to solve: there's no infrastructure Wi-Fi network. Our peripheral can host a network, but we'd like to avoid making the user leave our app to go to Settings to connect to our peripheral.

Ah, this is the first mention of non-Apple hardware in this thread. The situation with non-Apple hardware is more challenging because the peer-to-peer networking protocols (both Wi-Fi and Bluetooth) are not documented for third-party use.

Your options:

In a typical home accessory setup you want the accessory to join the same infrastructure Wi-Fi as all the other devices in the home. Apple explicitly supports this via the Wireless Accessory Configuration (WAC) mechanism. This lets an iOS device pass its Wi-Fi configuration to the accessory so that the accessory can join the same Wi-Fi network as the iOS device is currently on.

You can learn more about this in WWDC 2014 Session 701 "Designing Accessories for iOS and OS X".

https://developer.apple.com/videos/

WAC is part of MFi.

  • HomeKit accessories, also created under the aegis of MFi, have their own set of capabilities. Let me know if you’re interested in that angle.

  • Most other ad hoc and peer-to-peer Wi-Fi scenarios do not have good solutions. You can generally make things work, but it tends to be a manual process.

Share and Enjoy

Quinn "The Eskimo!"
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

Is there (or will there be) support for "ad-hoc" Airplay (audio) today? (i.e like the AppleTV guest mode)

Hi Eskimo,


I tried to use wi-fi direct with Wi-Tap as you outlined in your previous message but have discovered a problem with it. After about 1 minute of no tapping on either device, taps are no longer being received. If you keep tapping every second or so there is no problem and the data continues to be sent and received, however once you stop this repeated tapping the problem occurs after about 5 seconds.


We see the exact same issue with our own peer to peer product after we updated it to use wi-fi direct. After about 45 seconds of no activity (ie no transmission of any data from either device), data is no longer being received. If we send a "keep-alive" packet every second it works continously. If we change the keep-alive delay to 5 seconds it fails. There are no errors returned from the NSStream write method or via the NSStream handleEvent: callback in either Wi-Tap or our app.


Am I missing something? I am about to file a bug report.


Thanks

HI,


This thread is very interesting!


In my case, I'm developping a device that I would like to connect to very easily without any infrastructure. At the beggining I though of Bluetooth but the speed of the connection isn't high enough. So I though of Wifi Direct (P2P). With Android it's possible but I would like to control my device also with iOS !


What I understand from the answer of Eskimo is that it's not possible ?

"The situation with non-Apple hardware is more challenging because the peer-to-peer networking protocols (both Wi-Fi and Bluetooth) are not documented for third-party use."


Is there any solution ?


Thanks a lot for your documented answers !


Marc

What I understand from the answer of Eskimo is that it's not possible ?

Things haven’t changed since I posted that.

If your accessory is built under the aegis of MFi, you can get pretty reasonable speeds out of classic Bluetooth. If not, Bluetooth LE is the only option, and you’re correct in saying that it’s quite slow.

Share and Enjoy

Quinn "The Eskimo!"
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

DTS will close for the winter holidays at the end of business on Wed, 23 Dec 2015 and re-open on Mon, 4 Jan 2016.

Thank you for your prompt answer!

The other problem with Bluetooth is the range which is very short... Wifi Direct could solve this !

Marc

Thanks for the information.


My problem with Multipeer is WiFi file transfer is slow .

I get only 16 mega bits per second on iPhone 6S and 7mbps on iPhone 5.

(AC and N Wifi theoretical limits are 1300 and 450 mbps)


Would the Bonjour + TCP method be faster than Multipeer?

My problem with Multipeer is WiFi file transfer is slow .

There’s two potential issues here:

  • Peer-to-peer Wi-Fi has to jump through lots of hoops to work at all, and that slows things down.

  • Multipeer Connectivity was tuned for latency, not bandwidth.

Would the Bonjour + TCP method be faster than Multipeer?

My guess is that it won’t help a lot, but I recommend that you avoid guessing and simply test it yourself. Creating a simple Bonjour + TCP performance test is a relatively small task, and it’ll definitively answer this question.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

we are in the same boat: non apple hardware box under linux wants to talk to iOS over a peer to peer wifi link similar to how WiTap is doing it, without using inftrastructure wifi or converting either the box or the iOS device into a hotspot. bluetooth is not available in our box. is it possible these days (early 2017)?

Mike

is it possible these days (early 2017)?

Nothing has changed in the peer-to-peer networking space, other than the fact that I’ve documented the current state of affairs in QA1942 iOS Wi-Fi Management APIs.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

Thanks for the explanation. Can you point me to a document that gives the API on how to stream video from a MFI certified non-Apple device to an iOS device? None of the BT profiles listed in section 2.2 of https://developer.apple.com/hardwaredrivers/BluetoothDesignGuidelines.pdfseem to support video streaming or anything close to the 24Mbps classic BT max data rate (is there a special profile to get higher data rate)?https://developer.apple.com/hardwaredrivers/BluetoothDesignGuidelines.pdf


Also, the accessory service types listed in the HomeKit spec don't mention a video camera accessory (https://developer.apple.com/reference/homekit/hmservice/accessory_service_types?language=objc)

Can you point me to a document that gives the API on how to stream video from a MFI certified non-Apple device to an iOS device?

The general API for talking to MFi devices is the ExternalAccessory framework. It’s possible that MFi might have easier integration points for video accessories but I can’t speak to that; other folks here in DTS support MFi accessory development.

If you want a definitive answer here, you should open an MFi tech support incident.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

Thanks, also can you comment on the HomeKit accessory type not mentioning a video camera accessory type. Per WWDC 2016 talk it appears that getting a video stream from HomeKit accessory is supported. Any sample code or pointer to details on how it is done will be useful. Will also file the ticket on MFI.

iOS and Wi-Fi Direct
 
 
Q