Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 8026

MicroPython • Re: MicroPython: How to wake Pi Pico / Pico W / Pico 2 from sleep using GPIO button?

$
0
0
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.
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.

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>>>
The Pico W did not sleep for 10 seconds, observed visually and in what elapsed time is reported.

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



Viewing all articles
Browse latest Browse all 8026

Trending Articles