inconsistent connection to an IoT device's access point error -3936 and failed forced association

We have an app that connects to an IoT device to configure it; we're connecting to an access point and we have inconsistent results with the iOS solution (we're using MAUI for both iOS and Android); the Android experience is consistently successful. We've narrowed the error in the logs to the following section - and the question is what do the error values mean? We can't quite figure out what is happening or why. Our guess is the SSID of the target network is getting set to null at some point, but that is only a guess. We've found only a couple of other similar issues at these posts, but no solution that is apparent https://developer.apple.com/forums/thread/690602 https://developer.apple.com/forums/thread/665011 https://developer.apple.com/forums/thread/665324

Can you see what we're missing? Here is the log section we believe is the critical point and is what shows an error when there is a failure to connect:

09/25/2023 15:32:03.403 __WiFiDeviceManagerEvaluateAPEnvironment: no known BSS for this network. Learning environment. 
09/25/2023 15:32:03.405 WiFiNetworkSetProperty: null network 
09/25/2023 15:32:03.405 __WiFiDeviceManagerReleaseWakeAssertionForAutoJoin: PM assertion not held. 
09/25/2023 15:32:03.405 __WiFiDeviceManagerUserForcedAssociationCallback: error -3936 reqInfo (null) 
09/25/2023 15:32:03.406 __WiFiDeviceManagerUserForcedAssociationCallback: enabling device manager 
09/25/2023 15:32:03.406 WiFiBatteryMgmt : -[WiFiBatteryManager requestPowerResource::]: Power resource request for AutoJoin added. Pending=1. 
09/25/2023 15:32:03.406 -[WiFiBatteryManager isPowerResourceAvailable:]: WiFiBatteryMgmt : resource is unavailable for type AutoJoin. claimedResource is 0 
09/25/2023 15:32:03.407 __WiFiDeviceManagerUserForcedAssociationCallback: failed forced association 
09/25/2023 15:32:03.407 __WiFiDeviceManagerDispatchUserForcedAssociationCallback: result 2 
09/25/2023 15:32:03.410 __WiFiDeviceManagerForcedAssociationCallback: failed to association error 2 
09/25/2023 15:32:03.410 __GetNetworkWithSameSsid: network (null) not found 
09/25/2023 15:32:03.410 __WiFiDeviceManagerForcedAssociationCallback: removing password for (null) 
09/25/2023 15:32:03.410 WiFiSecurityRemovePassword: Removing password for (null) 
09/25/2023 15:32:03.411 __WiFiSecurityRemovePassword: null account 
09/25/2023 15:32:03.411 WiFiLocalizationGetLocalizedString: lang='English' key='WIFI_JOIN_NETWORK_FAILURE_TITLE' value='Unable to join the network
“%@”' 
09/25/2023 15:32:03.412 WiFiLocalizationGetLocalizedString: lang='English' key='WIFI_FAILURE_OK' value='OK' 

The specific error you’re seeing, -3936, is private but it’s roughly equivalent to ‘BSS not found’.

Note BSS is a Wi-Fi term; see Wi-Fi Fundamentals.

As to what’s going on here, you’ll need to investigate that at the Wi-Fi level. On the very rare occasions that I dig into stuff like this, I use a Wi-Fi level packet trace. However, it’s possible that your accessory has better tracing facilities.

ps DTS doesn’t offer official support for debugging problems like this. If your Wi-Fi level investigation suggestions that iOS is the root cause of this problem, you should file a bug about that. Make sure to follow the Wi-Fi for iOS instructions on Bug Reporting > Profiles and Logs.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

We discovered one setting that stabilized our connection quite a bit; it doesn't solve this exact problem, but reduces the occurrences by 80%; We had changed the value of "JoinOnce" from False to True because we thought that was the right thing to do with a wifi connection we wanted to use temporarily when setting up an IoT device; however, that appears to be the problem and when we changed that back to FALSE we started to successfully connect 85-90% of the time with the forced association.

We are still working on the operating system error that happens and the user is shown an OS-level message of 'unable to connect' when initiating the wifi association; we know this is partially incorrect, because if we click OK on the message and then manually click the target wifi (which will show in the 'My Networks' at this point), the phone will successfully connect and the app will be able to continue successfully. We'll post here if we find a way to catch that OS event and work around it.

inconsistent connection to an IoT device's access point error -3936 and failed forced association
 
 
Q