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

    deepsleep maximum time

    Scheduled Pinned Locked Moved LoPy
    deepsleep
    22 Posts 7 Posters 6.3k Views 7 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.
    • D Offline
      dhk111 @seb
      last edited by

      @seb thank you for the reply.
      can you please tell me why 3 byte value.

      1 Reply Last reply Reply Quote 0
      • sebS Offline
        seb
        last edited by

        I don't think there is a specific reason why 3 bytes were chosen, that is just how the firmware on the deepsleep shield was created.

        1 Reply Last reply Reply Quote 0
        • L Offline
          livius @dhk111
          last edited by

          @dhk111
          just curious - why do you need to sleep board forever? I can not imagine design.

          think about people first, then computers

          D 1 Reply Last reply Reply Quote 0
          • D Offline
            dhk111 @livius
            last edited by

            @livius I am measuring temperature from attiny85 if the temperature rises certain limit it would send signal on pin17 and lopy wakes do the needful and go to sleep until temperature rises again. So the period between successive temperature rises, may be less than 27.7 weeks or greater. During this period, I need to lopy to sleep.

            sebS L S 3 Replies Last reply Reply Quote 0
            • sebS Offline
              seb @dhk111
              last edited by

              @dhk111
              I think it would be ok to sleep for 27.7 weeks and then wake up, check the wake reason, if it was not a pin change, go back to sleep. Waking twice a year is not really going to use a lot of power

              D 1 Reply Last reply Reply Quote 0
              • L Offline
                livius @dhk111
                last edited by

                @dhk111

                do the needful

                I am really curious :) what it do then, send message to the server?

                think about people first, then computers

                D 1 Reply Last reply Reply Quote 0
                • C Offline
                  combaindeft @seb
                  last edited by

                  @seb

                  Regarding Deepsleep mode, does one really have to use a "Deep Sleep Shield"?

                  I'm wondering, since the case we use is tight on space, and we only can fit a PyTrack & LoPy board inside the case ... could we do some sort of "deep sleep" mode with just the two? (without a deep sleep sheield...)

                  /Daniel

                  J J 2 Replies Last reply Reply Quote 0
                  • sebS Offline
                    seb
                    last edited by

                    With the LoPy/SiPy/WiPy2 the onboard regulator remains in a high performance mode even when the device does into sleep mode, hence the need for the additional board to externally disconnect the power. If you are tight on space I would recommend one of our newer boards (LoPy4/GPy/FiPy/WiPy3) which dont have this issue and work perfectly with just the eps32 deep sleep

                    C 1 Reply Last reply Reply Quote 1
                    • J Offline
                      jmarcelino @combaindeft
                      last edited by

                      This post is deleted!
                      1 Reply Last reply Reply Quote 0
                      • D Offline
                        dhk111 @seb
                        last edited by

                        @seb thank you. 27.7 weeks is more than enough for my project.

                        1 Reply Last reply Reply Quote 0
                        • D Offline
                          dhk111 @livius
                          last edited by

                          @livius needful= check if temperature is really high, then send mail,notification

                          L 1 Reply Last reply Reply Quote 0
                          • L Offline
                            livius @dhk111
                            last edited by

                            @dhk111
                            Ok, i assume that this notification is not critical?
                            Because you have not any info between wake up, that control device still is working.

                            think about people first, then computers

                            1 Reply Last reply Reply Quote 0
                            • C Offline
                              combaindeft @seb
                              last edited by

                              @seb

                              Then I guess, we'll have to go for a LoPy4 or FiPy :)

                              Thanks @seb

                              1 Reply Last reply Reply Quote 0
                              • S Offline
                                ssmith @dhk111
                                last edited by

                                @dhk111 You're going to have issues with this system design. A sensor need to periodically wake up and report in so you know it is still alive. Waiting 27 weeks for it to wake up and check in???

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

                                  @combaindeft if you use a Pytrack or Pysense you don’t necessarily need the deep sleep shield. The Pytrack and Pysense have equivalent functionality, though wake on pin is a bit more problematic.

                                  Of course if you use one of the newer boards you don’t need either.

                                  @seb are you sure about the 24-bit value being in seconds? On a mobile right now so I’m too lazy to check, but IIRC the value in seconds is multiplied by a calibration factor, and it’s the result which is sent on 24 bits. Don’t know the typical values of the calibration factor, but it can decrease the max time quite a bit (and you would certainly get an overflow if you tried to use 2^24-1)

                                  It would probably be a good idea to check for overflows in the library and document a sensible max time.

                                  While you’re in the docs, it would be helpful for many people to add details of the « external deep sleep » requirements in the machine.deepsleep docs.

                                  sebS C 2 Replies Last reply Reply Quote 0
                                  • sebS Offline
                                    seb @jcaron
                                    last edited by

                                    @jcaron

                                    You are correct, upon further investigation I now see that there is a clock calibration multiplier that will multiply the value given by a value in the the range 0.75 - 1.25, so yes the longest duration of deep sleep can vary slight on a per device basis. Also, like you pointed out, this is not bounds checked so this multiplier could overflow, I will fix this in the code now.

                                    In regards to the various deep sleeps, I agree the documentation around these features does need to be clearer. I am adding it to my to-do list

                                    1 Reply Last reply Reply Quote 1
                                    • C Offline
                                      combaindeft @jcaron
                                      last edited by

                                      @jcaron We bought a set of PyTracks & LoPy's in Januari ;)

                                      and wake on pin isn't that of a high priority for us ... we'd just like to put the device in "deepsleep mode" ... and have it wake up now-and-then ... and "check in" with some values ...

                                      so it doesn't have to "wake up" on pin from some other external sensor ... more or less we are ok with a "deepsleep cycle loop" :)

                                      Do you by any chance have some samples code?

                                      sebS 1 Reply Last reply Reply Quote 0
                                      • sebS Offline
                                        seb @combaindeft
                                        last edited by

                                        @combaindeft

                                        Since you are using the LoPy, you will need the deepsleep shield to have the deepsleep to work correctly. Examples on how to use it can be found here: https://docs.pycom.io/chapter/datasheets/boards/deepsleep/api.html

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

                                          @seb there's a Pytrack available, so no need for a deep sleep shield...

                                          @combaindeft are you using LoRa?

                                          Witout LoRa, the code is as simple as:

                                          • do whatever to need to do
                                          • setup_sleep
                                          • go_to_sleep

                                          With LoRa, you need to add nvram_restore and nvram_save.

                                          sebS 1 Reply Last reply Reply Quote 0
                                          • sebS Offline
                                            seb @jcaron
                                            last edited by

                                            @jcaron

                                            Sorry, yes you are correct, looks like I need a stronger morning coffee! @combaindeft The Pytrack has the same functionality as the deepsleep shield built in, the example code should be very similar and can be found here: https://docs.pycom.io/chapter/pytrackpysense/apireference/sleep.html

                                            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
                                            • 1 / 2
                                            • First post
                                              Last post

                                            Pycom on Twitter

                                            Pycom