Accessory Setup Kit - Set WIFI SSID to ASAccessory after initial setup

I have an accessory which uses both Bluetooth and WiFi to communicate with the app. I am trying to migrate to Accessory Setup Kit.

However, the API expects both the bluetooth identifiers and WIFI SSID or SSID prefix in the ASDiscoveryDescriptor. The problem is we only have the WIFI SSID after BLE pairing.

Our current flow looks like this:

    1. Pair via BLE
    1. Connect via BLE
    1. Send a BLE command to request WIFI settings (SSID and password) (Each device has a different SSID and password)
    1. Connect to WI-FI hotspot by calling NEHotspotConfigurationManager applyConfiguration with the retrieved credentials.

Is there a way to set the Wi-Fi SSID of an ASAccessory object after the initial setup?

To use Accessory Setup Kit we would need something like this:

    1. Call Accessory Setup Kit with bluetooth identifiers in the descriptor, finish the setup and get ASAccessory object.
    1. Connect via BLE
    1. Send a BLE command to request WIFI settings (SSID and password)
    1. Set the SSID of the ASAccessory to the retrieved value.
    1. Connect to WI-FI hotspot by calling `NEHotspotConfigurationManager joinAccessoryHotspot.

Thanks!

I tried using this method:

open func finishAuthorization(for accessory: ASAccessory, settings: ASAccessorySettings) async throws

I pass the ASAccessory and a ASAccessorySettings instance with the target SSID.

It completes without throwing an error, however the SSID property of the ASAccessory never gets updated. Once I call NEHotspotConfigurationManager joinAccessoryHotspot it fails with Code=1 "invalid SSID."

I am facing the same issue. I am commenting to raise more awareness on this, it would be a big upside to update the ssid after the initial setup.

Is there a way to set the Wi-Fi SSID of an ASAccessory object after the initial setup?

No. The issue here is that the system doesn't actually have any way to "know" there's a relationship between your Bluetooth configuration and your Wi-Fi configuration. You can set up ASDiscoveryDescriptor to cover both transports, but that does mean you need to at least provide a prefix for your SSID. Allowing what you're describing would mean that an initial Bluetooth pairing could then be used to pair with "any" Wi-Fi network without the user’s awareness or consent.

If you don't have any information about your Wi-Fi target, then you will need to use a two-stage process where you:

  1. Use ASK to pair over BLE and retrieve the SSID and password data.

  2. Use ASK to pair using that SSID and password.

Note that you might be able to use ASMigrationDisplayItem for the second stage, which might provide a smoother interface flow compared to performing the full ASK sequence twice.

__
Kevin Elliott
DTS Engineer, CoreOS/Hardware

Accessory Setup Kit - Set WIFI SSID to ASAccessory after initial setup
 
 
Q