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

    Run script on boot for LopY

    Scheduled Pinned Locked Moved LoPy
    9 Posts 3 Posters 3.9k Views 3 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.
    • G Offline
      gouao
      last edited by

      Hi,

      My wish is to run a script on the boot of the LoPy, when I plug it in USB for example, without any action of the user.

      The LoPy is not running boot.py file when it is plugged to a power source ? What is the best way to do ?

      All the best.

      L 1 Reply Last reply Reply Quote 0
      • L Offline
        livius @gouao
        last edited by livius

        @gouao

        sequence is as follow:

        1. you plug power
        2. boot.py
        3. main.py

        think about people first, then computers

        G 1 Reply Last reply Reply Quote 0
        • G Offline
          gouao @livius
          last edited by

          @livius said in Run script on boot for LopY:

          @gouao

          sequence is as follow:

          1. you plug power
          2. boot.py
          3. main.py

          Sure, so the lopy should run boot.py and main.py after plugging power.
          But it doesn't

          L 1 Reply Last reply Reply Quote 0
          • I Offline
            iber
            last edited by

            @gouao if the board isn't behaving as it should, best thing to do is reflash the latest firmware.

            1 Reply Last reply Reply Quote 0
            • L Offline
              livius @gouao
              last edited by

              @gouao
              can you conect to it by COM - e.g. by putty
              and send os.uname()?

              If yes then it run boot.py (if you have it default)

              think about people first, then computers

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

                I suppose that you modify boot.py and have error inside
                then you do not know that it is tried to run without succesfull

                better is to put something in main.py
                then you can see output about error in UART repl - e.g. in putty

                think about people first, then computers

                1 Reply Last reply Reply Quote 1
                • G Offline
                  gouao @livius
                  last edited by

                  @livius said in Run script on boot for LopY:

                  @gouao
                  can you conect to it by COM - e.g. by putty
                  and send os.uname()?

                  If yes then it run boot.py (if you have it default)

                  There you go :
                  "(sysname='LoPy', nodename='LoPy', release='1.3.0.b1', version='v1.8.6-379-gc44eb ac on 2017-01-13', machine='LoPy with ESP32')"

                  L 1 Reply Last reply Reply Quote 0
                  • L Offline
                    livius @gouao
                    last edited by

                    @gouao
                    as you can see your boot file was run - because you have repl
                    did you try my advice from second post - to put code not to boot.py only inside main.py and see if you do not got script error?

                    think about people first, then computers

                    G 1 Reply Last reply Reply Quote 0
                    • G Offline
                      gouao @livius
                      last edited by

                      @livius said in Run script on boot for LopY:

                      @gouao
                      as you can see your boot file was run - because you have repl
                      did you try my advice from second post - to put code not to boot.py only inside main.py and see if you do not got script error?

                      Only the COM commection argumens in the boot.py, and the script in main.py.
                      What the sync is really doing on the project ?

                      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