Skip to content

esp32: light sleep with time alarm returns immediately if web workflow is enabled #6604

@jepler

Description

@jepler

CircuitPython version

Adafruit CircuitPython 8.0.0-alpha.1-54-g8b30f0120-dirty on 2022-07-14; Adafruit Feather ESP32 V2 with ESP32

Code/REPL

import alarm
import time

while True:
    now = time.monotonic()
    target = now + 5
    print(f"Doing work from {now=} until {target=}")
    while time.monotonic() < target: sum(range(100))
    
    target = now + 20
    print(f"Light sleeping from {now=} until {target=}")
    time_alarm = alarm.time.TimeAlarm(monotonic_time = target)
    print(f"{time_alarm=}")
    alarm.light_sleep_until_alarms(time_alarm)
    after = time.monotonic()
    print(f"{after=}, {'EARLY' if after < target else 'OK'}")

Behavior

Typical output:

Deep sleeping from now=479.346 until target=499.346
time_alarm=<TimeAlarm>
after=479.355, EARLY

Description

Only while using web workflow including #6591 -- if I comment out the SSID setting in .env and reset then it works. Doesn't matter if I've connected to circuitpython.local or not.

Additional information

No response

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions