2018-12-02 19:56:27 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
SERIAL_PORT=/dev/ttyUSB0
|
|
|
|
#SERIAL_PORT=/dev/tty.SLAB_USBtoUART
|
|
|
|
#SERIAL_PORT=/dev/tty.wchusbserial1410
|
|
|
|
|
|
|
|
all: flash delay libs config update reset
|
|
|
|
upload: config update reset console
|
2019-11-08 16:00:06 +00:00
|
|
|
files: delete libs update config delay reset
|
2018-12-02 19:56:27 +00:00
|
|
|
|
|
|
|
delay:
|
|
|
|
sleep 3
|
|
|
|
|
|
|
|
reset:
|
|
|
|
esptool.py -p $(SERIAL_PORT) --after hard_reset read_mac
|
|
|
|
picocom -b 115200 $(SERIAL_PORT)
|
|
|
|
|
|
|
|
libs:
|
|
|
|
ampy -p $(SERIAL_PORT) put uwebsockets.py
|
|
|
|
ampy -p $(SERIAL_PORT) put debounce.py
|
|
|
|
|
|
|
|
update:
|
|
|
|
ampy -p $(SERIAL_PORT) put hal.py
|
|
|
|
ampy -p $(SERIAL_PORT) put main.py
|
|
|
|
ampy -p $(SERIAL_PORT) put boot.py
|
|
|
|
|
2019-11-08 16:00:06 +00:00
|
|
|
delete:
|
|
|
|
ampy -p $(SERIAL_PORT) rm main.py
|
|
|
|
|
2018-12-02 19:56:27 +00:00
|
|
|
config:
|
|
|
|
ampy -p $(SERIAL_PORT) put config.json
|
|
|
|
|
|
|
|
flash:
|
|
|
|
esptool.py -p $(SERIAL_PORT) --chip esp32 -b 115200 erase_flash
|
|
|
|
esptool.py -p $(SERIAL_PORT) --chip esp32 -b 115200 write_flash --flash_mode dio 0x1000 esp32-*.bin
|
|
|
|
|
|
|
|
console:
|
|
|
|
echo "Ctrl-A + Ctrl-Q to close Picocom"
|
|
|
|
picocom -b 115200 $(SERIAL_PORT)
|