🤖Have you ever tried Chat.M5Stack.com before asking??😎
    M5Stack Community
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    Bug AtomS3 with UIFlow2 on library time

    UiFlow 2.0
    3
    15
    8.9k
    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.
    • IAMLIUBOI
      IAMLIUBO
      last edited by

      @flex

      Hi, did you check this time docs of micropython port?

      0_1686542095863_1cceab94-6e76-4b26-8dd3-5423f8a76b5f-image.png

      0_1686542112272_c742a3f5-e76c-46bb-8f83-82baab888585-image.png

      1 Reply Last reply Reply Quote 0
      • F
        flex
        last edited by

        @imaliubo

        yes I tried,

        it seems that UIFlow (based on 1.19.1) doesn't take epoch into account, which is year 2000 in MP 1.19.1 or 1.20.

        Apart that there is confusion created on gmtime() and localtime() in UIFlow apis.

        Also to mention that in MP 1.20, the returned values from gmtime() and localtime() are not all time reliable (sometimes the ntpserver requested in MP localtime() return what in fact is gmtime()...)

        1 Reply Last reply Reply Quote 0
        • F
          flex
          last edited by

          Hi dev Team,

          I made small test on Alpha17:

          • now "get UTC time" works correctly :)

          • There is problem when using "Set timezone GMTx":
            using "Set timezone GMT+2" and then "get local time", it should return UTC+2/GMT+2 but it return UTC-2/GMT-2

          • There is still problem with "get system uptime in seconds" which is not adjusted to epoch 2000 and returns a very big value

          Thanks

          IAMLIUBOI 2 Replies Last reply Reply Quote 0
          • IAMLIUBOI
            IAMLIUBO @flex
            last edited by

            @flex

            There is problem when using "Set timezone GMTx":
            using "Set timezone GMT+2" and then "get local time", it should
            return UTC+2/GMT+2 but it return UTC-2/GMT-2

            honestly, I was confused at first, but i saw this link, it explain why the time zone is reversed:https://stackoverflow.com/questions/53076575/time-zones-etc-gmt-why-it-is-other-way-round

            There is still problem with "get system uptime in seconds" which is not adjusted to epoch 2000 and returns a very big value

            ok, thanks for report, will check this and fix.

            1 Reply Last reply Reply Quote 1
            • IAMLIUBOI
              IAMLIUBO @flex
              last edited by

              @flex

              Sorry, last update(aplha-17) we change the epoch time from "2000-01-01" ot "1970-01-01".So "get system uptime in seconds" block return is tiem stamp from 1970-01-01. And use "1970-01-01" as epoch is more compatible.

              F 1 Reply Last reply Reply Quote 1
              • F
                flex
                last edited by

                I think that Micropython use epoch 2000 by default

                IAMLIUBOI 1 Reply Last reply Reply Quote 0
                • ajb2k3A
                  ajb2k3
                  last edited by

                  @IAMLIUBO I'm getting an issue with time with 1.11.9 both the core and core 2 are showing an error with time "Module Time has no attribute"

                  UIFlow, so easy an adult can learn it!
                  If I don't know it, be patient!
                  I've ether not learned it or am too drunk to remember it!
                  Author of the WIP UIFlow Handbook!
                  M5Black, Go, Stick, Core2, and so much more it cant be fit in here!

                  IAMLIUBOI 1 Reply Last reply Reply Quote 0
                  • F
                    flex @IAMLIUBO
                    last edited by

                    @iamliubo
                    Hi
                    System uptime in seconds should return 0 when the system (m5stack ….S3) starts, nobostand epoch 1970 or 2000…

                    IAMLIUBOI 1 Reply Last reply Reply Quote 0
                    • IAMLIUBOI
                      IAMLIUBO @flex
                      last edited by

                      @flex yes, we change to 1970

                      1 Reply Last reply Reply Quote 0
                      • IAMLIUBOI
                        IAMLIUBO @ajb2k3
                        last edited by

                        @ajb2k3 can you show me the code?

                        ajb2k3A 1 Reply Last reply Reply Quote 0
                        • IAMLIUBOI
                          IAMLIUBO @flex
                          last edited by

                          @flex said in Bug AtomS3 with UIFlow2 on library time:

                          @iamliubo
                          Hi
                          System uptime in seconds should return 0 when the system (m5stack ….S3) starts, nobostand epoch 1970 or 2000…

                          When boot up, if device connect to wifi will auto sync the time from ntp server, and time.time() this function will overwritten by new time.

                          1 Reply Last reply Reply Quote 0
                          • ajb2k3A
                            ajb2k3 @IAMLIUBO
                            last edited by

                            @iamliubo said in Bug AtomS3 with UIFlow2 on library time:

                            @ajb2k3 can you show me the code?

                            We solved it over Twitter

                            UIFlow, so easy an adult can learn it!
                            If I don't know it, be patient!
                            I've ether not learned it or am too drunk to remember it!
                            Author of the WIP UIFlow Handbook!
                            M5Black, Go, Stick, Core2, and so much more it cant be fit in here!

                            1 Reply Last reply Reply Quote 1
                            • K kimurer referenced this topic on
                            • First post
                              Last post