Deep sleep with Pysense - Different APIs
-
I'm using a FiPy with a PySense board. It reads a sensor value every few minutes and sends it via WiFi. In the remaing time I want to send it to sleep (based on a wakeup timer).
Now I found two different Docs on that:
https://docs.pycom.io/chapter/datasheets/boards/deepsleep/api.html
https://docs.pycom.io/chapter/pytrackpysense/apireference/sleep.html
And in some posts I saw "machine.go_to_sleep()".Can someone give a me short overview over the difference between these methods? Whats the correct way for this use case?
-
@jcaron
Thanks a lot for the explanation! That solved the question for me.
-
If you are using a LoPy 1 (not LoPy 4), a SiPy or a WiPy 2 (not WiPy 3), there is an issue with the "native" deep sleep (
machine.deepsleep
) which has a higher power consumption than wanted.For those boards, and only those, if you want to achieve very low power deep sleep (on the order of 10 µA), you need something else to completely power down the board. This could be a deep sleep shield, a Pysense, or a Pytrack, which have a way to control power to the board. That's the goal of the Deep Sleep API and the Deep Sleep features of the PyTrack and PySense APIs.
If you use one of the newer boards (including WiPy 3, LoPy4, FiPy), as in your case, you can use the native deep sleep directly, see https://docs.pycom.io/chapter/firmwareapi/pycom/machine/#machinedeepsleeptimems