Random amount of errors during wifi connect to WPA2

User avatar
fly135
Posts: 606
Joined: Wed Jan 03, 2018 8:33 pm
Location: Orlando, FL

Random amount of errors during wifi connect to WPA2

Postby fly135 » Sun Jul 08, 2018 4:06 pm

I just tried changing my router wifi from WPA to WPA2 and noticed a new error that I hadn't seen before. I get a random amount before finally getting my DHCP address. Sometimes none and sometimes several (4 or 5). Seems like the wifi section is figuring something out before it gets it right. Thinking perhaps there is some info I should give it.

Should I check the AP mode before calling esp_wifi_set_config and fill in the threshold.authmode? This is what I give it now...

Code: Select all

  wifi_config_t wifi_config = {
      .sta = {
          //.ssid = "",
          //.password = "",
          .scan_method = 0, //DEFAULT_SCAN_METHOD,
          .sort_method = 0, //DEFAULT_SORT_METHOD,
          .threshold.rssi = -127, //DEFAULT_RSSI,
          .threshold.authmode = 0, //DEFAULT_AUTHMODE,
      },
  };
The errors I get while connecting....

Code: Select all

WIFI Connecting...
SYSTEM_EVENT_STA_START : 0
leeo> E (2449) wifi: Set status to INIT.

SYSTEM_EVENT_STA_DISCONNECTED
WIFI Connecting...
SYSTEM_EVENT_STA_START : 0
E (3279) wifi: Set status to INIT.

SYSTEM_EVENT_STA_DISCONNECTED
WIFI Connecting...
SYSTEM_EVENT_STA_START : 0
E (4279) wifi: Set status to INIT.

SYSTEM_EVENT_STA_DISCONNECTED
WIFI Connecting...
SYSTEM_EVENT_STA_START : 0
E (5279) wifi: Set status to INIT.

SYSTEM_EVENT_STA_DISCONNECTED
WIFI Connecting...
SYSTEM_EVENT_STA_START : 0
E (6279) wifi: Set status to INIT.

SYSTEM_EVENT_STA_DISCONNECTED
WIFI Connecting...
SYSTEM_EVENT_STA_START : 0
E (7279) wifi: Set status to INIT.

SYSTEM_EVENT_STA_DISCONNECTED
WIFI Connecting...
SYSTEM_EVENT_STA_START : 0
E (8279) wifi: Set status to INIT.

SYSTEM_EVENT_STA_DISCONNECTED
WIFI Connecting...
SYSTEM_EVENT_STA_START : 0
E (9279) wifi: Set status to INIT.

SYSTEM_EVENT_STA_DISCONNECTED
WIFI Connecting...
SYSTEM_EVENT_STA_START : 0
E (10279) wifi: Set status to INIT.

SYSTEM_EVENT_STA_DISCONNECTED
WIFI Connecting...
SYSTEM_EVENT_STA_START : 0
E (11279) wifi: Set status to INIT.

SYSTEM_EVENT_STA_DISCONNECTED
WIFI Connecting...
SYSTEM_EVENT_STA_START : 0
E (12279) wifi: Set status to INIT.

SYSTEM_EVENT_STA_DISCONNECTED
WIFI Connecting...
SYSTEM_EVENT_STA_START : 0
SYSTEM_EVENT_STA_GOT_IP
Got IP: 192.168.3.100
Got IP: 192.168.3.100
Net mask: 255.255.255.0
Gateway: 192.168.3.1

User avatar
fly135
Posts: 606
Joined: Wed Jan 03, 2018 8:33 pm
Location: Orlando, FL

Re: Random amount of errors during wifi connect to WPA2

Postby fly135 » Sun Jul 08, 2018 9:19 pm

I tried setting wifi_config.threshold.authmode = WIFI_AUTH_WPA2_PSK and it failed to connect. I actually didn't expect that change to have any affect at all since it seems to be for scanning access point.

John A

User avatar
fly135
Posts: 606
Joined: Wed Jan 03, 2018 8:33 pm
Location: Orlando, FL

Re: Random amount of errors during wifi connect to WPA2

Postby fly135 » Mon Jul 09, 2018 4:48 pm

Connecting to WPA2 is definitely flaky. Sometimes it will connect right away and sometimes I get disconnect events over and over. And this is with a wifi router only a few feet away. I've been using WPA mode for a long time and it's been connecting just fine.

The router running WPA2 has an RSSI of -47 and the one running WPA has an RSSI of -57.

John A

User avatar
fly135
Posts: 606
Joined: Wed Jan 03, 2018 8:33 pm
Location: Orlando, FL

Re: Random amount of errors during wifi connect to WPA2

Postby fly135 » Mon Jul 09, 2018 8:14 pm

The reason code for the SYSTEM_EVENT_STA_DISCONNECTED is WIFI_REASON_ASSOC_FAIL = 203.

John A

User avatar
fly135
Posts: 606
Joined: Wed Jan 03, 2018 8:33 pm
Location: Orlando, FL

Re: Random amount of errors during wifi connect to WPA2

Postby fly135 » Thu Aug 02, 2018 9:23 pm

I just updated my IDF to v3.0.2 release and I haven't seen a 203 disconnect error yet. :D

John A

Who is online

Users browsing this forum: ulaoulao and 99 guests