There's two approaches; deep sleep wake and light sleep wake.
Deep sleep wake ESP8266 with DS3231 (monostable required)
Huge thanks Andy aka's monostable answer. This led to the eventual solution.
My solution is almost the same as Andy aka's monostable, except that I:
- Used a PNP transistor for the output buffer (the ESP8266 module has an internal pull-up on RST).
- Replaced the 10nF cap with a polarized 10uF cap, as the smaller cap discharged too quickly and so didn't pull the MCU RST pin low enough for long enough.
I also posted the MCU C++ code on Arduino SE.
simulate this circuit – Schematic created using CircuitLab
Simulation:
Reality:
- CH1: RTC_SQW
- CH2: MCU_RST
Edit: 1uF cap also seems to do the job.
- CH1: RTC_SQW
- CH2: MCU_RST
Light sleep wake ESP8266 with DS3231 (lower part count)
As an alternative, for a lower part-count design: if very low power is not a requirement and light sleep is acceptable, you can wake the ESP8266 from light sleep using a GPIO pin where the input signal (unlike the RST pin), doesn't need to pulse.
esp_sleep_enable_gpio_wakeup()
esp_sleep_start()
Note: These functions don't appear to be available in the ESP class for Arduino.
There is a SO answer that describes using gpio_pin_wakeup_enable
as an alternative (but that didn't actually seem to work for me).
This is similar to the esp_sleep_enable_ext0_wakeup
function for ESP32, which unfortunately is not available for ESP8266. There doesn't seem to be a way to wake the ESP8266 from deep sleep with GPIO, and according to the docs: only a pulse on the RST pin can wake the ESP8266 from deep sleep.