1
0
Fork 0
jebbatime/scripts/jebbatime-dev-flash-release

37 lines
832 B
Bash
Executable File

#!/bin/bash
# Need to be in root dir of jebbatime git archive.
# Get config
. ~/.config/jebbatime.conf
cd $JEBBATIMEGITROOT
# Download latest release. XXX better link to latest.
rm -f /tmp/micropython-dev.zip
wget -O /tmp/micropython-dev.zip \
https://spacecruft.org/attachments/84fb3527-4ef1-47e4-8a55-ef55688ed05f
# Reboot thang into bootloader
echo "Rebooting development PineTime watch into bootloader..."
./tools/wasptool \
--verbose \
--bootloader \
--device $JEBBATIMEDEVMAC
echo "Waiting..."
sleep 4
# Flash
echo "Flashing, will take ~5 minutes..."
./tools/ota-dfu/dfu.py \
--legacy \
--verbose \
--address=$JEBBATIMEDEVDFUMAC \
--zip=/tmp/micropython-dev.zip
sleep 1
echo "Setting time on watch"
./tools/wasptool \
--rtc \
--device $JEBBATIMEDEVMAC