Building micropython for esp8266 & pybd boards.
Setting up the tool chains for the esp8266 on mac was a pain, so I am using a Vagrantfile
to manage a VM with the tools.
Create a VM with the virtualbox
provider by using vagrant up
.
The scripts provisioning the image and building the firmware are in providers
.
The VM will mount the folder containing the Vagrantfile
as sources
directory, and copy firmware images into it.
To build the firmware use vagrant provision --provision-with build-image
.
Python sources that should be baked into the firmware can be added to modules
.
If sources from a different location should be added these can be added to manifest.py
.
Install micropython on an esp8266 board:
Steps to follow (backup first!):
pip3 install esptool
esptool.py --port /dev/tty.usbserial* read_mac
esptool.py --port /dev/tty.usbserial* erase_flash
esptool.py --port /dev/tty.usbserial* --baud 460800 write_flash --flash_size=detect 0 <firmware.bin>
Use pydfu.py from micropython:
pip3 install pyusb pyserial
python3 pydfu.py -u <firmware.dfu>
# -- or via build if mapped to the image --
make BOARD=PYBD_SF2 deploy