Dormant and wake with deinit and pin 23 #13748
Unanswered
ravra
asked this question in
RP2040 / Pico
Replies: 1 comment
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
As with many others, I'm looking to run my picoW on batteries in a loop where it goes dormant, wakes up via a pin, and then uses Wifi to send an email. I grabbed code from lots of googling and it mostly all works except for a one thing.
If I just use the wlan.deinit call when shutting down Wifi before going dormant, the power drops down to about 10mA and the loop stays healthy:
However, if I REMOVE the wlan.deinit, the power drops to under 1mA - big difference. However, upon wake, I bring pin 23 high but Wifi doesn't start up properly, with the last print being "Enabling Wifi." I've read conflicting accounts of how power for the Wifi module (cyw43) is controlled with some saying that it is powered down by the deinit and others saying that pin 23 does it. The docs say that GPIO23 simply controls the Power Save mode of the regulator, directing how the regulator output waveform is modulated. It says GPIO23 should be low by default - i.e. in the Power Save mode - but when I run I see it as high at the start. Confusing.
Maybe the deinit prevents the Power Save mode which keeps the network code from going bonkers when going dormant? Perhaps clocks or something else need to be re-initialized? Anybody understand this stuff?
Complete code:
If it matters, I'm running this from a stock Thonny (4.1.4) installed a few weeks ago.
Beta Was this translation helpful? Give feedback.
All reactions