Try to reduce memory
This commit is contained in:
parent
a68f7571e7
commit
4ee159cba3
@ -4,11 +4,13 @@ configFile="config.lua"
|
|||||||
|
|
||||||
sentBytes=0
|
sentBytes=0
|
||||||
function sendPage(conn, nameOfFile, replaceMap)
|
function sendPage(conn, nameOfFile, replaceMap)
|
||||||
|
collectgarbage()
|
||||||
print("Sending " .. nameOfFile .. " " .. sentBytes .. "B already")
|
print("Sending " .. nameOfFile .. " " .. sentBytes .. "B already")
|
||||||
conn:on("sent", function(conn)
|
conn:on("sent", function(conn)
|
||||||
if (sentBytes == 0) then
|
if (sentBytes == 0) then
|
||||||
conn:close()
|
conn:close()
|
||||||
print("Page sent")
|
print("Page sent")
|
||||||
|
collectgarbage()
|
||||||
else
|
else
|
||||||
print("Next")
|
print("Next")
|
||||||
sendPage(conn, nameOfFile, replaceMap)
|
sendPage(conn, nameOfFile, replaceMap)
|
||||||
@ -160,7 +162,7 @@ function startWebServer()
|
|||||||
file.remove(configFile .. ".new")
|
file.remove(configFile .. ".new")
|
||||||
sec, _ = rtctime.get()
|
sec, _ = rtctime.get()
|
||||||
file.open(configFile.. ".new", "w+")
|
file.open(configFile.. ".new", "w+")
|
||||||
file.write("-- Config\n" .. "wifi.sta.config(\"" .. _POST.ssid .. "\",\"" .. _POST.password .. "\")\n" .. "sntpserverhostname=\"" .. _POST.sntpserver .. "\"\n" .. "timezoneoffset=\"" .. _POST.timezoneoffset .. "\"\n")
|
file.write("-- Config\n" .. "wifi.sta.config(\"" .. _POST.ssid .. "\",[[" .. _POST.password .. "]])\n" .. "sntpserverhostname=\"" .. _POST.sntpserver .. "\"\n" .. "timezoneoffset=\"" .. _POST.timezoneoffset .. "\"\n")
|
||||||
if ( _POST.fcolor ~= nil) then
|
if ( _POST.fcolor ~= nil) then
|
||||||
-- color=string.char(_POST.green, _POST.red, _POST.blue)
|
-- color=string.char(_POST.green, _POST.red, _POST.blue)
|
||||||
print ("Got fcolor: " .. _POST.fcolor)
|
print ("Got fcolor: " .. _POST.fcolor)
|
||||||
|
Loading…
Reference in New Issue
Block a user