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

    wake up from deep sleep

    Scheduled Pinned Locked Moved LoPy
    10 Posts 3 Posters 50 Views 3 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
      Gaurav Rajput
      last edited by

      Hi everyone,
      I want to wake up lopy4 in continuous interval of time for e.g. (wake on every 10 mins interval and check and then goes to deep sleep) and when waked up check the state and if condition meets it sends the data and if not then it goes to deep sleep again.
      I checked but there is not exactly defined any example to wake up from deep sleep. Kindly help me ?
      One more is I used internal RTC to wake from deep sleep for a specific time? if yes then give me some example.

      robert-hhR 1 Reply Last reply Reply Quote 0
      • robert-hhR Offline
        robert-hh @Gaurav Rajput
        last edited by robert-hh

        @Gaurav-Rajput You can use machine.deepsleep(10*60*1000) for a 10 minute sleep. After that time, the board will do a full restart. So the statement after the call to deepsleep will not be executed. You have to check machine.wake_reason() to tell, whether this was caused by wake after sleeping.

        J G 2 Replies Last reply Reply Quote 0
        • J Offline
          jcaron @robert-hh
          last edited by

          @robert-hh you forgot to quote the code so it went askew…

          G 1 Reply Last reply Reply Quote 0
          • G Offline
            Gaurav Rajput
            last edited by

            I want to wake from sleep for 10 mins and then again it goes to sleep for long time.

            Is there any wake up methods for lopy4 other than Pins

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

              @jcaron deep sleep working fine with lopy4 but i want to wake up from deep sleep like rtc works in esp32 .

              robert-hhR 1 Reply Last reply Reply Quote 0
              • robert-hhR Offline
                robert-hh @Gaurav Rajput
                last edited by

                @Gaurav-Rajput So you want the device to wake up at a certain time of the day?

                1 Reply Last reply Reply Quote 0
                • G Offline
                  Gaurav Rajput @robert-hh
                  last edited by

                  @robert-hh yes sir, like rtc timer wakes up with ESP32

                  robert-hhR 1 Reply Last reply Reply Quote 0
                  • robert-hhR Offline
                    robert-hh @Gaurav Rajput
                    last edited by

                    @Gaurav-Rajput As far as I know, that's not available in the Pycom firmware. Just a deepsleep for a given time. So you have to calculate the sleep time based on the actual time and the intended wake-up time.
                    You can use time.gmtime() and time.mktime() for that. What I do not know is, whether the sleep time given in deepsleep() spans a full day (86400000).

                    G 1 Reply Last reply Reply Quote 0
                    • G Offline
                      Gaurav Rajput @robert-hh
                      last edited by

                      @robert-hh if I write deepsleep() it means goes to sleep for infinity time and the scenario is like normally lopy4 is in deepsleep mode continuously and wake up only at the set of defined time and sends the data. i need to do like that.

                      robert-hhR 1 Reply Last reply Reply Quote 0
                      • robert-hhR Offline
                        robert-hh @Gaurav Rajput
                        last edited by

                        @Gaurav-Rajput machine.deepsleep(sleep_time_ms) is what you can use.

                        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