Welcome to the Pycom forum Forum
    • \[\[global:header.categories\]\]
    • \[\[global:header.recent\]\]
    • \[\[global:header.tags\]\]
    • \[\[global:header.popular\]\]
    • Login

    Explore Pybytes | Official Documentation | Report a Firmware Bug/Issue | GitHub

    Pysense Deepsleep

    Scheduled Pinned Locked Moved Getting Started
    pysense deepsle
    10 Posts 5 Posters 910 Views 5 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • G Offline
      geda
      last edited by

      Hello,
      I am using a lopy4 and a pysense board and would like to mesure temperature and pressure and send them using lorawan.
      After sending the data, I would like to go to deepsleep and be waked up in case of an interrupt.
      Should I use machine.deepsleep() or the pysense.go_to_sleep() method ? which method generate the lowest current in deepsleep modus ?

      J 1 Reply Last reply Reply Quote 0
      • J Offline
        jcaron @geda
        last edited by

        @geda what interrupt do you want to wake up on?

        G 1 Reply Last reply Reply Quote 0
        • R Offline
          randomrnti
          last edited by

          Did a quick search and the link below looks to be roughly what you're after. The pysense.go_to_sleep() looks to use significantly less current.

          https://forum.pycom.io/topic/1589/deep-sleep-summary

          J 1 Reply Last reply Reply Quote 0
          • J Offline
            jcaron @randomrnti
            last edited by

            @randomrnti With a LoPy4, there's a choice between using the "native" machine.deepsleep and the Pysense-controlled deep-sleep. Using one or the other depends on the exact scenario (including the wake-up source).

            Note that wake-on-pin using Pysense-controlled deep sleep requires a pin to be cut on the LoPy, otherwise it's very unreliable in my experience.

            Wake on move/shake is quite power-hungry, last I heard.

            1 Reply Last reply Reply Quote 0
            • P Offline
              Paul Thornton
              last edited by

              You'll want the go_to_sleep() version.

              1 Reply Last reply Reply Quote 0
              • G Offline
                geda @jcaron
                last edited by

                @jcaron I just need to be waked up when the user press a button, that means
                when an input pin goes high. I don't need any pysense specific to be waked up.

                J 1 Reply Last reply Reply Quote 0
                • J Offline
                  jcaron @geda
                  last edited by

                  @geda the Pysense-controlled Deep Sleep has the advantage that it will (under the right conditions) make sure that all sensors on the Pysense are powered down as well, not only the LoPy 4.

                  If wake up on the built-in Pysense button is fine for you, I believe you can use that one without a problem.

                  If you need to wake up on a different pin, trouble starts. There’s only one pin on the pysense I/O header you can use for wake-up, but it’s connected to both the PIC on the Pysense and the LoPy 4. When the Pysense puts the LoPy 4 to sleep, it actually powers it off completely, and the pin ends up being pulled down or something similar, which interferes with the observed voltages, and entering/exiting deep sleep will lead to spurious interrupts. If you want to avoid those you’ll have to cut/isolate one of the pins of the LoPy 4. I wrote out the details in another thread in the forum a while ago.

                  Note that you also need the latest Pysense firmware (0.0.8 or newer).

                  Alternatively, you could just use machine.deepsleep and make sure you power down all the sensors beforehand (probably need to talk to the PIC directly to do that, but you should find relevant pointers in the Pysense library). You can then wake up on any of LoPy 4 pins you want.

                  YMMV, let us know how things work out for you.

                  John BairdJ 1 Reply Last reply Reply Quote 0
                  • John BairdJ Offline
                    John Baird @jcaron
                    last edited by

                    @jcaron Does this pin clash apply to the GPy and FiPy as well, or only the LoPy?

                    J 1 Reply Last reply Reply Quote 0
                    • J Offline
                      jcaron @John Baird
                      last edited by

                      @john-baird I only experienced wit the LoPy (1), but I'm expecting the issue to be valid for all modules if you use Pysense-controlled deep sleep and want to wake on pin.

                      John BairdJ 1 Reply Last reply Reply Quote 1
                      • John BairdJ Offline
                        John Baird @jcaron
                        last edited by

                        @jcaron Thanks. I'm (literally) waiting for the glue to dry and then I'll be trying to wake from deepsleep on a GPy in a PySense. I'll let you know how it goes - but thanks for the information.

                        1 Reply Last reply Reply Quote 0

                        Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                        Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                        With your input, this post could be even better 💗

                        Register Login
                        • 1 / 1
                        • First post
                          Last post

                        Pycom on Twitter

                        Pycom