micropython-pico-deepsleep
micropython-pico-deepsleep copied to clipboard
Deep sleeping fix really part of MicroPython
Dear @ghubcoder
First of all, thank you for your fantastic blog post: https://ghubcoder.github.io/posts/deep-sleeping-the-pico-micropython/
Yes, I found this already closed issue, but the comments do only relate to lightsleep
but not deepsleep
.
That's why I wanted to ask you whether your fix is already part of MicroPython? Because I'm still measuring around 28 mA after calling machine.deepsleep(30000)
.
Thank you for your help!
I was wondering the same thing, as your blog post says:
Deep sleeping and waking from the onboard clock has been merged into Micropython directly with this PR.
There is no need now to use this fork.
I think the missing part is that you must turn off the WIFI chip before calling machine.deepsleep()
but I think @ghubcoder can comment better. If the wifi chip is left on when calling machine.deepsleep()
it uses over 20mA.
(The deep sleep implementation in that PR is implemented in machine_lightspeed with flag M0PLUS_SCR_SLEEPDEEP_BITS
.)
@Ciantic that makes sense to me with regards to having to switch off the WiFi chip.
I've not tried this myself. Was you able to get down to around 1.3mA once you disabled the WiFi chip when using the official micropython release?
As far as I can see in this commit everything is implemented and results in the same deepsleep codepath being used as the pico-extras
codebase is using as per here.
sleep_goto_sleep_until
from the above link is the same function this repo makes use of here.
I've not tried this myself. Was you able to get down to around 1.3mA once you disabled the WiFi chip when using the official micropython release?
@ghubcoder no, unfortunately not 😪 using this code, the very minimum is 19 mA