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

    Improve boot time

    Scheduled Pinned Locked Moved LoPy
    lopy4powerlow powerduty cycleboot time
    19 Posts 7 Posters 2.5k Views 9 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
      jcaron @sslupsky
      last edited by

      @sslupsky See my answer in the other thread.

      Your 14-15 seconds include:

      • 10 seconds deep sleep
      • boot time
      • LoRaWAN send time (not much, you're at SF7, so less than 100 ms)
      • RX1 and RX2 (at least 2 seconds, possibly more if the network sends a higher RX delay)
      • possibly receive time

      Your boot time is thus at most 3 seconds, not 4.5...

      Why are you touching Bluetooth? IIRC there's no need to.

      S 1 Reply Last reply Reply Quote 0
      • C Offline
        crumble @sslupsky
        last edited by

        @sslupsky

        Switch off your debug_print. Sending the text over the serial needs time. Addtional there is an unecessary sleep after the prrint.

        1 Reply Last reply Reply Quote 0
        • S Offline
          sslupsky @jcaron
          last edited by sslupsky

          @jcaron Somewhere here I recall someone said to disable bluetooth to minimize power. I updated my code to remove the Bluetooth and that shaved about 0.4 sec from the boot it seems.

          I added a timer that starts at the beginning of main and stops at the end just before the sleep. I timed the loop with the debug on which was 18.6 sec. The timer reported 6.6 sec in main. Using these figures it appears the boot time is 18.6 - 6.6 - 10 = 2.0 sec. There is about 0.4 sec delay so factoring that indicates boot time is about 1.6 sec.

          Thanks for the feedback.

          J 1 Reply Last reply Reply Quote 1
          • J Offline
            jcaron @sslupsky
            last edited by

            @sslupsky 3 seconds still seems to be a bit long, but I have no experience with the LoPy 4, only the original LoPy.

            Also, check the firmware release announcement threads, I believe someone mentioned one of the versions increasing boot time, not sure if that was fixed since then (and/or if that was in the stable or dev versions). Which firmware version are you running BTW?

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

              @jcaron I tested the boot time on a LoPy4 and a LoPy1 as the time between the rising edge of Reset and a Pin pulse cause by a few lines in boot.py. This time is 1.97 seconds. From then on, control is by the user scripts.

              S 1 Reply Last reply Reply Quote 0
              • S Offline
                Sympatron @robert-hh
                last edited by

                @robert-hh said in Improve boot time:

                @jcaron I tested the boot time on a LoPy4 and a LoPy1 as the time between the rising edge of Reset and a Pin pulse cause by a few lines in boot.py. This time is 1.97 seconds. From then on, control is by the user scripts.

                Does that mean that ~2s is the absolute minimum boot time or do you know of any why to speed it up it further?
                Is the boot time for LoPy1 and 4 the same?

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

                  @sympatron As far as I can tell, this is the minimum boot time, unless you start to tweak the firmware. And to my surprise, lopy1 and lopy4 are the same. I should say, that the firmware version is 1.18.1.r1.

                  1 Reply Last reply Reply Quote 0
                  • D Offline
                    danielm
                    last edited by

                    This is the thread where I described the issue with boot time being longer for FW 1.18.0 in comparison to FW 1.14.0.b1 while running the same code:
                    https://forum.pycom.io/topic/3377/fw-1-18-0-increased-boot-time-power-consumption

                    I did not perform tests with development FW 1.19.0 yet and the source of the issue remains unclear.

                    J 1 Reply Last reply Reply Quote 1
                    • J Offline
                      jcaron @danielm
                      last edited by

                      @danielm Thanks.

                      There was indeed a 300 ms increase in boot time between the two, but the total boot time remained under a second.

                      I wonder how long it actually takes to load and compile a relatively simple script such as OP's, and how long it takes for the various imports.

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

                        @jcaron Just for completion other boot times:

                        • WIPy3 (clone): ~1.8 s.
                        • FiPy: ~1.95 s

                        So it#s all in the same range.

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

                          @robert-hh Can you reproduce @danielm 's second test in that thread? I'm surprised he got about 500 or 800 ms depending on the firmware version and you get nearly 2 seconds. Unless you're importing some module that really takes a long time to load, but he already had imports of machine, pycom and os.

                          @danielm What device where you using in those tests? I guess a LoPy or LoPy 4?

                          robert-hhR D 3 Replies Last reply Reply Quote 0
                          • robert-hhR Offline
                            robert-hh @jcaron
                            last edited by robert-hh

                            @jcaron The only import I had is machine for the Pin to signal the presence of boot. And obviously the stuff from _boot.py:

                            # _boot.py -- always run on boot-up, even during safe boot
                            import os
                            from machine import UART
                            os.dupterm(UART(0, 115200))
                            

                            I removed that and got 1.77 seconds.
                            Now, with these line, the LoPy4 shows 1.87 seconds. But after all, not a big variation.

                            1 Reply Last reply Reply Quote 0
                            • D Offline
                              danielm @jcaron
                              last edited by

                              @jcaron
                              I think it was L01 because the application from the first post in that thread was written for sensor based on L01.

                              In all tests the application was frozen during firmware build time.

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

                                @jcaron With version 1.14.0.b1 I get 1.6 seconds.

                                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