From 344fb0ab9a93c1331bc937ae92ab36fe7510c8b8 Mon Sep 17 00:00:00 2001 From: ollo Date: Wed, 4 Mar 2020 22:24:13 +0100 Subject: [PATCH] Added example for telnet command --- init.lua | 2 +- telnet.lua | 17 ++++++++++++++++- tools/initialFlash.sh | 2 +- tools/tcpFlash.py | 2 +- 4 files changed, 19 insertions(+), 4 deletions(-) diff --git a/init.lua b/init.lua index 5a107f2..1b60740 100644 --- a/init.lua +++ b/init.lua @@ -49,7 +49,7 @@ tmr.alarm(1, 5000, 0, function() (file.open("timecore.lua")) or (file.open("wordclock.lua")) or (file.open("displayword.lua")) or - (file.open("webserver.lua")) + (file.open("telnet.lua")) ) then c = string.char(0,128,0) w = string.char(0,0,0) diff --git a/telnet.lua b/telnet.lua index 8b81bbf..fa6fb09 100644 --- a/telnet.lua +++ b/telnet.lua @@ -50,7 +50,22 @@ if ( (_ssid == nil) and (_bcolor == nil) and (_threequater == nil) ) then print("one parameter is mandatory:") - print("storeConfig(ssid, password, timezoneoffset, sntpserver, inv46, dim, fcolor, colorMin1, colorMin2, colorMin3, colorMin4, bcolor, threequater)") + print("storeConfig(ssid, ") + print(" password,") + print(" timezoneoffset,") + print(" sntpserver,") + print(" inv46,") + print(" dim,") + print(" fcolor,") + print(" colorMin1,") + print(" colorMin2,") + print(" colorMin3,") + print(" colorMin4,") + print(" bcolor,") + print(" threequater)") + print(" ") + print("e.g.:") + print('storeConfig(nil, nil, 1, nil, "on", true, "00FF00", "00FF88", "008888", "00FF44", "004488", "000000", true)') return end diff --git a/tools/initialFlash.sh b/tools/initialFlash.sh index 14e28ee..a3bfdb9 100755 --- a/tools/initialFlash.sh +++ b/tools/initialFlash.sh @@ -59,6 +59,6 @@ for f in $FILES; do done echo "Reboot the ESP" -$LUATOOL -p $DEVICE -r -b 115200 +echo "node.restart()" >> $DEVICE exit 0 diff --git a/tools/tcpFlash.py b/tools/tcpFlash.py index 8ff527e..4f7526b 100755 --- a/tools/tcpFlash.py +++ b/tools/tcpFlash.py @@ -94,7 +94,7 @@ def main(nodeip, luafile, volatile=None): print "add a space at the end" if (volatile is None): - if (not sendCmd(s, "w([[" + l + "]]);")): + if (not sendCmd(s, "w([==[" + l + "]==]);")): print "Cannot write line " + str(i) s.close() sys.exit(4)