ESP32 Unable to Reconnect to Wi-Fi After Long-Term Operation

devjeetmandal09
Posts: 2
Joined: Thu Jun 19, 2025 9:19 am

ESP32 Unable to Reconnect to Wi-Fi After Long-Term Operation

Postby devjeetmandal09 » Fri Jun 20, 2025 12:42 pm

Hello to all ESP enthusiasts!

IDF_VER: 4.4.4
PART: ESP32-WROOM-32E(M113EH3200PS3Q0)

We’re facing an issue with some of our ESP32-based devices deployed in the field.
1. The devices function reliably for a long time but then suddenly stop reporting to server.
2. Upon investigation, we found that they fail to connect to Wi-Fi, even though the credentials are correct and signal strength is good.
3. These are low-power devices that connect to Wi-Fi only when they need to report data, and then disconnect immediately afterward.(we are just turning on the esp when needed and turning off when not) So there might be multiple connect and disconnect based on the reporting interval.
4. The issue is resolved only if we first onboard the device to a different Wi-Fi network (e.g., a mobile hotspot), and then reconnect it to the original network.

Has anyone else encountered a similar issue?
Any insights or suggestions would be greatly appreciated.

Best Regards,
Devjeet Mandal

User avatar
mbratch
Posts: 317
Joined: Fri Jun 11, 2021 1:51 pm

Re: ESP32 Unable to Reconnect to Wi-Fi After Long-Term Operation

Postby mbratch » Sun Jun 22, 2025 10:48 pm

Some time ago, when I was running ESP IDF 4.3, I had an issue in which my device would automatically disconnect from the wifi router and I needed to reboot the unit for it to reconnect.

I then wrote my own wifi event handler and printed the failure code on the console, which was a MIC error. Further, in my custom handler, I implemented logic that would reconnect to the wifi router when this error occurred.

I think this was subsequently fixed in a later version of ESP-IDF. But the problem did not happen with every brand of wifi router. I have since changed routers and upgraded ESP-IDF, so I haven't witnessed the problem in some time. I am not sure which of these changes resolved it.

Details on this problem are here: https://github.com/espressif/esp-idf/issues/7286.

Maybe your problem is similar? I hope these details help lead you to a potential solution.

devjeetmandal09
Posts: 2
Joined: Thu Jun 19, 2025 9:19 am

Re: ESP32 Unable to Reconnect to Wi-Fi After Long-Term Operation

Postby devjeetmandal09 » Mon Jun 23, 2025 6:24 am

Hello mbratch,

Thank you for your response.

As you mentioned, power cycling the devices resolves the issue on your end. However, in my case, the problem persists even after a power cycle. It only gets resolved when the device connects to a different Wi-Fi network. Interestingly, once it's connected to a different network and then switched back to the original SSID, it starts working again.

I appreciate your input and will investigate further to see if there's any correlation.

Who is online

Users browsing this forum: ChatGPT-User, meta-externalagent, PerplexityBot and 6 guests