Diagnosing an intermittent WiFi connection with particular characteristics
I have a new 2020 iMac. It connects to the office WiFi and Ethernet just fine. Despite many hours of effort, I cannot get it to connect to a particular WiFi access point for more than 6 seconds.
The Access Point:
- Created by a WL1835MOD (supports 802.11b/g/n), put in access point mode by wpa_supplicant on Debian.
- Runs a DHCP server using dnsmasq, with IP address 192.168.4.1, and successfully serves 192.168.4.239 to the iMac (and other IP addresses to other clients).
- Also has a cellular internet connection, and may or may not share it with clients on WiFi, with no change in symptoms.
- Variations to SSID, country and frequency (channel) cause no change in symptoms.
- Various arrangements of antenna and relative location cause no change in symptoms.
- Is 100% reliable when connected to from any other device I can find (MacBook Pro, iPhone, iPad).
The iMac:
- Is a plain fresh factory build, with interface en1 being an Airport Extreme running wl0 version 9.30.357.41.32.5.49.
- Otherwise has no noticeable network issues, including via Ethernet and when connecting to other WiFi networks.
The symptoms:
- The SSID sometimes takes a while to appear in the list in System Preferences or the Wi-Fi drop-down. Sometimes WiFi has to be turned off and back on for it to appear.
- When it does, it can be selected, the password entered, and the connection is "connected" and seems fully operational.
- Between 2 and 6 seconds later, the status changes to "On" (not connected to a network)) and the sheet appears stating that either the Wi-Fi network could not be joined or requires a WPA2 password.
- The SSID disappears from the list, but once it reappears the cycle can be repeated.
- Sometimes the "could not be joined" sheet doesn't appear until the cycle has repeated a few times automatically.
What I've tried:
- Deleting the contents of /Library/Preferences/SystemConfiguration (except com.apple.Boot.plist), emptying the trash and rebooting.
- Resetting the PRAM.
- Rebooting with shift held down.
- Removing all the known WiFi networks in System Preferences.
- Deleting all the relevant entries in Keychain Access.
- Making changes to the access point as mentioned above.
- Creating a Location, waiting 30 seconds, using the Location, deleting the Location, going back to Automatic.
- Turning Wi-Fi off and then on again.
- Poured through tons of logs looking for anything useful.
What I've seen:
- When the iMac does connect it reports the network as WPA/WPA2 Personal, Channel 11 (2.4GHz, 20MHz), County Code AU, RSSI -72dBm, Noise -91 dBm, Tx Rate 13Mbps, 802.11n, MCS Index 6, NSS 1.
- The access point logs an "AP-STA-CONNECTED" with the matching MAC address as well as "HT: Forty MHz Intolerant is set by STA in Association Request".
- While the network is connected I can happily SSH to the device and use it. The SSH session even sometimes survives through the periodic disconnects.
- If I turn on wifi debugging, I get a lot of entries, including:
- "Info: <airportd[291]> <en1> Failed to associate to Wi-Fi network The_SSID, returned error code -3902, no more attempts", and
- "Info: <airportd[291]> <en1> Failed to associate to Wi-Fi network The_SSID, returned error code 5, no more attempts", even though earlier it says
"Assoc: <airportd[291]> Will associate to [ssid=The_SSID, bssid=d8:a9:8b:c3:03:37, channel=(channel=11, width=20), ibss=no, cc=(null), rssi=-64, rsn=(mcast=tkip, ucast={ aes_ccm tkip }, auths={ psk }, caps=0xc), wpa=(mcast=tkip, ucast={ ccmp tkip }, auths={ psk }), wep=no]
As far as I can tell, the iMac simply "gives up" on the connection, even though it is established.
What can I do to get to the bottom of it?
iMac Line (2012 and Later)