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

    Problems with the files names "boot" and "main" and rebooting device

    Scheduled Pinned Locked Moved FiPy
    pymakrboot.pymain.pyfipyreboot problem
    3 Posts 3 Posters 373 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.
    • N Offline
      nervencid
      last edited by

      Hello:

      I'm following this tutorial:

      https://help.ubidots.com/connect-your-devices/connect-any-pycom-board-to-ubidots-using-wi-fi-over-http

      They suggest that i must name the files "boot.py" and "main.py" respectively, however if i copy and paste the code and run everything, it cannot be stoped in pymakr (or using the reset button), so i can't upload a new sketch again, and i must erase the entire board.

      So:

      1. There a stop button? Because Ctrl+C seems that don't work and the board run the script automatically over and over
      2. Can i use different names apart of "boot.py" and "main.py"? is recommendable use these names on scripts?

      Thank you

      C robert-hhR 2 Replies Last reply Reply Quote 0
      • C Offline
        combaindeft @nervencid
        last edited by

        @nervencid

        ### boot.py -- run on boot-up
        import os
        import machine
        from machine import UART
        uart = UART(0, 115200)
        os.dupterm(uart)
        
        print('-----------------------------------------------------------------------------')
        
        print('LOG: Boot Debug')
        machine.main('boot_debug.py')
        
        1 Reply Last reply Reply Quote 1
        • robert-hhR Offline
          robert-hh @nervencid
          last edited by

          @nervencid You can use any name for your scripts. Only boot.py and main.py are executed as part of the boot process. If you want to run your script then, you have to add a statement like:

          import myscript

          e.g. to main.py. You should be able to stop your script with Ctr-C from the console, unless you disable that in your code.

          To isolate the problems, try running your code with a simple terminal like Putty.

          Note: You can change the name of the file which is run instead of main.py with machine.main(). The only useful place for that command is in boot.py.

          1 Reply Last reply Reply Quote 1

          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