← index #9006Issue #16181
Related · high · value 0.946
QUERY · ISSUE

Lightsleep with sleep period set to a value never waking

openby guillochonopened 2022-08-01updated 2026-03-09
bugport-rp2

I'm currently running a program on a Pico W where I am trying to lightsleep(5000). Unfortunately, the program seems to never wake up again after this call. Using a time.sleep instead and the Pico does wake up as expected, but of course with much more power draw.

I am running this nightly: https://micropython.org/resources/firmware/rp2-pico-w-20220729-unstable-v1.19.1-223-g963e599ec.uf2

CANDIDATE · ISSUE

lightsleep on Pico W regression for 1.24.0

closedby bclermontopened 2024-11-08updated 2025-05-21
bugport-rp2

Port, board and/or hardware

PICO W

MicroPython version

Micropython 1.24.0

Reproduction

Micropython 1.23.0 can run that code:

import machine
import time

led = machine.Pin("LED", machine.Pin.OUT)
led.off()

while True:
    print("Loop instance")
    led.on()
    time.sleep(0.1)   
    led.off()
    machine.lightsleep(10000)

it will sleep for 10s.

if you try the same with 1.24.0 there is absolutely no sleep at all. the string Loop instance just appears every 0.1 seconds

Expected behaviour

machine.lightsleep to do something on 1.24.0

Observed behaviour

machine.lightsleep do something on 1.23.0 but not 1.24.0

Additional Information

No, I've provided everything above.

Code of Conduct

Yes, I agree

Keyboard

j / / n
next pair
k / / p
previous pair
1 / / h
show query pane
2 / / l
show candidate pane
c
copy suggested comment
r
toggle reasoning
g i
go to index
?
show this help
esc
close overlays

press ? or esc to close

copied