# How to make everything work from scratch

# Make sure the battery is connected, otherwise the board will reboot all the time and everything you try will fail.

# grab latest micropython version from http://micropython.org/download/esp32/
wget https://micropython.org/resources/firmware/esp32-idf3-20200609-unstable-v1.12-513-g51fd6c977.bin

# flash micropython image (disconnect serial console first)
esptool --chip esp32 --port /dev/ttyUSB0 write_flash -z 0x1000 esp32-idf3-20200609-unstable-v1.12-513-g51fd6c977.bin

# download demo files
wget https://www.geekabit.nl/projects/wedding-gift-sprite/downloads/firmware/v2/main.py https://www.geekabit.nl/projects/wedding-gift-sprite/downloads/firmware/v2/demo.py https://www.geekabit.nl/projects/wedding-gift-sprite/downloads/firmware/v2/groom/config.py

# upload python files (kill any running programmes and disconnect serial console first)
ampy --port /dev/ttyUSB0 put config.py
ampy --port /dev/ttyUSB0 put main.py
ampy --port /dev/ttyUSB0 put demo.py

# reboot and enjoy the blinking


# to connect to serial console
minicom -D /dev/ttyUSB0 -b115200
# send ctrl-C to stop running program
# exit with ctrl-a q

# alternatively
screen /dev/ttyUSB0 115200
# exit with ctrl-a \
