ESP8266 NodeMCU Power Saving

The ESP8266 chip has three power saving options

  1. Modem Sleep: Stops Wifi transmission but keeps the connection and the CPU operating
  2. Light Sleep: Turns off the Wifi and the CPU but wakes periodically to receive beacon messages
  3. Deep Sleep: Completely Shuts down the Wifi and CPU leaving only a timer to wake the CPU. This mode requires an external connection between GPIO16 and the RST in order to wake the chip. Note this results in a hard wakeup in the sense that it simply resets the chip and your program restarts. This should only be used for sleep periods in excess of 10 seconds.

Modes 1 and 2 are most likely already used by the underlying Espressif SDK on which the Arduino interface is built.

The Arduino IDE has implemented the deep sleep mode as follows


ESP.deepSleep(SLEEP_DELAY_IN_SECONDS * 1000000, WAKE_RF_DEFAULT);
delay(100); // wait for deep sleep to happen

For more info see the Espressif wiki on Sleep