How to upload files to ESP32? How to get "production" ready?

All ESP32 boards running MicroPython.
Target audience: MicroPython users with an ESP32 board.
Post Reply
djcrunkmix
Posts: 1
Joined: Sun Oct 08, 2017 2:53 am

How to upload files to ESP32? How to get "production" ready?

Post by djcrunkmix » Sun Oct 08, 2017 3:00 am

Hey guys,

Such a nice thing, this MicroPython.

I am trying to wrap my head around the file system and how to upload files to my ESP32 board. I am trying to eventually build a production ready system (when Micropython is out of beta and things are a bit stable). However, I'd like to know a few things and pardon my lack of education here.

How to upload main.py and other libraries such as ssd1306.py?
- I tried searching the manual. It stops short after getting the REPL up and runnning. REPL is great for testing things out but for any serious project, we need to upload files. There should be a dedication section in the documentation IMHO. Perhaps I can help with a PR or two :). Anyhow, FAQ for ESP8266 mentions that I need to use WebREPL to achieve this.

Is there a way to upload files using the esptool.py? I uploaded the micropython bootloader at address x1000 to get the system up and running. Is there a convenient way to know where the bootloader stops and at what address we can upload another file? Is that even possible with esptool.py - i.e. uploading .bin and a couple of .py files (main.py and ssd1306.py)?

How to get everything production ready?
- Say I have my project ready to rock and roll. How can I generate a bootloader + application bin file to upload using esptool.py?

Thanks guys!

User avatar
Roberthh
Posts: 3667
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: How to upload files to ESP32? How to get "production" ready?

Post by Roberthh » Sun Oct 08, 2017 9:47 am

There are a few tools around which you can use to load files when the REPL is ready with the standard firmware, like
Dave Hylands rshell, Adafruits ampy, mpfshell, and others.
You can also embed your code into the firmware, once you are set to build your own firmware image. Just place your code into the modules subdirectory and 'make' the firmware. The modules are not visible in the files system, but you can import (and run) them.

Capstan
Posts: 117
Joined: Sun Jan 29, 2017 4:03 pm
Location: Texas, USA

Re: How to upload files to ESP32? How to get "production" ready?

Post by Capstan » Tue Oct 10, 2017 5:04 pm

I use ampy, pretty straightforward to move files with it to the on-board filesystem over a serial connection. Also can list the files there and delete them. The firmware looks for a 'main.py' file and will run it if found, so that's one way to get your app booted. After you have your filesystem-resident code running and debugged, you can embed the files into the firmware as roberthh mentioned.

Post Reply