user76576: 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.

user78445: 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();

  }

}


76576: <p>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.</p>
 78445: <p>Hope this helps.</p>
<pre class="lang-cpp prettyprint-override"><code>
uint32_t resetAfterMillis = 30000; // Reset after 30 seconds.
uint32_t lastResetWas;

void setup() {
   lastResetWas = millis();
}


void loop() {
  uint32_t now = millis();
  if (now &gt;= lastResetWas + resetAfterMillis) 
  {
      lastResetWas = now;

      // Whatever you want to do here
      ESP.restart();

  }

}
</code></pre>
