Reducing Deep Sleep wake-up time in ESP8266

Here is a little data on how boot mode can make a difference in ESP8266 deep sleep wakeup current consumption and matter a lot in ultra low power applications built around non-rechargeable batteries.

No boot

esp8266 wakeup time deep sleep with no boot

Setup time: 140 ms

This seems to produce the best results when used with deep sleep. The deep sleep wake up power consumption behavior is shown here.
Note: RF cal is disabled (option = 2)

Boot v.1.6

esp8266 wakeup time deep sleep with boot 1.6

Setup time: 155 ms

Not too much saved here, compared to the no boot version, but the deep sleep wakeup time is slightly longer, this could mean a lot in ultra low power application, especially when deep sleep is performed frequently.

Boot v.1.7

esp8266 wakeup time deep sleep with boot 1.7

Setup time: 155 ms

Boot v.1.7 performs the same as v.1.6, the deep sleep wakeup time is not too different. It is fairly easy to conclude that it is not worth changing the boot version to achieve lower power consumption.

The test program

Test code for ESP8266 deep sleep wakeup measurement
#include "osapi.h"
#include "user_interface.h"

// This function executes before WiFi is set up
void user_rf_pre_init (void)
  system_deep_sleep_set_option (2);   // No RF cal on wake-up
  // 1: Vdd and TX power, 18 ms
  // 2: Vdd only, 2 ms
  // 3: Full cal, 200ms
  system_phy_set_powerup_option (2);
  system_phy_set_rfoption (2);

  wifi_set_opmode (NULL);

void user_init(void)
      system_deep_sleep_instant (1000000);    // Sleep for 10s

    enum flash_size_map size_map = system_get_flash_size_map();
    uint32 rf_cal_sec = 0;

    switch (size_map) {
        case FLASH_SIZE_4M_MAP_256_256:
            rf_cal_sec = 128 - 5;

        case FLASH_SIZE_8M_MAP_512_512:
            rf_cal_sec = 256 - 5;

        case FLASH_SIZE_16M_MAP_512_512:
        case FLASH_SIZE_16M_MAP_1024_1024:
            rf_cal_sec = 512 - 5;

        case FLASH_SIZE_32M_MAP_512_512:
        case FLASH_SIZE_32M_MAP_1024_1024:
            rf_cal_sec = 1024 - 5;

            rf_cal_sec = 0;

    return rf_cal_sec;


Ultra low power products such as those operating on non-rechargeable batteries are not really expected to self-update their firmware over time. For such one-time applications, it is helpful to use no boot and resort to using a small flash memory with non-upgradable firmware as a trade off for slightly longer battery life.

Designing a low power ESP8266 application?

We can help you achieve the lowest power consumption and meet battery life specifications of your choice by not just coding techniques but also by designing hardware that operates on low quiescent current. Low power design is more of an art than engineering!

Contact us if you need any design assistance with any embedded design!

2 thoughts on “Reducing Deep Sleep wake-up time in ESP8266”

  1. Hi. very good article. I want to sleep a esp6266-07 for 12 hours in deep sleep. I currently achieve it every hour. the program is made with arduino IDE. would be so kind to tell me how I can do it. Thank you

    1. Jorge,
      12 hours is a long time, the RTC oscillator drifts away with temperature variations and it may not wake up at 12 hours exactly! So using a dedicated RTC chip with “alarm” signal output would be awesome.

      But if you are fine with a little time drift, you can set a 64-bit value in deep sleep time (so 12 hours should be achievable I guess?). Otherwise use 1hr wakeups but store a simple counter variable in RTC memory (which remains intact in deep sleep). Use system_rtc_mem_write() and read APIs. Every time ESP wakes up, increment counter by 1 and go back to sleep. When the counter is 12 – you will know that 12 hours are up!

Leave a Reply

Your email address will not be published.

2 × 4 =