1

I would like to reset my ESP32 from the software, how do I do it and how to make it do this at regular intervals.

asked Jul 27, 2021 at 11:20
0

1 Answer 1

3

Hope this helps.


uint32_t resetAfterMillis = 30000; // Reset after 30 seconds.
uint32_t lastResetWas;
void setup() {
 lastResetWas = millis();
}
void loop() {
 uint32_t now = millis();
 if (now >= lastResetWas + resetAfterMillis) 
 {
 lastResetWas = now;
 // Whatever you want to do here
 ESP.restart();
 }
}
answered Jul 27, 2021 at 11:49

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.