machine.lightsleep(n) always return right away on pico_w (1.25.0) #17185
Replies: 5 comments 5 replies
-
repro: boot a blank pico_w board with 1.25.0 |
Beta Was this translation helpful? Give feedback.
-
Test script: # light_sleep_test.py
from machine import lightsleep
from time import sleep_ms, ticks_ms, ticks_diff
def test(n):
for i in range(n):
t0 = ticks_ms()
sleep_ms(50)
lightsleep(5000)
sleep_ms(50)
print(i, ticks_diff(ticks_ms(), t0))
test(10) Yes, I got strange results for MicroPython v1.26.0-preview.31.g076e07197 on PICO. >>> import light_sleep_test
0 141
1 127
2 127
3 127
4 129
5 127
6 129
7 127
8 129
9 127
>>> But for MicroPython v1.25.0-preview.73.g406bccc75 on PICO, I got expected values >>> import light_sleep_test
0 5101
1 5101
2 5101
3 5101
4 5101
5 5101
6 5101
7 5100
8 5101
9 5100 |
Beta Was this translation helpful? Give feedback.
-
I did my previous test on a PICO with network enabled as I wanted to test PPP. I can now confirm that lightsleep is broken on firmware with network support. MP without network:
Compare to MP with network
|
Beta Was this translation helpful? Give feedback.
-
I suppose that the pico-w port imports network by default. That would account for my observation. If you don't mind me using your testcase for a repro, I will submit a bug report. Thanks again for helping with this bug. |
Beta Was this translation helpful? Give feedback.
-
negative. it works on the REPL of a PicoW |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
It does work on pico boards but not on pico_w. Note that it used to work fine on 1.23.0
Beta Was this translation helpful? Give feedback.
All reactions