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

    RTC/utime issues in 1.20.2.r2

    Scheduled Pinned Locked Moved Issues & Bugs
    6 Posts 4 Posters 160 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.
    • T Offline
      troy salt
      last edited by

      Since updating to 1.20.2.r2 from 1.20.2.r0 it seems there are some strange issues going on between rtc and utime. It seems they are disconnected in some ways, and switched in others...

      For instance, the command rtc.init() effects utime commands but does not effect rtc.
      ie:

      >>> from machine import RTC
      >>> import utime
      >>> rtc=RTC()
      >>> rtc.now()
      (1970, 1, 1, 0, 2, 24, 162482, None)
      >>> 
      >>> rtc.now()
      (1970, 1, 1, 0, 2, 24, 168121, None)
      >>> rtc.init((2014, 5, 1, 4, 13, 0, 0, 0))
      >>> rtc.now()
      (1970, 1, 1, 0, 2, 24, 180033, None)
      >>> utime.gmtime()
      (2014, 5, 1, 4, 13, 1, 3, 121)
      

      You can see that the init command set the time for utime, but not for rtc.

      Furthermore, if I use ntp_sync with rtc, it only syncs the rtc time, and completely messes up the utime:

       >>> rtc.ntp_sync('de.pool.ntp.org')
      >>> rtc.now()
      (2020, 12, 2, 2, 42, 27, 478607, None)
      >>> utime.gmtime()
      (2065, 4, 1, 6, 55, 26, 2, 91)
      

      Does anyone have any idea what's going on here?

      Thanks,
      Troy

      1 Reply Last reply Reply Quote 0
      • A Offline
        Avathar
        last edited by

        Sadly i don't know whats going on, but I'm in the same boat.
        I've reverted to 1.20.1 for the meantime.

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

          Hi,
          Thanks for informing us about the issue. It seems to be related to the issue described here: https://forum.pycom.io/topic/6289/new-release-candidate-1-20-2-rc11-for-pygate. As we merged the pygate sourcecode into the same branch, we also copied over the bug, we are currently working on fixing the issue!
          Gijs

          1 Reply Last reply Reply Quote 1
          • T Offline
            troy salt
            last edited by

            I temporarily got around it by adding rtc.init(rtc.now()) after using an ntp sync. This is a total bandaid fix, but it works for now.

            Also I noticed that the timezone is applied backwards now I used set timezone as -8, now it has to be +8. Thats fine with me, just noting this in case it was accidental.

            1 Reply Last reply Reply Quote 0
            • P Offline
              pevrard
              last edited by

              Hello Support Team,
              I was wondering if you can provide any timing to correct this bug ?
              Is there a new firmware release available that correct it ?
              or.. the downgrade looks to be the best option in the short time.
              Thanks for your kind help
              Regards
              Patrick

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

                This bug was fixed in the following version. If you update to the latest version using the firmware updater tool, the issue will be gone

                Best,
                Gijs

                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