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

37 lines
812 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.zip
wget -O /tmp/micropython.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 $JEBBATIMEMAC
echo "Waiting..."
sleep 4
# Flash
echo "Flashing, will take ~5 minutes..."
./tools/ota-dfu/dfu.py \
--legacy \
--verbose \
--address=$JEBBATIMEDFUMAC \
--zip=/tmp/micropython.zip
sleep 1
echo "Setting time on watch"
./tools/wasptool \
--rtc \
--device $JEBBATIMEMAC