wifi disconnect issue possible reason

Clouds33ker
Posts: 6
Joined: Mon Mar 01, 2021 2:33 am

wifi disconnect issue possible reason

Postby Clouds33ker » Tue Dec 28, 2021 10:42 pm

If this has been covered somewhere else in the forum please let me know but it seems the forum works about as good as the ESP32s that I've been experimenting with. As is "close but no cigar". I've tried to use the ESP32 in numerous projects now and they all come to a screeching halt due to the wifi constantly dropping on the ESP32. I have boards from 5 different manufacturers and ever one of them does this. I tried again last night to implement the simple web server example on the latest board that I got in and in 2 hours the board had disconnected and tried to reconnect 14 times. There was no pattern to when it happened. It would stay connected for anywhere from 30 seconds up to just over 30 minutes then drop off again and try to reconnect. The reason codes given by the ESP32 were 7 and 203. 203 was not a lot of help based on the documentation. Looking at the router logs I was seeing multiple requests to the router along with matching "init" messages from the ESP32 in the serial monitor. The router kept acknowledging the ESP32 requests but the ESP32 didn't seem to realize it. I've never been able to determine what is going on so out of frustration (desperation?) I tried something that has had some surprising results. I have two routers running DD-WRT. One of them is a Linksys WRT3200ACM and the other is a
Linksys WRT54G/GL/GS. I changed the SSID and password on the ESP32 to connect to the WRT54G and it has been running now for over 10 hours without a single dropout and the webserver on the ESP32 responds every single time which it didn't do when it was connected to the WRT3200ACM. The 54G, naturally due to it's age, does not support N only B and G. This leads me to believe that Espressif may have an issue with their libraries for the handling of N since it is documented as supporting B/G/N. I plan to run other experiments if I can find some other routers that support N to see what happens. At least for now I have a stable and dependable connection for my ESP32 projects. Just need to figure out how to get N to work.

If anyone else has encountered this were you able to get it working and if so. how. If this is covered somewhere else in the forums could you provide the URL to the post since I can't get the site to do a response to an advanced search using the terms "wifi" and "disconnect".

Like I said earlier, I tried to search the forums but kept getting a '500' error after the site sat there for quite a while.

Clouds33ker
Posts: 6
Joined: Mon Mar 01, 2021 2:33 am

Re: wifi disconnect issue possible reason

Postby Clouds33ker » Wed Dec 29, 2021 5:35 pm

I found that the WRT3200ACM has the ability to force the router into different modes. I changed it to use only G and connected the ESP32 webserver back to that AP and restarted the test around 16:55 yesterday. It has been running fine now for over 18 hours. The webserver is responding properly. No timeouts on the webpage responding to requests.
There ARE wifi reconnects but at least there is a pattern:
[2021-12-28 17:55:27.735970] Disconnected from WIFI access point
[2021-12-28 18:55:27.334274] Disconnected from WIFI access point
[2021-12-28 20:55:27.628668] Disconnected from WIFI access point
[2021-12-28 23:55:27.600192] Disconnected from WIFI access point
[2021-12-29 02:55:27.402391] Disconnected from WIFI access point
[2021-12-29 04:55:27.725969] Disconnected from WIFI access point
[2021-12-29 05:55:27.384245] Disconnected from WIFI access point
[2021-12-29 07:55:27.659795] Disconnected from WIFI access point
[2021-12-29 10:55:27.460802] Disconnected from WIFI access point
All of these are for reason 2 'Auth Expire'. This looks like the router has some sort of strange timeout algorithm that it uses to disconnect a dormant client. Why it bounces between 1 to 3 hours between checking I have no clue. The time difference pattern is: 1 hour, 2 hours, 3 hours, 3 hours, 2 hours, 1 hour, 2 hours and back to 3 hours between deauths.
The next step will be to force the router to N and see what happens.

Clouds33ker
Posts: 6
Joined: Mon Mar 01, 2021 2:33 am

Re: wifi disconnect issue possible reason

Postby Clouds33ker » Wed Dec 29, 2021 8:53 pm

And it's possible I'm on to something regarding 802.11N support for the ESP32. Per my previous post I changed the 3200ACM router to "N only" and restarted the ESP32 webserver. In the past 2 plus hours the ESP32 has reconnected 7 times. Two of the reconnects are reason 2-Auth Expired (which is probably the router deauth due to non-activity) while I have a 1 200-Beacon Timeout and 4-No AP Found codes. Considering I have numerous other devices connected to the AP including some Raspberry Pi SBCs and they don't show anything in their logs regarding loss of connectivity I'm going to have to go with the ESP32 having issues with 802.11N.

I guess the next step will be to try to insure it isn't an issue with the router so I'll have to track down a different router to continue testing 80211N connectivity.

Anyone else able to run similar tests? Thoughts? Ideas?

WiFive
Posts: 3529
Joined: Tue Dec 01, 2015 7:35 am

Re: wifi disconnect issue possible reason

Postby WiFive » Sun Jan 02, 2022 3:33 pm

First, you didn't say which branch/commit of esp-idf you are using. The first suggestion with WiFi connection issues is to turn all power saving and modem sleep features off.

Clouds33ker
Posts: 6
Joined: Mon Mar 01, 2021 2:33 am

Re: wifi disconnect issue possible reason

Postby Clouds33ker » Sun Jan 02, 2022 4:08 pm

I'm using the Arduino IDE and sample code culled from the internet.

If power savings and/or modem sleep features were the issue why would things work flawlessly with the B/G router but not with the B/G/N router and then work fine when I locked the B/G/N router to G only?

BTW, thanks for responding. At least someone is trying to help. :D

WiFive
Posts: 3529
Joined: Tue Dec 01, 2015 7:35 am

Re: wifi disconnect issue possible reason

Postby WiFive » Sun Jan 02, 2022 4:33 pm

Arduino is still based on an esp-idf branch/commit and also has its own version numbers.

Yes it may be rate related and not related to modem sleep but it is one of the easiest things to try.

WiFi libraries are updated often and it can be hard to stay up to date since Arduino releases are not as frequent.

Who is online

Users browsing this forum: No registered users and 107 guests