WiFi connection from app

We manufacture custom devices which are controlled by iOS app. Currently all the communication is using BLE but for next generation we want to stream a video from the device (over WiFi). I'm trying to find a way for the user to connect to the device from the app - basically estabilishing WiFi link without user having to go to the Settings, connect to the device AP manually, etc.


Options explored so far:

  • NEHotspotHelper - this looked like it could simplify the process but Apple declined to provide the entitlement for us. In the end I believe there would be some manual action needed from user anyway.
  • Multipeer connectivity - this only works between iOS devices
  • Apple WAC - this would only help if the device was to connect to the same network as the phone but that's not what we need
  • NSNetService (Bonjour + TCP/IP) - too slow, not enough bandwidth for video streaming
  • Third party p2p libraries for connecting directly to the device without access point - currently having look at some of these, haven't found much yet


Is there any way in iOS? We wouldn't mind putting MFi chip inside if it helps but even within MFi docs I couldn't find anything which would help us.


Thanks

Replies

>I'm trying to find a way for the user to connect to the device from the app - basically estabilishing WiFi link without user having to go to the Settings, connect to the device AP manually, etc.


Showstopper, sorry.

> NSNetService (Bonjour + TCP/IP) - too slow, not enough bandwidth for video streaming


Umm, once the handshake is done (the Bonjour part), isn't that exactly the same as any other TCP/IP WiFi connection?

Apple WAC - this would only help if the device was to connect to the same network as the phone but that's not what we need

Can you elaborate on why this doesn’t work for you? Is it that the accessory is not being deployed in an environment where infrastructure Wi-Fi is expected to be available.

If so, you really are kinda stuck on the Wi-Fi front. You can either live with the clunky user experience of having the user manually switch to a Wi-Fi network provided by your device, or not use Wi-Fi.

One option you didn’t mention is Bluetooth (not LE). If you’re an MFi licensee then you can create a classic Bluetooth device and access it via External Accessory framework. While this isn’t as fast as Wi-Fi, it’s a lot faster than Bluetooth LE, and may be fast enough to meet your requirements.

Share and Enjoy

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

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

I believe TCP/IP+Bonjour is just underlying technology but I can only access the data through the NSNetService...

Have you actually tested this and determined that it is slow compared to a direct WiFi connection? The NSNetService object provides you with the raw socket and port.

The device is mainly use outdoors where there is usually no other WiFi network the phone and device could connect to.


With Bluetooth Classic I don't think the speed is high enough and also we are worried about the range - these devices can sometimes be 50m away from the phone.

I've read it elsewhere here on the forum, but then I tried it myself adjusting WiTap app to send 3MB file over and over again in various chunks (over NSStream) and was only able to get about 80kbps out of it. How do I get raw socket from NSNetService? I can only see port...


Otherwise must say that the handshake just works though you can't control how it's done - it might use BT instead of WiFi.

The device is mainly use outdoors where there is usually no other WiFi network the phone and device could connect to.

OK. Alas, we don’t have a really good story for that right now.

Share and Enjoy

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

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

I am curious about AirDrop. It seems that AirDrop requires users to turn on their Wi-Fi and Bluetooth. I guess AirDrop also build on Bonjour. Use Bonjour to discover other devices and use CFSocket to receive stuff.


But AirDrop runs really fast. Does AirDrop use Bonjour for discovering and use other APIs for transferring data? It looks pretty good I guess the bandwidth may be enough for video streaming.

Seen this thread?

https://forums.developer.apple.com/thread/12885