I have a problem with my ESP-01 when I try to send the big .html file.
The ESP sends only one part of the .html file, not entire file.
Does anybody know what's the problem and how to fix it?
Thanks!
wifi.setmode(wifi.SOFTAP)
cfg={}
cfg.ssid="XXX"
cfg.pwd="yyy"
wifi.ap.config(cfg)
srv=net.createServer(net.TCP)
srv:listen(80,function(conn)
conn:on("receive", function(client,payload)
local f = file.open("index.html","r")
if f ~= nil then
repeat
local line=file.readline()
if line then conn:send(line) end
until not line
file.close()
else
client:send("<html></html>")
end
client:close();
collectgarbage();
f = nil
end)
end)