How to restart ESP 01 in sketch?

Hi. I'm working on a project using Arduino uno and ESP 01. The esp 01 is being powered by a voltage regulator. The esp sends humidity data to the cloud via MQTT. However, I get occasional ESP timeout during operation which cause the ESP to disconnect and not able to send data to the cloud server.

Is there a way that I could automatically reset the ESP 01 board in the sketch if it fails to connect to the cloud? Perhaps reset similarly like powering on/off the arduino itself.

Thank for your help!

ESP.reset();

Use ESP.reset() or ESP.restart().

Not beautiful, but a number of problems were reported with ESP.restart() hanging:

while( 1 ) ;

The watch dog timer does the rest.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.