I have a similar problem.
My application is to regularly send data with an ESP12 to a server (each 30s) using an https request. It is powered using an USB phone charger.
After a while ( randomly 6h, 12 or more), the module loose the wifi connexion and can't reconnect.
My main loop check if connected, if not, try to connect for 15s ; after that if not connected, wait for 30s, and then try again. After 5 failed loop, I do an esp.reset()
Even after an esp reset, it can't recover. I made a lot of debug around that and my latest conclusion is the following :
- my module is in a plastic box,
- if the module loose wifi connect, it will try to connect and because of power transmission, it's getting warmer (may be 35° on the metal shield)
- when the module is getting warm, may be because of ESP RF deviation with temperature, the level of RSSI for the wifi signal is going lower and lower. I could see that using serial monitor.
- Hence, the module can't reconnect, try to reconnect and heat up a little more.
- It's an endless loop even with reset.
- This especially happens when the module is near the wifi coverage limit.
If I powerdown the module for seconds, It can reconnect.
This is something that I have observed my laptop. When I am far from the router, the received signal quality is getting lower as my laptop is getting warm.
Now I don't have at the moment a solution. I don't know how to switch off the wifi part for a while to reduce temperature.
Hope this can give new ideas.