Not forced to format ESP, when flashing serial

This commit is contained in:
ollo 2020-03-04 20:54:00 +01:00
parent 77ebc55dbb
commit edfb9f2803

View File

@ -12,21 +12,35 @@ if [ ! -c $DEVICE ]; then
fi
if [ $# -ne 1 ]; then
if [ $# -eq 0 ]; then
echo ""
echo "e.g. usage $0 <device>"
echo "e.g. usage $0 <device> [<files to upoad>]"
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 ..."