Navigation

    Welcome to the Pycom forum

    Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    1. Home
    2. Tags
    3. main.py
    Log in to post

    • N

      Problems with the files names "boot" and "main" and rebooting device
      FiPy • fipy pymakr boot.py main.py reboot problem • • nervencid  

      3
      0
      Votes
      3
      Posts
      373
      Views

      robert-hh

      @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.
    • K

      The 4s blue flash blues
      GPy • gpy deepsleep main.py • • kjm  

      8
      0
      Votes
      8
      Posts
      753
      Views

      K

      @reidfo No I've got everything in try/except loops so it can't crash. This is always when it wakes from deepsleep, instead of running boot or main .py it jumps into dreaded 4s blue flash mode. Grim!
    • Thosch42

      L01 does not run boot.py or main.py
      LoPy • boot.py l01 main.py • • Thosch42  

      2
      0
      Votes
      2
      Posts
      502
      Views

      Thosch42

      It's fixed!! See post Problems getting L01 into bootloader mode. Cheers, Thomas
    • G

      NameError: name '​' is not defined when upload the "Lopy to Lopy" example
      MicroPython • fipy lora micropython atom main.py • • grideagle  

      3
      0
      Votes
      3
      Posts
      1022
      Views

      dan

      Hi @grideagle, Thank you for reporting that, I've reported it to GitBook. The current workaround is to use the "copy" button it the top right corner of the code section.
    • F

      How do I get main.py to run when the WiPy board boots?
      WiPy 2&3 • wipy bug error main.py boot • • flatmop  

      19
      0
      Votes
      19
      Posts
      2864
      Views

      T

      @dan Yep I have never put anything in boot.py, have always had main.py run without intervention.
    • E

      W01 (2.0 equivalent) not executing boot.py and main.py
      WiPy 2&3 • boot.py main.py w01 • • Euphorbia  

      8
      0
      Votes
      8
      Posts
      1250
      Views

      A

      @dan Updating the firmware fixed the problem! Both main.py and boot.py run on restart. Thank you :)
    • T

      boot.py versus main.py
      Getting Started • deep sleep reset boot.py main.py • • tshead  

      11
      0
      Votes
      11
      Posts
      3390
      Views

      M

      @reidfo I use the boot.py to mount the SD card just once. When I mounted the SD card in the main.py I encountered OSError when re-running my code in the REPL (OSError: the requested operation is not possible) due to the fact that I cannot check the status of the SD card.
    • M

      How to interrupt executing main.py from lopy
      MicroPython • lopy interrupt main.py communication • • monersss  

      2
      0
      Votes
      2
      Posts
      1717
      Views

      robert-hh

      @monersss If you get access to the REPL, you can simply hit Ctrl-C. Otherwise you can use safeboot: Connect G28 with the 3v3 pni, and then push reset. When the LED turns orange, then disconnect the wire. The device will then not execute boot.py and main.py. The documentation talks about falling back to a series of previous versions, but that is nonsense on a Lopy
    • M

      Cant access main.py and boot.py in Lopy
      LoPy • lopy boot.py main.py • • monersss  

      1
      0
      Votes
      1
      Posts
      889
      Views

      No one has replied

    • 1 / 1