10 Replies
      Latest reply on Mar 22, 2017 8:46 AM by KMT
      tyuio Level 1 Level 1 (0 points)

        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

        • Re: WiFi connection from app
          KMT Level 9 Level 9 (14,865 points)

          >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.

          • Re: WiFi connection from app
            junkpile Level 6 Level 6 (2,475 points)

            > 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?

              • Re: WiFi connection from app
                tyuio Level 1 Level 1 (0 points)

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

                  • Re: WiFi connection from app
                    junkpile Level 6 Level 6 (2,475 points)

                    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.

                      • Re: WiFi connection from app
                        tyuio Level 1 Level 1 (0 points)

                        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.

                  • Re: WiFi connection from app
                    eskimo Apple Staff Apple Staff (12,125 points)

                    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"

                      • Re: WiFi connection from app
                        tyuio Level 1 Level 1 (0 points)

                        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.