Page 1 of 1

Wifi disconnects

Posted: Fri May 31, 2019 9:25 am
by ebor65
Hello,
I have the problem that ESP32 Wifi server is working OK but after some hours or even minutes, the WIFI disconnects. I am using ESP32 DEVKIT V1 but I have the same problem with other boards. I have tried more than one board and different WIFI routers ( home, office).
To program it I am using Arduino ID 1.8.9 , boards from "https://dl.espressif.com/dl/package_esp32_index.json" and I select DOIT ESP32 DEVKIT V1 board.
I use the SimpleWifiServer example but it is the same with other Web Wifi servers.
I check the following in the loop function:
if (WiFi.status() != WL_CONNECTED) and I see that the WIFI is disconnected. The code is still running but the WEB server is not responding anymore.
I can try to re-connected in this case but it is not working reliably.
Thank you in advance for any ideas what can be the reason and how to fix it!

Re: Wifi disconnects

Posted: Sun Jun 02, 2019 1:33 pm
by hml9083@hotmail.com
I also have this behavior and can not find a fix, I have used the WiFi.status() != WL_CONNECTED test within the loop, it does not appear to be the fix. I have not seen this to occur with my esp8266 modules. I have also seen others post issues with random losing WiFi connection status on esp32. I recently added esp_err_t esp_wifi_set_country(const wifi_country_t *country). I set my country to US. so far web server up for 5 days, can any one assist with why this occurs ?

Re: Wifi disconnects

Posted: Mon Jun 03, 2019 9:42 am
by ebor65
How do you call esp_wifi_set_country inside Arduino IDE?

I call now WiFi.setSleep(false);

and inside the loop I check

if (WiFi.status() != WL_CONNECTED) {

in this case, I reconnect. It works for a few days now but sometimes it is not responding. It seems that it needs time to reconnect. So it seems it is not a good solution.

Re: Wifi disconnects

Posted: Fri Nov 19, 2021 12:21 pm
by HardyM
Hi
Did you ever solve this - I'm getting the same issue.
Thanks