Some questions about SLEEP, RTC and IRQs
The WiPy documentation shows, that the RTC is a valid wakeup source for the sleep mode. Derived from the example in the documentation and another forum thread I made this short example:
import pycom import time from machine import RTC pycom.heartbeat(False) pycom.rgbled(0x007f00) # green time.sleep(2) pycom.rgbled(0x7f0000) # red time.sleep(2) pycom.rgbled(0x000000) # off rtc = machine.RTC() # init with default time and date def alarm_handler (rtc_o): global rtc_wake rtc_wake = True # create a RTC alarm that expires after 5 seconds rtc.alarm(time=5000, repeat=True) # enable RTC interrupts rtc_i = rtc.irq(trigger=RTC.ALARM0, handler=alarm_handler, wake=machine.SLEEP) # go into suspended mode while True: machine.sleep() if rtc_wake: rtc_wake = False print('Awake') pycom.rgbled(0x7f0000) # red time.sleep(1) pycom.rgbled(0x000000) # off
But the code won't run. It seems to me, that the alarm feature of the RTC isn't implemented on my ESP32 based WiPy. Can someone confirm this?
If this is true, how can I wakeup the WiPy from sleep mode?
is supported - this is only wakeup "source" - we all waiting for more :)