You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
importalarmimportboardimportdigitalioimportneopixelimporttimenp=neopixel.NeoPixel(board.NEOPIXEL, 1)
whileTrue:
np[0] = (50, 50, 50)
time.sleep(1)
np[0] = (0, 0, 0)
# Create a an alarm that will trigger 5 seconds from now.time_alarm=alarm.time.TimeAlarm(monotonic_time=time.monotonic() +5)
pin_alarm=alarm.pin.PinAlarm(pin=board.IO2, value=False, pull=True)
# Do a light sleep until the alarm wakes us.print("sleeping...")
alarm.light_sleep_until_alarms(pin_alarm, time_alarm)
#alarm.exit_and_deep_sleep_until_alarms(time_alarm, pin_alarm)print("woken up by", alarm.wake_alarm)
Behavior
There are no error messages, although PinAlarm doesn't appear to wake the ESP32 up. The ESP32 always prints "sleeping..." and goes into sleep mode with no issues. After sleeping, when using light sleep, and the button connected to the pin is pressed, nothing happens. When using deep sleep, the "fake deep sleep" message on the serial console appears when the button is pressed, then it stays in sleep mode (the code doesn't re-run, and nothing else happens). The message it prints is:
Press any key to enter the REPL. Use CTRL-D to reload.
Pretending to deep sleep until alarm, CTRL-C or file write.
Description
No response
Additional information
the last commit that sleep seems to work without problems for me is 993e51e
the next commit after that (f6cf15d) crashes the ESP32S3 on boot, which happens for each commit until 8bae6af, on which the sleep problems occur
I guess whatever causes this problem was introduced between 993e51e and 8bae6af?
I'm using switches with external pull-down resistors, but i've also tried this with internal pull-up resistors
From what I can tell, disconnecting USB from a computer / preventing "fake sleep" doesn't help.
The example above uses a TimeAlarm at the same time as PinAlarm. TimeAlarm wakes the ESP32 up fine, and PinAlarm doesn't work whether a TimeAlarm is set up or not
when I was testing the code with a PinAlarm and a TimeAlarm together, and the pull ups on the PinAlarm incorrectly configured (with internal pullups and external pull downs), TimeAlarm did some strange things. It wouldn't wake up at the specified time, but when the PinAlarm pin was pressed, it wouldn't wake up straight away, but would then wake up at the specified time (or immediately if that time has already passed)
The text was updated successfully, but these errors were encountered:
CircuitPython version
Code/REPL
Behavior
There are no error messages, although PinAlarm doesn't appear to wake the ESP32 up. The ESP32 always prints "sleeping..." and goes into sleep mode with no issues. After sleeping, when using light sleep, and the button connected to the pin is pressed, nothing happens. When using deep sleep, the "fake deep sleep" message on the serial console appears when the button is pressed, then it stays in sleep mode (the code doesn't re-run, and nothing else happens). The message it prints is:
Description
No response
Additional information
The text was updated successfully, but these errors were encountered: