Copy script file to board

General discussions and questions abound development of code with MicroPython that is not hardware specific.
Target audience: MicroPython Users.
Post Reply
Terrence
Posts: 13
Joined: Thu Aug 18, 2016 6:40 pm

Copy script file to board

Post by Terrence » Thu Aug 18, 2016 6:57 pm

I have just flashed my ESP8266 board from my Windows 10 PC.

How do I push my script file to the feather and have it run every time the board is started?

Thank you.
Last edited by Terrence on Fri Aug 19, 2016 3:34 am, edited 2 times in total.

shaoziyang
Posts: 363
Joined: Sun Apr 17, 2016 1:55 pm

Re: Copy script file to board

Post by shaoziyang » Fri Aug 19, 2016 2:01 am

You can using:

[*]webrepl_cli
[*]mpfshell
[*]uPyLoader

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: Copy script file to board

Post by pythoncoder » Fri Aug 19, 2016 5:58 am

I've mainly used webrepl http://docs.micropython.org/en/latest/e ... ive-prompt and mu http://forum.micropython.org/viewtopic.php?f=15&t=2182. The former works via a web browser and works whether the device is in station mode or access point mode. mu works via a USB serial connection.

To run your code at boot first debug your module at the REPL. Once you have a working module - say mymodule.py with a function run - create a file main.py with the following contents and copy it to the device.

Code: Select all

import mymodule
mymodule.run()
Peter Hinch
Index to my micropython libraries.

Terrence
Posts: 13
Joined: Thu Aug 18, 2016 6:40 pm

Re: Copy script file to board

Post by Terrence » Fri Aug 19, 2016 1:54 pm

Thank you for that explanation @pythoncoder.

And @shaoziyang thank you for your suggestions.

Post Reply