Clock is booting without mqtt
This commit is contained in:
parent
1f92adc195
commit
0b9e96518f
3
main.lua
3
main.lua
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
local looptimer = tmr.create()
|
local looptimer = tmr.create()
|
||||||
displayword = {}
|
displayword = {}
|
||||||
|
rowbgColor= {}
|
||||||
|
|
||||||
function syncTimeFromInternet()
|
function syncTimeFromInternet()
|
||||||
if (syncRunning == nil) then
|
if (syncRunning == nil) then
|
||||||
@ -37,7 +38,7 @@ function displayTime()
|
|||||||
else
|
else
|
||||||
words.briPercent=nil
|
words.briPercent=nil
|
||||||
end
|
end
|
||||||
dofile("displayword.lc")
|
mydofile("displayword")
|
||||||
if (displayword ~= nil) then
|
if (displayword ~= nil) then
|
||||||
--if lines 4 to 6 are inverted due to hardware-fuckup, unfuck it here
|
--if lines 4 to 6 are inverted due to hardware-fuckup, unfuck it here
|
||||||
local invertRows=false
|
local invertRows=false
|
||||||
|
@ -18,7 +18,7 @@ fi
|
|||||||
# check the serial connection
|
# check the serial connection
|
||||||
|
|
||||||
if [ ! -c $DEVICE ]; then
|
if [ ! -c $DEVICE ]; then
|
||||||
echo "$DEVICE does not exist"
|
echo "Serial target: $DEVICE does not exist"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -1,63 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
LUATOOL=./tools/luatool.py
|
|
||||||
|
|
||||||
DEVICE=$1
|
|
||||||
BAUD=115200
|
|
||||||
|
|
||||||
# check environment
|
|
||||||
if [ ! -f $LUATOOL ]; then
|
|
||||||
echo "$LUATOOL not found"
|
|
||||||
echo "is the command prompt at the same level as the tools folder ?"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# check the serial connection
|
|
||||||
|
|
||||||
if [ ! -c $DEVICE ]; then
|
|
||||||
echo "$DEVICE does not exist"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ $# -eq 0 ]; then
|
|
||||||
echo ""
|
|
||||||
echo "e.g. usage $0 <device> [<files to upoad>]"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ $# -eq 1 ]; then
|
|
||||||
FILES="displayword.lua main.lua timecore.lua webpage.html webserver.lua telnet.lua wordclock.lua init.lua"
|
|
||||||
else
|
|
||||||
FILES=$2
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
if [ $# -eq 1 ]; then
|
|
||||||
# Format filesystem first
|
|
||||||
echo "Format the complete ESP"
|
|
||||||
python3 $LUATOOL -p $DEVICE -w -b $BAUD
|
|
||||||
if [ $? -ne 0 ]; then
|
|
||||||
echo "STOOOOP"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "Start Flasing ..."
|
|
||||||
for f in $FILES; do
|
|
||||||
if [ ! -f $f ]; then
|
|
||||||
echo "Cannot find $f"
|
|
||||||
echo "place the terminal into the folder where the lua files are present"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
echo "------------- $f ------------"
|
|
||||||
python3 $LUATOOL -p $DEVICE -f $f -b $BAUD -t $f
|
|
||||||
if [ $? -ne 0 ]; then
|
|
||||||
echo "STOOOOP"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
echo "Reboot the ESP"
|
|
||||||
echo "node.restart()" >> $DEVICE
|
|
||||||
|
|
||||||
exit 0
|
|
Loading…
Reference in New Issue
Block a user