ghubcoder / micropython-pico-deepsleep

MicroPython - a lean and efficient Python implementation for microcontrollers and constrained systems
https://micropython.org
Other
30 stars 2 forks source link

Pico W, RF antenna off with sleep? #7

Open UsuallyErrored opened 2 years ago

UsuallyErrored commented 2 years ago

I've used both picosleep on a non-w pico for awhile now, works great! But I'm running into an issue with the pico w. If you start up the wifi:

wlan = network.WLAN(network.STA_IF)
wlan.active(True)

Past this point I believe there is currently no way to turn off the pico W RF antenna.

wlan.disconnect()
wlan.active(False)

Does nothing. After starting wifi, that 1.5mA during sleep jumps to 2.2mA during machine.lightsleep() and picosleep(). No it's not insane, but if I could get mA back down to 1.5, I could gain 20 days of usage.

I don't know if people make use of keeping the rf on during sleep periods. Id assume if one is truly chasing efficency theyd want to have their current draw during sleep periods be as low as possible, and then restart the antenna after. I figure this is a nice way to make picosleep more useful then machine.lightsleep. I really don't know how hard this would be to implement, but I figure I'd bring it to your attention.

Thanks

julianoes commented 2 years ago

I'm trying the same thing but for me the WLAN connection only works once, or sometimes twice, then everything just turns unresponsive. Have you seen that before?