ESP8266 Developer Zone The Official ESP8266 Forum 2021-10-04T21:36:34+08:00 https://bbs.espressif.com:443/feed.php?f=7&t=4604 2021-10-04T21:36:34+08:00 2021-10-04T21:36:34+08:00 https://bbs.espressif.com:443/viewtopic.php?t=4604&p=100260#p100260 <![CDATA[Re: Wifi Sta Disconnect Reason explanation]]>
pratik wrote:
I think there is something to do with the code you wrote, or might be frequency offset issue too.
Note that the reason/cause returned is not always reliable. Try connecting to a secure router (WPA2 or something) and see what happens.

Also, STA+AP mode may get disconnected because STA and AP both use same channel. So when you connect to a new AP or actively scan for APs, the AP mode may not be stable.


Thank you for your post.
I know this thread is very old, but I stumbled across it trying to understand my connection woes. It made perfect sense... that if you're scanning (which checks all channels) will cause your station connection to disconnect when the hardware is not on its channel. A little embarrassing that I didn't think of that.

As I have not found anything from Espressif giving more detail than the names on the enum in the user_interface.h, I did stumble across this link that describes Linux reasons that "sound" similar. On that link, are other links to IEEE and Cisco references that may help you. It did help me.
https://aboutcher.co.uk/2012/07/linux-wifi-deauthenticated-reason-codes/

Statistics: Posted by Inquisitor — Mon Oct 04, 2021 9:36 pm


]]>
2017-05-18T20:41:55+08:00 2017-05-18T20:41:55+08:00 https://bbs.espressif.com:443/viewtopic.php?t=4604&p=13236#p13236 <![CDATA[Re: Wifi Sta Disconnect Reason explanation]]> Note that the reason/cause returned is not always reliable. Try connecting to a secure router (WPA2 or something) and see what happens.

Also, STA+AP mode may get disconnected because STA and AP both use same channel. So when you connect to a new AP or actively scan for APs, the AP mode may not be stable.

Statistics: Posted by Guest — Thu May 18, 2017 8:41 pm


]]>
2017-05-17T21:55:27+08:00 2017-05-17T21:55:27+08:00 https://bbs.espressif.com:443/viewtopic.php?t=4604&p=13203#p13203 <![CDATA[Wifi Sta Disconnect Reason explanation]]>

Code:

   REASON_UNSPECIFIED              = 1,
   REASON_AUTH_EXPIRE              = 2,
   REASON_AUTH_LEAVE               = 3,
   REASON_ASSOC_EXPIRE             = 4,
   REASON_ASSOC_TOOMANY            = 5,
   REASON_NOT_AUTHED               = 6,
   REASON_NOT_ASSOCED              = 7,
   REASON_ASSOC_LEAVE              = 8,
   REASON_ASSOC_NOT_AUTHED         = 9,
   REASON_DISASSOC_PWRCAP_BAD      = 10,  /* 11h */
   REASON_DISASSOC_SUPCHAN_BAD     = 11,  /* 11h */
   REASON_IE_INVALID               = 13,  /* 11i */
   REASON_MIC_FAILURE              = 14,  /* 11i */
   REASON_4WAY_HANDSHAKE_TIMEOUT   = 15,  /* 11i */
   REASON_GROUP_KEY_UPDATE_TIMEOUT = 16,  /* 11i */
   REASON_IE_IN_4WAY_DIFFERS       = 17,  /* 11i */
   REASON_GROUP_CIPHER_INVALID     = 18,  /* 11i */
   REASON_PAIRWISE_CIPHER_INVALID  = 19,  /* 11i */
   REASON_AKMP_INVALID             = 20,  /* 11i */
   REASON_UNSUPP_RSN_IE_VERSION    = 21,  /* 11i */
   REASON_INVALID_RSN_IE_CAP       = 22,  /* 11i */
   REASON_802_1X_AUTH_FAILED       = 23,  /* 11i */
   REASON_CIPHER_SUITE_REJECTED    = 24,  /* 11i */

   REASON_BEACON_TIMEOUT         = 200,
   REASON_NO_AP_FOUND              = 201,
   REASON_AUTH_FAIL            = 202,
   REASON_ASSOC_FAIL            = 203,
   REASON_HANDSHAKE_TIMEOUT      = 204,


I understand some of them, like reason 8 when I changed my station config to other SSID, and reason 201 when config set to station only and the wifi router turned off. I also observe that reason 201 only happen in STA mode and not in STA+AP mode.

Where can I find the explanation for wifi event, reason and corresponding wifi mode that trigger them?


So here's the story, I have several devices all using esp8266 with setup like this

Image

While the monitor device waiting (2 to 10 minutes) no network activity or connection opened, and in the meantime wifi sometimes disconnect 1 or 2 times with reason 6, 4, or 2 and fortunately the wifi always reconnect immediately.

why wifi disconnect with REASON_AUTH_LEAVE & REASON_NOT_AUTHED while the AP using AUTH_OPEN ?

And when waiting time expired, the monitor device start opening TCP connection and connection always broken, then reconnect again.

Are this behavior designed by espressif? to make esp8266 lose connection while the network inactive

thanks.

NOTE: monitor device use sdk 2.0, the other use sdk 1.5.2.

Statistics: Posted by impulstek — Wed May 17, 2017 9:55 pm


]]>