-------------
--- The webpage for the Webserver
function sendWebPage(conn,answertype)
collectgarbage()
if (ssid == nil) then
ssid="Not set"
end
if (sntpserverhostname == nil) then
sntpserverhostname="ptbtime1.ptb.de"
end
if (timezoneoffset == nil) then
timezoneoffset=1
end
local buf="HTTP/1.1 200 OK\nServer: NodeMCU\nContent-Type: text/html\n\n"
if (node.heap() < 8000) then
buf = buf .. "
Busy, please come later again
"
else
buf = buf .. ""
buf = buf .. "WordClock Setup Page"
buf = buf .. "\n"
buf = buf .. "Welcome to the WordClock
Please note that all settings are mandatory
"
buf = buf ..""
if answertype==2 then
buf = buf .. "New configuration saved
"
elseif answertype==3 then
buf = buf .. "ERROR
"
elseif answertype==4 then
buf = buf .. "Not all parameters set
"
end
buf = buf .. "\n"
end
conn:send(buf)
buf=nil
collectgarbage()
end