kwiley wrote: ↑Wed May 20, 2020 9:12 pm
When you get your own issues sorted out, I would be very interested to know if you can confirm whether or not your D1 boards successfully wake from deep sleep with the RTC alarm.
Hi kwiley,
On the "back" of my D1 boards there are two pads with a silkscreen label pointing at them that says "sleep". I put a solderbridge here and that connects RST to the D0 (aka GPIO16) line. I then updated boot.py to the following:
Code: Select all
# This file is executed on every boot (including wake-boot from deepsleep)
#import esp
#esp.osdebug(None)
import uos, machine
#uos.dupterm(None, 1) # disable REPL on UART(0)
import gc
#import webrepl
#webrepl.start()
gc.collect()
rtc = machine.RTC()
rtc.irq(trigger=rtc.ALARM0, wake=machine.DEEPSLEEP)
if (machine.reset_cause() == machine.DEEPSLEEP_RESET) :
print("Woke from a deep sleep!")
rtc.alarm(rtc.ALARM0, 20000)
print("Going to sleep...")
machine.deepsleep()
When I reset the device I got the regular junk characters on the serial line followed by "Going to sleep ..." and 20 seconds later, same junk on the serial line but got the message "woke from a deep sleep", and then back to "Going to sleep".
So yes, I'd say it works as advertised.
--Chuck