machine.lightsleep makes time.sleep_ms takes more time on every call
Port, board and/or hardware
rp2040
MicroPython version
MicroPython v1.23.0 on 2024-06-02; Raspberry Pi Pico with RP2040
Reproduction
while True:
# omitted code to turn led on and off
time.sleep_ms(500)
machine.lightsleep(4000)
Expected behaviour
every call to time.sleep_ms(500) should take the same time
Observed behaviour
the led take more and more time to turn on and off after the same sleep_ms()
Additional Information
No, I've provided everything above.
Code of Conduct
Yes, I agree
RP2350 lightsleep broken on battery
Port, board and/or hardware
pico 2 w
MicroPython version
Reproduction
from machine import Pin
import machine
import time
led = Pin("LED", Pin.OUT) # Use the built-in LED
just to indicate when a reset occured
led.off()
time.sleep(1)
led.on()
time.sleep(1)
machine.lightsleep(60_000)
Expected behaviour
LED should go out for 1s every 62s.
Observed behaviour
Keeps blinking in 1s intervals when on battery power (Vsys), disconnected USB. WLAN off.
Additional Information
Same behavior with deepsleep. My work-around is
now = time.time()
wake = now + 60
while now < wake:
machine.lightsleep(60_000)
now = time.time()
but goal was to save power. With this loop it is idling at 0.15W versus 0.2W with time.sleep. Bummer. Is this a limitation of the pico 2 w?
Thanks!
Code of Conduct
Yes, I agree