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 fi
if [ $# -ne 1 ]; then if [ $# -eq 0 ]; then
echo "" echo ""
echo "e.g. usage $0 <device>" echo "e.g. usage $0 <device> [<files to upoad>]"
exit 1 exit 1
fi fi
if [ $# -eq 1 ]; then
FILES="displayword.lua main.lua timecore.lua webpage.html webserver.lua wordclock.lua init.lua" FILES="displayword.lua main.lua timecore.lua webpage.html webserver.lua wordclock.lua init.lua"
else
FILES=$2
fi
# Format filesystem first # Format filesystem first
echo "Format the complete ESP" #echo "Format the complete ESP"
$LUATOOL -p $DEVICE -w -b 115200 #$LUATOOL -p $DEVICE -w -b 115200
if [ $? -ne 0 ]; then #if [ $? -ne 0 ]; then
echo "STOOOOP" # echo "STOOOOP"
exit 1 # exit 1
fi #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
echo "Start Flasing ..." echo "Start Flasing ..."