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 Timer Accuracy

    Scheduled Pinned Locked Moved Firmware
    esp32lopy
    3 Posts 2 Posters 965 Views 2 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
      JuanMa
      last edited by

      Would it be possible to know which clock is used with pysense go_to_sleep(self,gps=True) function after setup_sleep(self, time_s) function has been used? I am using Pysense deepsleep on a Lopy4 and the accuracy of the deepsleep timer is terrible. I am talking about 30s error on a 300s interval.

      Could it be related with Esp32 clock frequency (I really doubt it since pysense disconnects the esp32 on deepsleep)? I have changed that frequency to 80MHz in order to save power.

      Thanks,
      JuanMa

      1 Reply Last reply Reply Quote 0
      • catalinC Offline
        catalin
        last edited by catalin

        Hi,
        The clock source for the time interval, set by pytrack.setup_sleep(time_seconds) is the Pic microcontroler, from Pysense.
        But it's adjusted with the ESP32 clock; so if esp32 clock is changed, we could have some big error, indeed.
        Could you quickly check if leaving esp32 at 160Mhz, this error persists?
        This micropython method makes the calibration between the 2 clocks.
        https://github.com/pycom/pycom-libraries/blob/ce0cfa57b06b3ef58a08d98bf7a33c6a7cffa4e2/lib/pycoproc/pycoproc.py#L229
        <later edit> but if esp32 clock is 2 times slower, the 300 sec, should transform in ~600sec, not 250sec.

        Catalin,

        Have you checked out our docs for the answer? (Now with an easy search function) https://docs.pycom.io
        Check out our newly revamped device management platform, Pybytes! https://pybytes.pycom.io/

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

          Hi @catalin

          Sorry I couldn't answer before. If the esp32 frequency is 160MHz the pysense timer works fine, it only has trouble when the frequency is changed. I am going to measure the error better to see if there is a clear relation between the frequency change and the timer error.

          Thanks,

          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