Add flashing script

This commit is contained in:
TJ Horner
2023-02-26 13:10:26 -08:00
parent 4f3b5acf58
commit a0602c1201

12
tools/oem-flash.sh Executable file
View File

@@ -0,0 +1,12 @@
#!/bin/bash
MAC_ADDR=$(esptool.py --chip esp32 read_mac | sed -En "s/MAC: (.*)/\1/p" | uniq | sed 's/://g')
esphome upload --device /dev/cu.usbserial* ../firmware/stock.yaml
if ! command -v cp210x-cfg &> /dev/null
then
# Get cp210x-cfg from https://github.com/DiUS/cp210x-cfg
echo "cp210x-cfg was not found; CP2102 will not be serialized or renamed"
else
cp210x-cfg -N "Upsy Desky" -S $MAC_ADDR
fi