/* Project: ESP8266 Function: Deep sleep mode for 30 seconds, the ESP8266 wakes up by itself when GPIO 16 (D0 in NodeMCU board) connected to the RESET pin */ //************************************************ void setup() { Serial.begin(9600);//initialise serial communication at 9600 bps Serial.setTimeout(2000); while(!Serial) { }//wait for serial to initialize. Serial.println("Operational, going into deep sleep mode for 30 seconds"); ESP.deepSleep(30e6);//deep sleep mode for 30 seconds //Deep sleep mode until RESET pin is connected to a LOW signal (can be pushbutton or magnetic reed switch) //Serial.println("Operational, going into deep sleep mode until RESET pin connected to a LOW signal"); //ESP.deepSleep(0); } void loop() { }