← index #9006Issue #15622
Related · high · value 2.366
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

RP2350 / Pico 2 machine.lightsleep not working correctly

openby geerlingguyopened 2024-08-08updated 2025-03-03
bugport-rp2

Port, board and/or hardware

Pico 2 / RP2350

MicroPython version

MicroPython v1.24.0-preview.201.g269a0e0e1 on 2024-08-09; Raspberry Pi Pico2 with RP2350

Reproduction

  1. Install latest Firmware from https://micropython.org/download/RPI_PICO2/
  2. Implement machine.lightsleep(5000) in your code
  3. Run code.

Expected behaviour

Expected Pico 2 to enter lightsleep mode for 5 seconds, then continue to next bit of code.

Observed behaviour

lightsleep is maybe entered for a cycle or so, but code carries on and never stops executing for any time value I enter for lightsleep.

Additional Information

Complete code example:

# Lightsleep MicroPython example.
from machine import Pin
import time
led = Pin(25, Pin.OUT)

while True:
    led.toggle()
    time.sleep_ms(5000)
    led.toggle()
    machine.lightsleep(5000)

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