I recall seeing something in passing that this might be a known bug. But I don't recall where I saw that or the full details.This still does not address the issue of why the Pico W does not even sleep when I try to use a fixed number of milliseconds.
Both 'machine.lightsleep(ms)' and 'machine.deepsleep(ms)' appear to work as expected when I tested with a Pico.
Neither work as expected when I tested with a Pico W though 'machine.deepsleep(ms)' did provoke a reboot as expected -
Code:
MicroPython v1.25.0-preview.20.gdf6b40a87.dirty on 2024-11-08; Raspberry Pi Pico W with RP2040Type "help()" for more information.>>> import machine>>> import time>>> if True:... time.time()... machine.lightsleep(10 * 1000)... time.time().........16094592741609459274>>>My understanding is this is because of the wireless support which interferes with the sleeping and causes it to end prematurely. That may be because the CYW43 chip interrupts the RP2040, which becomes a 'wake' event, causes the sleep to end. That would seem plausible but, as said, I don't recall the detail.
The MicroPython team may be able to provide more clarity - https://github.com/micropython/micropython
Statistics: Posted by hippy — Fri Nov 08, 2024 12:45 pm