Page 1 of 1

Q: How to put the chip into sleep mode? and what conditions do we need?

Posted: Tue Jul 28, 2015 12:50 pm
by ESP_Luna
Q: How to put the chip into sleep mode? and what conditions do we need?
ESP8266 supports three sleep modes, i.e., Modem-sleep, Light-sleep and Deep-sleep. For Modem-sleep and Light-sleep, ESP8266 must meet the following requirements:
  • ESP8266 is set to Station_only mode.
  • ESP8266 links to Router to obtain IP address.
  • The system is in idle state.
[Function Callback]
  • Call the function of wifi_set_sleep_type and set ESP8266 to Modem-sleep or Light-sleep.
  • Call the function of system_deep_sleep and set ESP8266 to Deep-sleep mode.
[Context of Use]
  • Modem-sleep is generally used when CPU runs. For example, PWM lights needs CPU’s real-time control.
  • Light-sleep mode can be used to maintain the link between ESP8266 and Router. This mode enable ESP8266 to give a real-time response to data sent by Router. CPU can be idle state before it receives commands. For example, in Wi-Fi switches, CPU is in idle state until it receives the control command and begins to operate GPIO.
  • Deep-sleep mode can be used in low power generation sensors or in the context in which data transmission is not needed in part of the execution time. Devices can wake up to measure data and update them in a periodic way and then re-enter the Deep-sleep mode. Data could also be stored in RTC memory (this applies in Deep-sleep mode) and be sent out all at once.
  • Your program cannot have a round robin timer in the program, or its CPU will fail to enter the sleep mode.
  • It is only required in the Deep-sleep mode that XPD_DCDC(GPIO16) or GPIO in the MCU should be connected to EXT_RSTB to wake up the chip. There are no special requirements in the other modes.
Refer to“9B-ESP8266__Sleep__Function Description” for more information.