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

    lopy4 RTC

    Scheduled Pinned Locked Moved LoPy
    lopy4
    10 Posts 5 Posters 1.1k Views 4 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.
    • A Offline
      abhishek2101
      last edited by

      Hi

      is there any internal RTC on lopy4 ?
      under which deep sleep mode the clock is available ?
      I am planning to use lopy4 for some battery powered projects which will be in the field for say about 18 months, can the clock keep track of day, months and year also ?
      is there any drift after say 1 year of usage ?

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

        Removed: Please see my above post.

        M A rcolisteteR 4 Replies Last reply Reply Quote 0
        • M Offline
          Martinnn @Paul Thornton
          last edited by

          @paul-thornton I have the impression that many people here are struggling with low power deep sleep designs. It would be great if pycom could provide some reference designs for a device that wakes up every xx minutes/hours, sends some data (like from an analog input) via Lora/Sigfox/LTE NB and runs off a battery (like a LiTCL D size https://ch.rs-online.com/web/p/d-batterien/6684550/ ) for a year or two.
          I guess this would cover a lot of applications one could imagine using the new low power long range networks.

          A 2 Replies Last reply Reply Quote 0
          • A Offline
            abhishek2101 @Paul Thornton
            last edited by

            @paul-thornton
            ntp is not an option.

            1 Reply Last reply Reply Quote 0
            • A Offline
              abhishek2101 @Martinnn
              last edited by

              @martinnn
              yes that is very much required @Paul-Thornton

              1 Reply Last reply Reply Quote 0
              • M Offline
                Milan @abhishek2101
                last edited by

                This post is deleted!
                1 Reply Last reply Reply Quote 0
                • A Offline
                  abhishek2101 @Martinnn
                  last edited by

                  @martinnn said in lopy4 RTC:

                  @paul-thornton I have the impression that many people here are struggling with low power deep sleep designs. It would be great if pycom could provide some reference designs for a device that wakes up every xx minutes/hours, sends some data (like from an analog input) via Lora/Sigfox/LTE NB and runs off a battery (like a LiTCL D size https://ch.rs-online.com/web/p/d-batterien/6684550/ ) for a year or two.
                  I guess this would cover a lot of applications one could imagine using the new low power long range networks.

                  I would much appreciate it above can be done.

                  1 Reply Last reply Reply Quote 0
                  • A Offline
                    abhishek2101 @Paul Thornton
                    last edited by

                    @paul-thornton is this is real time clock or real time counter ? Can this keep track of months and years also ?

                    1 Reply Last reply Reply Quote 0
                    • rcolisteteR Offline
                      rcolistete @Paul Thornton
                      last edited by

                      @paul-thornton AFAIK and tested, LoPy4 RTC isn't wiped during/after deepsleep with machine.deepsleep([time_ms]), as it is maintained powered on.

                      Unless the "py.go_to_sleep()" of Pysense, PyTrack, etc, is used, which cuts the power off the LoPy4 board.

                      My "MicroPython Samples". My "MicroPython Firmwares" with many options (double precision, ulab, etc).

                      P 1 Reply Last reply Reply Quote 2
                      • P Offline
                        Paul Thornton @rcolistete
                        last edited by

                        @rcolistete

                        I was incorrect in my previous posting.

                        When using a Pysense/Pytrack and the deepsleep functions available in there respective API's.
                        the main ESP32 processor is powered off and thus the RTC data is lost.

                        Example:
                        https://docs.pycom.io/pytrackpysense/apireference/sleep.html

                        #from pytrack import Pytrack
                        from pysense import Pysense
                        from LIS2HH12 import LIS2HH12
                        import time
                        
                        #py = Pytrack()
                        py = Pysense()
                        
                        # display the reset reason code and the sleep remaining in seconds
                        # possible values of wakeup reason are:
                        # WAKE_REASON_ACCELEROMETER = 1
                        # WAKE_REASON_PUSH_BUTTON = 2
                        # WAKE_REASON_TIMER = 4
                        # WAKE_REASON_INT_PIN = 8
                        
                        print("Wakeup reason: " + str(py.get_wake_reason()))
                        print("Approximate sleep remaining: " + str(py.get_sleep_remaining()) + " sec")
                        time.sleep(0.5)
                        # go to sleep for 5 minutes maximum if no accelerometer interrupt happens this will also lose the RTC data.
                        py.setup_sleep(300)
                        py.go_to_sleep()
                        

                        When using the API available in the machine library. The RTC data is retained during deepsleep.

                        import machine
                        machine.deepsleep(5000) # sleep for 5 seconds. and retain the RTC data.  this does not power off the esp32 but does put it in a very low power state
                        
                        1 Reply Last reply Reply Quote 1

                        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