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

    Root causes of high deep sleep current [LoPy1, WiPy2 and SiPy], all the new modules **do not have deepsleep issues**

    Scheduled Pinned Locked Moved Announcements & News
    deepsleep
    127 Posts 48 Posters 110.6k Views 57 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.
    • J Offline
      jalperin
      last edited by

      Thank you @jcaron.

      Unfortunately, I remain where I started. I am unsure whether I am shutting down WiFi and Bluetooth (I read various posts), and I am unsure how to properly get both the pysense and lopy to deep sleep.

      Do I understand it correctly that I don't really need the deep sleep shield but I do need new libraries (that will show up in a few days and will hopefully contain examples)? If so, how does one shut off wifi and bluetooth?

      Thanks for your help.

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

        @jalperin With the Pysense board, you need to:

        • use the libraries that are available on github:
          https://github.com/pycom/pycom-libraries/tree/master/pysense/lib

        • add the following code:

          from pysense import Pysense
          py = Pysense()
          py.setup_sleep(number_of_seconds)
          py.go_to_sleep()
          

        This will tell the Pysense to stop the LoPy (including Wi-Fi, BT, LoRa...). It's actually powered off. It will be woken up after the given number of seconds has elapsed. Work is in progress to allow wake up on other conditions (some input going high for instance).

        At the moment, this will bring down power consumption to about 2.5 mA when running from a LiPo battery. Ultimately it should go down to a fraction of that once everything is correctly shut down.

        Note that when the LoPy comes out of deep sleep, it's as if it just rebooted. There are still issues with LoRa keeping state for instance.

        As the firmware turns on Wi-Fi when it starts, it's a good idea to stop it right away if you don't need it during the time the LoPy is awake. Not sure about Bluetooth (I stop it, but I'm not sure that's actually needed).

        Hope that helps.

        1 Reply Last reply Reply Quote 0
        • J Offline
          jalperin
          last edited by

          Thank you, @jcaron. Very helpful.

          I have been executing that code, but followed by machine.deepsleep(). I gather that is not necessary. Correct?

          So, lastly, exactly how does one turn off wifi and bluetooth (I've read different methods in this forum)?

          J 1 Reply Last reply Reply Quote 0
          • J Offline
            jmarcelino @jalperin
            last edited by

            @jalperin
            This works to turn off WiFi

            import network
            n = network.WLAN()
            n.deinit()
            

            Turning off Bluetooth would be similar but for network.Bluetooth() instead.
            However removing Bluetooth doesn't change anything in power consumption at the moment - but also it won't be on or consuming anything unless you had previously initialised Bluetooth() in your code. So it's actually better to do nothing at all for the Bluetooth side.

            1 Reply Last reply Reply Quote 1
            • J Offline
              jalperin
              last edited by

              Thanks jmarcelino.

              Does the below earlier comment of yours still apply?

              By the way I found that if I do:

              from network import WLAN
              wlan = WLAN(mode=WLAN.STA)
              power saving is enabled, but if I use this instead it doesn't:

              from network import WLAN
              wlan = WLAN()
              wlan.mode(WLAN.STA)

              1 Reply Last reply Reply Quote 0
              • C Offline
                chrisi
                last edited by

                If I order another Sipy now will the deep sleep feature be fixed or will I still need a shield?

                B 1 Reply Last reply Reply Quote 0
                • B Offline
                  bucknall @chrisi
                  last edited by

                  @chrisi you will need to order a shield - the SiPy can also use the Pytrack/Pysense to sleep as well.

                  Developer Evangelist - Pycom

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

                    @bucknall From what I understood, you will automatically receive a Deep Sleep Shield with any new orders. I know I received shields with the boards I ordered week before last.

                    B 1 Reply Last reply Reply Quote 1
                    • B Offline
                      bucknall @jcaron
                      last edited by

                      @jcaron That is correct, my wording was slightly confusing! If you order any of our devices (WiPy 2.0, LoPy or SiPy) you will automatically be sent a deep sleep shield.

                      Developer Evangelist - Pycom

                      T 1 Reply Last reply Reply Quote 1
                      • J Offline
                        jcaron @daniel
                        last edited by

                        @daniel said in Root causes of high deep sleep current:

                        @jcaron the reason for the higher current on the Pysense is because the sensors need to be disabled as part of the process of going to deepsleep. We will add that to the official library within the next few days.

                        Hi @daniel,

                        • is this actually confirmed to be a purely software issue?
                        • has there been any progress with the libraries? I've seen a few updates pushed on Monday, but I don't think they're relevant to this issue?

                        The other thing I really would like to see is the ability to wake on pins (and the related control of the pins connected to the PIC on the Pysense, which from what I understand will be the only pins which can used for wake up?)

                        Thanks,

                        Jacques.

                        1 Reply Last reply Reply Quote 2
                        • T Offline
                          tlntu @bucknall
                          last edited by

                          @bucknall My colleague and I have made total of 3 orders ( 7 LoPy development boards in total), but the deep sleep shield didn't come with our orders. May I know where can I order the deep sleep shield? I've contacted the support team, but haven't got any reply from them.

                          B 1 Reply Last reply Reply Quote 0
                          • B Offline
                            bucknall @tlntu
                            last edited by

                            Hi @tlntu,

                            I'm asking our sales team where the deep sleep shields are - could you please send me an email (alex@pycom.io) with your order number?

                            Thanks!

                            Alex

                            Developer Evangelist - Pycom

                            T A 2 Replies Last reply Reply Quote 0
                            • T Offline
                              tlntu @bucknall
                              last edited by

                              @bucknall I've sent an email to you with our order numbers.

                              1 Reply Last reply Reply Quote 1
                              • A Offline
                                avbalen @bucknall
                                last edited by

                                @bucknall
                                For the record: my deepsleep shields came in yesterday

                                1 Reply Last reply Reply Quote 1
                                • Y Offline
                                  yahia
                                  last edited by

                                  Just arrived today! Thanks

                                  1 Reply Last reply Reply Quote 1
                                  • D Offline
                                    daniel
                                    last edited by

                                    @jcaron and everyone. We have fixed the deepsleep current issue of the Pysense. As explained before, it was just a software thing (the pressure sensor needed to be powered down). Just use the new library: https://github.com/pycom/pycom-libraries/blob/master/pysense/lib/pysense.py

                                    And you'll enjoy a current of only 10uA during deepsleep :-)

                                    D J 2 Replies Last reply Reply Quote 1
                                    • D Offline
                                      dbrgn @daniel
                                      last edited by

                                      @daniel said in Root causes of high deep sleep current:

                                      @jcaron and everyone. We have fixed the deepsleep current issue of the Pysense. As explained before, it was just a software thing (the pressure sensor needed to be powered down). Just use the new library: https://github.com/pycom/pycom-libraries/blob/master/pysense/lib/pysense.py

                                      Great, thanks! :) Will test it tonight or tomorrow.

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

                                        @daniel Woohoo! Too bad I don't have my LoPys at hand to test right now, but I will do so as soon as I can.

                                        While you have your hands in there, any chance for wake on pin on the Pysense?

                                        Thanks!

                                        1 Reply Last reply Reply Quote 0
                                        • D Offline
                                          daniel
                                          last edited by

                                          While you have your hands in there, any chance for wake on pin on the Pysense?

                                          Coming soon (also for Pytrack)

                                          D 1 Reply Last reply Reply Quote 0
                                          • D Offline
                                            dbrgn @daniel
                                            last edited by

                                            @daniel said in Root causes of high deep sleep current:

                                            Coming soon (also for Pytrack)

                                            Great to hear. Do you already have information on which pins we'll be able to use for wakeup? I'm currently designing some hardware, and with that information I'd be able to order prototypes sooner.

                                            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
                                            • 2
                                            • 3
                                            • 4
                                            • 5
                                            • 6
                                            • 7
                                            • 3 / 7
                                            • First post
                                              Last post

                                            Pycom on Twitter

                                            Pycom