The readily available ESP32-DevKitC boards have served me well in many application, but there are some issues with one of the circuits that is up all throughout the year in my house to record moisture and temperature levels. Occasionally, like, every few month, this ESP32 gets stuck, so the web server running on that ESP32 is not responding anymore, and the logging of the data will stop (red marked portions in the plot).
The root cause of that relates to the current pulses drawn by the WLAN circuits of the ESP32, and despite connecting a good USB power supply, proper cables, and capacitors, it seems that there are occasional issues that I haven’t been able to solve be capacitors, better power supply, or software restart-features. I added the later, but the ESP32 freezes to a level that any software reset triggered by the code won’t work. Shortly disabling the power converter on the ESP32-DevKitC (of the on-board 3.3 V regulator – its EN/enable pin is pulled high by a resistor) will restore the function and get the circuit started again.
As I am not always around watching this circuit, I added a good old trusted NE555 timer, which will send a reset pulse (by pulling the EN signal low through a Schottky diode), and the capacitor is shorted by the small MOSFET, as long as the ESP32 is sending a pulse (this is send every 10 seconds approximately, for a few milliseconds) — if the ESP32 gets stuck, there won’t be any pulses, and the NE555 will then reboot the ESP32 every other minute by cycling the power to the ESP32.
That is a really clever solution to handle such cases 🙂 I was wondering if the ESP32 has some sort of a brown-out feature which could do the same thing in software without additional hardware?
BR
Chris
Maybe there are other ways, but eventually I got desperate because I would like to have this system going for years without touching it. On AVR and other system the brownout protection works well. Also in the future I will integrate a stronger power supply directly to the ESP device, which can provide the peak currents reliable. The Wifi system pull very strong current peaks.
How is your latest observations after implementing this circuit, do you think that 555 served well for the purpose of resetting ESP32 ?
I was in a similiar situation with ESP32 however I’m concerned that this solution wouldn’t work, because once ESP32 hangs, it hangs even it’s watchdog circuit, all internals freeze 🙂 So I would doubt sending a pulse to EN would work. Maybe a hard reset through a mosfet on VCC pin.
Matt
Hi Matt, it has been 100% reliable. Note that I send a pulse to EN of the powder regular, to cycle power. As you say, just resetting the ESP32 while under power may not work. My circuit completely interrupts power to the ESP32 for some small amount of time.
Thank you for the kind update Simon!
So this is one of a kind of proof that ESP32 hang is not a gossip, but reality. Even with perfect aligned power supplies, noise immunity is really low, which I had hard time to track or debug, because it is almost impossible to catch it. You never know which CPU hanged when or why, and you don’t know if it has all frozen at all.
Nevertheless I do still love ESP32 with all functionalities so having a good power reset would be sufficient for many applications unless you implement a life-critical app.
Matt.
Don’t recommend using the Esp for life support, unless you add a 555 timer