Configuring a WiFi device with/without WAC?

4 years ago, a fellow developer asked this same question:

Is it possible to configure WiFi device without WAC feature?

...and I find myself in a similar situation without much more information, 4 years on.

All I want to do is improve the user experience of configuring our device simply to connect to the "home WiFi" network. Is there any way to do that besides the process described here?

Is it still really necessary to apply for the Apple MFi program to do this one simple operation?

Thanks.


To configure an Accessory to join the same network as an iOS device without WAC, you could use the following steps:

1) Before you begin you will need a temporary way to communicate with your Accessory. One way this can be done is via an ad hoc Wi-Fi network that your Accessory broadcasts.

2) Next, you will need a way to expose this ad hoc network information to your iOS app. This can be done through a QR or other means. Information that would be supplied in the QR code would be adhoc network SSID, passphrase, listening port, and other connection scheme information.

3) Launch your iOS app and scan the QR that your Accessory provides. In your iOS app decode the QR code information and save it.

4) In the iOS app use either CNCopyCurrentNetworkInfo on iOS 13, or NEHotspotNetwork.fetchCurrent on iOS 14 to get the currently associated SSID of your iOS device.

5) Using the QR code information in step 3, and ensuring the your Accessory is broadcasting an adhoc Wi-Fi network, use NEHotspotConfiguration API to create a network configuration for this ad hoc network and apply it for your iOS device to join this network.

6) Once the iOS device has associated with the Accessory network, confirm the association with CNCopyCurrentNetworkInfo or NEHotspotNetwork.fetchCurrent again.

7) On the Accessory, start a listener for the port that was passed to the iOS app via the QR code.

8) On the iOS app enter the passphrase for the previously associated SSID network that was gathered in step 4. Save it.

8) On the iOS app create a connection, could be a WebSocket connection, to the port that the QR instructed you to use that will connect to the listener on the Accessory.

9) Send a WebSocket message to the Accessory with the SSID and passphrase for the network that the iOS device was previously associated with in step 4.

10) On the iOS app remove the NEHotspotConfiguration association with the Accessory and go back to the previous network from step 4.

11) On the Accessory, use the network information passed in from your iOS app to configure the Accessory to join the same Wi-Fi network as the iOS device.

12) Now that the two devices are on the same network, they should be able to communicate with further communication techniques like Bonjour.


Matt Eaton
DTS Engineering, CoreOS
meaton3@apple.com
Configuring a WiFi device with/without WAC?
 
 
Q