Strange ESP8266 WiFi connection failure with Unifi AP-AC-PRO
Posted: Thu Aug 06, 2020 12:08 pm
I have a total of around 50 ESP8266 based WiFi lights of a few different types, and lots of ESP8266's performing various tasks, every single one with my own firmware based on the Arduino core. All my projects use hardcoded WiFi settings (primary and fallback) so there are no per-device settings to screw up.
Everything has worked great with all access points I've tried.
But, recently, I have now upgraded from various consumer grade access points to Unifi AP-AC-PRO's.
The vast majority of my ESP8266 devices migrated to the new network just fine.
But out of the 10 Zemismart E14 ESP8266 that I have... two out of these ten absolutely refuse to connect to the Unifi APs -- even though they connect to every other access point I have.
They were all purchased at the same time and appear identical.
I've tried with both WPA2 and completely OPEN. The access point is only a meter away. After failing to connect to the Unifi access points, they fall back to my old access points and connect just fine. I probably have close to 100 ESP8266 devices and only these two are failing to connect to the Unifi APs, but connect fine to other APs, and work perfectly fine otherwise!
It's not that I care this much about these two bulbs, but I am building a new house that will have hundreds of WiFi bulbs, and I have a feeling this will come up again, so I would like to get to the bottom of it.
Here are the 10 mac addresses for my 10 zemismart E14 bulbs:
As you can see it's .203 and .204 that cannot connect. .203 has an odd MAC address (OUI 68), but 204 has a similar mac address to 201, 202 and 209 (OUI D8), and they connect just fine!
I tried SSH'ing into my access point and ran tail -f /var/log/messages | grep <mac> and got the following for a SUCCESSFUL connection from D8:BF:C0:C6:76:D6:
..and the following from a FAILED Connection from 68:C6:3A:ED:4E:0E
This was with an open network.
WiFiEventStationModeDisconnected says WIFI_DISCONNECT_REASON_ASSOC_FAIL
This is so strange to me. Why do these two ESP8266's behave differently with the same software? And, why can they connect to other access points but not these ones?
I also tried soft-setting the MAC address of the failing bulb on a NodeMCU, and the NodeMCU connected fine with that mac address.
I've also tried connecting to a different Unifi access point in a different room. Same exact issue -- all other bulbs connect fine to the other Unifi access point, but not these two.
I don't know how to proceed at this point, I've tried all I can think of. Any suggestions? Help would be much appreciated.
///Leif
Everything has worked great with all access points I've tried.
But, recently, I have now upgraded from various consumer grade access points to Unifi AP-AC-PRO's.
The vast majority of my ESP8266 devices migrated to the new network just fine.
But out of the 10 Zemismart E14 ESP8266 that I have... two out of these ten absolutely refuse to connect to the Unifi APs -- even though they connect to every other access point I have.
They were all purchased at the same time and appear identical.
I've tried with both WPA2 and completely OPEN. The access point is only a meter away. After failing to connect to the Unifi access points, they fall back to my old access points and connect just fine. I probably have close to 100 ESP8266 devices and only these two are failing to connect to the Unifi APs, but connect fine to other APs, and work perfectly fine otherwise!
It's not that I care this much about these two bulbs, but I am building a new house that will have hundreds of WiFi bulbs, and I have a feeling this will come up again, so I would like to get to the bottom of it.
Here are the 10 mac addresses for my 10 zemismart E14 bulbs:
Code: Select all
const char * mac[]=
{
"CC:50:E3:DA:35:94", //172.22.21.200
"D8:BF:C0:C6:0E:A6", //172.22.21.201
"D8:BF:C0:C6:76:D6", //172.22.21.202
"68:C6:3A:ED:4E:0E", //172.22.21.203 //can't connect to unifi
"D8:BF:C0:C6:0E:B0", //172.22.21.204 //can't connect to unifi
"CC:50:E3:DA:36:10", //172.22.21.205
"CC:50:E3:DA:42:D0", //172.22.21.206
"CC:50:E3:DA:35:FF", //172.22.21.207
"CC:50:E3:DA:42:4E", //172.22.21.208
"D8:BF:C0:C6:0E:9A", //172.22.21.209
};
As you can see it's .203 and .204 that cannot connect. .203 has an odd MAC address (OUI 68), but 204 has a similar mac address to 201, 202 and 209 (OUI D8), and they connect just fine!
I tried SSH'ing into my access point and ran tail -f /var/log/messages | grep <mac> and got the following for a SUCCESSFUL connection from D8:BF:C0:C6:76:D6:
Code: Select all
Thu Aug 6 21:43:49 2020 user.info : wevent[1906]: wevent.ubnt_custom_event(): EVENT_STA_LEAVE ath3: d8:bf:c0:c6:76:d6 / 1
Thu Aug 6 21:43:49 2020 kern.info kernel: [978556.840457] ieee80211_sta_leave: d8:bf:c0:c6:76:d6
Thu Aug 6 21:43:49 2020 kern.info kernel: [978556.844340] ieee80211_sta_leave: d8:bf:c0:c6:76:d6
Thu Aug 6 21:43:49 2020 daemon.info hostapd: ath3: STA d8:bf:c0:c6:76:d6 IEEE 802.11: sta_stats
Thu Aug 6 21:43:49 2020 daemon.info hostapd: ath3: STA d8:bf:c0:c6:76:d6 IEEE 802.11: disassociated
Thu Aug 6 21:43:49 2020 daemon.info hostapd: ath3: STA 96:83:c2:41:56:d8 DRIVER: Sead AUTH addr=d8:bf:c0:c6:76:d6 status_code=0
Thu Aug 6 21:43:49 2020 daemon.info hostapd: ath3: STA d8:bf:c0:c6:76:d6 IEEE 802.11: associated
Thu Aug 6 21:43:49 2020 daemon.info hostapd: ath3: STA d8:bf:c0:c6:76:d6 RADIUS: starting accounting session 4DC51325442392F0
Thu Aug 6 21:43:49 2020 user.info : wevent[1906]: wevent.ubnt_custom_event(): EVENT_STA_JOIN ath3: d8:bf:c0:c6:76:d6 / 1
Thu Aug 6 21:43:49 2020 user.info : stahtd[1907]: [STA-TRACKER].stahtd_dump_event(): {"event_type":"sta_leave","message_type":"STA_ASSOC_TRACKER","mac":"d8:bf:c0:c6:76:d6","assoc_status":"0","vap":"ath3","event_id":"1"}
Thu Aug 6 21:43:49 2020 user.info : wevent[1906]: wevent.ubnt_custom_event(): EVENT_STA_IP ath3: d8:bf:c0:c6:76:d6 / 172.22.21.202
..and the following from a FAILED Connection from 68:C6:3A:ED:4E:0E
Code: Select all
Thu Aug 6 21:44:51 2020 daemon.info hostapd: ath3: STA 96:83:c2:41:56:d8 DRIVER: Sead AUTH addr=68:c6:3a:ed:4e:0e status_code=0
Thu Aug 6 21:44:51 2020 kern.info kernel: [978619.657003] ieee80211_sta_leave: 68:c6:3a:ed:4e:0e
Thu Aug 6 21:44:59 2020 user.info : stahtd[1907]: [STA-TRACKER].stahtd_dump_event(): {"event_type":"failure","message_type":"STA_ASSOC_TRACKER","mac":"68:c6:3a:ed:4e:0e","assoc_status":"2048","vap":"ath0","event_id":"1","auth_ts":"978618.281021"} - n2whtctrl, flags: 0x800
Thu Aug 6 21:45:01 2020 user.info : stahtd[1907]: [STA-TRACKER].stahtd_dump_event(): {"event_type":"failure","message_type":"STA_ASSOC_TRACKER","mac":"68:c6:3a:ed:4e:0e","assoc_status":"0","vap":"ath3","auth_ts":"978619.633593","auth_failures":"1","event_id":"1"}
Thu Aug 6 21:45:06 2020 daemon.info hostapd: ath3: STA 96:83:c2:41:56:d8 DRIVER: Sead AUTH addr=68:c6:3a:ed:4e:0e status_code=0
Thu Aug 6 21:45:06 2020 kern.info kernel: [978634.708374] ieee80211_sta_leave: 68:c6:3a:ed:4e:0e
This was with an open network.
WiFiEventStationModeDisconnected says WIFI_DISCONNECT_REASON_ASSOC_FAIL
This is so strange to me. Why do these two ESP8266's behave differently with the same software? And, why can they connect to other access points but not these ones?
I also tried soft-setting the MAC address of the failing bulb on a NodeMCU, and the NodeMCU connected fine with that mac address.
I've also tried connecting to a different Unifi access point in a different room. Same exact issue -- all other bulbs connect fine to the other Unifi access point, but not these two.
I don't know how to proceed at this point, I've tried all I can think of. Any suggestions? Help would be much appreciated.
///Leif