Header Ads

Header ADS

ESP8266 software reset

This tutorial shows how to software reset ESP8266 in Arduino IDE. This sketch/example shows software reset using simple command ESP.restart() or ESP.reset().



Software reset for ESP8266 is required when you get trouble to connect WiFi router.

Lets see the use of software restart. This example program will show you software reset in a loop before it reaches to its max value.

ESP.reset() is a hard reset and can leave some of the registers in the old state which can lead to problems, its more or less like the reset button on the PC.

ESP.restart() tells the SDK to reboot, so its a more clean reboot.

int cnt=10;
 
void setup() {
  Serial.begin(115200);
}
 
void loop() {
 
  Serial.println(cnt);
 
  if(cnt==0){
    Serial.println("Reset..");
    ESP.restart();
  }
 
  cnt--;
  delay(1000);
}

No comments

Powered by Blogger.