From edfb9f2803da37a73f1f0b113c7b9f99906bd320 Mon Sep 17 00:00:00 2001 From: ollo Date: Wed, 4 Mar 2020 20:54:00 +0100 Subject: [PATCH] Not forced to format ESP, when flashing serial --- tools/initialFlash.sh | 32 +++++++++++++++++++++++--------- 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/tools/initialFlash.sh b/tools/initialFlash.sh index b54d309..14e28ee 100755 --- a/tools/initialFlash.sh +++ b/tools/initialFlash.sh @@ -12,21 +12,35 @@ if [ ! -c $DEVICE ]; then fi -if [ $# -ne 1 ]; then +if [ $# -eq 0 ]; then echo "" - echo "e.g. usage $0 " + echo "e.g. usage $0 []" exit 1 fi -FILES="displayword.lua main.lua timecore.lua webpage.html webserver.lua wordclock.lua init.lua" +if [ $# -eq 1 ]; then + FILES="displayword.lua main.lua timecore.lua webpage.html webserver.lua wordclock.lua init.lua" +else + FILES=$2 +fi + # Format filesystem first -echo "Format the complete ESP" -$LUATOOL -p $DEVICE -w -b 115200 -if [ $? -ne 0 ]; then - echo "STOOOOP" - exit 1 -fi +#echo "Format the complete ESP" +#$LUATOOL -p $DEVICE -w -b 115200 +#if [ $? -ne 0 ]; then +# echo "STOOOOP" +# exit 1 +#fi + +echo "Reboot the ESP" +echo "node.restart()" >> $DEVICE +sleep 1 +for i in $(seq 0 5); do + echo "Stop TMR $i" + echo "tmr.stop($i)" >> $DEVICE + sleep 1 +done echo echo "Start Flasing ..."