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

Firmwarepackage for Pico W #5

Closed chris0z closed 2 years ago

chris0z commented 2 years ago

Hi, Could you create a Firmware for the latest Pico W with network libary?

ghubcoder commented 2 years ago

Hi @chris0z , I need to try and get my hands on a Pico W, definitely something I'd like to try 🙂

Not sure though how well the network interface would cope with deep sleeping and reawakening.

chris0z commented 2 years ago

Looks like it got fixed in Micropython https://github.com/micropython/micropython/pull/8832

ghubcoder commented 2 years ago

Great find @chris0z

The code in that commit looks great, just what seems to be needed.

Wish I'd checked here earlier 😄 I spent some time today rebasing and got this simple deep sleep mod working with the latest code on an original Pico and a Pico W.

Looks like it won't be needed much longer though.

Have you tried using:

machine.lightsleep(5)

Using the latest release? I tried building from the master branch of the Micropython repo with a Pico W and got the same result as this comment: https://github.com/micropython/micropython/pull/8832#issuecomment-1201106991

It seems to hang for me and never return.

ghubcoder commented 2 years ago

I've added a new release here to support the Pico W.

ghubcoder commented 2 years ago

I've just tried using machine.lightsleep from the official version of Micropython and it's working fine for me, not sure what I was doing last time 😬

Will close this issue.

chris0z commented 2 years ago

I used a nightly build with the machine.lightsleep included. Was not on the main then.