Turning off WIFI radio on the Pico W #9135
-
I'm trying to use an HTML server, as a temporary initial configuration UI, and then once the post request from the client is received, shut down and deep sleep. I'm chasing efficiency as this is a battery application and Im noticing that
Does not shut down the radio, as I'm .07mA higher than without ever starting it during deep sleep. Doing some searching I've found that this is somewhat to be expected as the esp8266 required additional commands ( https://forum.micropython.org/viewtopic.php?t=2734 ) to be sent to completely shut off the WIFI radio. Basically I'm on the hunt for how to turn this radio off, without completely shutting down the cpu. Greatly appreciate any time or info you might give. |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 9 replies
-
I was able to go lightsleep on my PicoW solar garden with 2ma by using deinit() wlan.disconnect() I also use the watchdog but you can't have sleep more than 8 seconds so I create a small light sleep |
Beta Was this translation helpful? Give feedback.
-
Le 14 févr. 2023 à 09:31, Jacek Modrakowski ***@***.***> a écrit :
@danjperron <https://github.com/danjperron> what firmware are you running on your Pico W?
—
Reply to this email directly, view it on GitHub <#9135 (reply in thread)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ABBF7XAXKYSGS7OYFD7PDDLWXOJL5ANCNFSM575HDZ6Q>.
You are receiving this because you were mentioned.
Jacek I could confirm that machine.lightsleep() doesn’t work very well with the new firmware.
It was working and still works with this one rp2-pico-w-20220817-unstable-v1.19.1-286-g98bd7e33b.uf2
But with the newest nope!
I tried this one rp2-pico-w-20230217-unstable-v1.19.1-878-g4598b89ce.uf2
Event a simple loop with no import hangs after few light toggle
led=machine.Pin(‘LED’,machine.Pin.OUT)
while True:
led.value(1)
machine.lightsleep(1000)
led.value(0)
machine.lightsleep(1000)
regards,
Daniel Perron
|
Beta Was this translation helpful? Give feedback.
-
I found a small bug in my code about the watchdog. It is in ms and not in µs.
I also included the august 2022 uf2 firmware in my GitHub.
https://github.com/danjperron/PicoWSolar
danjperron/PicoWSolar
github.com
Daniel
… Le 19 févr. 2023 à 04:34, Jacek Modrakowski ***@***.***> a écrit :
Yeah, I do have the same problems... I will try the firmware you mentioned otherwise I will rewrite my code to C++...
—
Reply to this email directly, view it on GitHub <#9135 (reply in thread)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ABBF7XBRO5K53H6APILLON3WYHSI7ANCNFSM575HDZ6Q>.
You are receiving this because you were mentioned.
|
Beta Was this translation helpful? Give feedback.
-
Ok the work around has been discussed here On modmachine.c just change the line 149 to if (cyw43_has_pending && cyw43_poll != NULL) I recompiled the most recent micropython with the modification and it is working fine! ex: post mqtt around every 30sec compare to 5sec before which was no sleep at all. |
Beta Was this translation helpful? Give feedback.
I was able to go lightsleep on my PicoW solar garden with 2ma by using deinit()
wlan.disconnect()
wlan.active(False)
wlan.deinit()
wlan=None
time.sleep_ms(100)
I also use the watchdog but you can't have sleep more than 8 seconds so I create a small light sleep
check my code on my solar garden to figure out what I did to solve the problem of the watch dog.
(https://github.com/danjperron/PicoWSolar)