The ESP8266 had some limitations regarding deep sleep to appoint at least two:
the deep sleep period with a maximum time of a bit more then one hour
deep sleep wake up was implemented as a reset, so all variables lost their values and got back to default, due to the reset all initialization code in setup() must be executed after a wake up
Seems that the successor, the ESP32 has not this limitation any more:
Tweaking the core is working for peanuts in case the board burns power endless! So it should be the last step (I think we do not need).
The 128 uA of the Wemos Lolin32 board is a “no go” for us! Compared with the 20 uA of the WiPy and 50 uA of the DFRobot Firebeetle and assuming that the numers are the same on our multimeter in the end!
You can use the timer, waking up your ESP32 using predefined periods of time.
You can use the touch pins.
You can use two possibilities of external wake up: you can use either one external wake up, or several different external wake ups.
You can use the ULP co-processor to wake up – this won’t be covered in this guide.
Invoking deep sleep mode
To write a sketch to put your ESP32 into deep sleep mode, and then wake it up, you need to keep in mind that:
First, you need to configure the wake up sources. This means configure what will wake up the ESP32. You can use one or combine more than one wake up source.
You can decide what peripherals to shut down or keep on during deep sleep. However, by default, the ESP32 automatically powers down the peripherals that are not needed with the wake up source you define.
Finally, you use the esp_deep_sleep_start() function to put your ESP32 into deep sleep mode.
The internal LDO can be configured as having 1.8 V, or the same voltage as VDD3P3_RTC. It can be powered off via software to minimize the current of flash/SRAM during the Deep-sleep mode.
@ 3.7 RTC and Low-Power Management, p. 21
With the use of advanced power-management technologies, ESP32 can switch between different power modes.
Power modes
Active mode: The chip radio is powered on. The chip can receive, transmit, or listen.
Modem-sleep mode: The CPU is operational and the clock is configurable. The Wi-Fi/Bluetooth base-band and radio are disabled.
Light-sleep mode: The CPU is paused. The RTC memory and RTC peripherals, as well as the ULPco-processor are running. Any wake-up events (MAC, host, RTC timer, or external interrupts) will wakeup the chip.
Deep-sleep mode: Only the RTC memory and RTC peripherals are powered on. Wi-Fi and Bluetooth connection data are stored in the RTC memory. The ULP co-processor is functional.
Hibernation mode: The internal 8-MHz oscillator and ULP co-processor are disabled. The RTC recovery memory is powered down. Only one RTC timer on the slow clock and certain RTC GPIOs are active.The RTC timer or the RTC GPIOs can wake up the chip from the Hibernation mode.
Notes
During Deep-sleep, when the ULP co-processor is powered on, peripherals such as GPIO and I²C are able to operate.
When the system works in the ULP sensor-monitored pattern, the ULP co-processor works with the ULP sensor periodically and the ADC works with a duty cycle of 1%, so the power consumption is 100 uA.
Selbst an die Werte des light sleep kommen wir gerade nicht ran. Ich habe irgendwie noch nichts belastbares für den FiPy gefunden, sondern bisher nur für den WiPy, allgemein gilt er aber als “low power” etwa im Gegensatz zu den alten LoPys.