The RST pin of the ESP8266 is always HIGH while the ESP8266 is running. However, when the RST pin receives a LOW signal, it restarts the microcontroller.
If you set a Deep Sleep timer with the ESP8266, once the timer ends, GPIO 16 sends a LOW signal. That means that GPIO 16 when connected to RST pin can wake up the ESP8266 every time the timer ends.
Sleep Modes
Example Code
Code Block |
---|
*
* ESP8266 Deep sleep mode example
* Rui Santos
* Complete Project Details http://randomnerdtutorials.com
*/
void setup() {
Serial.begin(115200);
Serial.setTimeout(2000);
// Wait for serial to initialize.
while(!Serial) { }
// Deep sleep mode for 30 seconds, the ESP8266 wakes up by itself when GPIO 16 (D0 in NodeMCU board) is connected to the RESET pin
//Serial.println("I'm awake, but I'm going into deep sleep mode for 30 seconds");
//ESP.deepSleep(30e6);
// Deep sleep mode until RESET pin is connected to a LOW signal (for example pushbutton or magnetic reed switch)
Serial.println("I'm awake, but I'm going into deep sleep mode until RESET pin is connected to a LOW signal");
ESP.deepSleep(0);
}
void loop() {
} |
References
Reference | URL |
---|---|
ESP8266 Deep Sleep with Arduino IDE | https://randomnerdtutorials.com/esp8266-deep-sleep-with-arduino-ide/ |
...