https://github.com/dieseltravis/esp8266-projects/tree/master/wifi-car
The problem is, whenever I connect to the the webserver with a browser, the ESP8266 never returns the whole file, it only makes it about 60 or so lines down. If I print to console I can see the whole file but something isn't working right. Take a look at the code I'm using to push the file here:
https://github.com/dieseltravis/esp8266-projects/blob/master/wifi-car/main.lua#L75-L100
function sendfile(conn, filename)
if file.open(filename, "r") then
--repeat
-- --local line=file.read(128)
-- local line=file.readline()
-- if line then conn:send(line)end
-- tmr.wdclr()
--until not line
--file.close()
while true do
line = file.readline()
if (line == nil) then break end
--print(string.sub(line, 1, -2))
conn:send(line)
tmr.wdclr()
collectgarbage()
end
--conn:send(file.read())
file.close()
end
end(you can see my various attempts in the commented out code)
My index.html file is here:
https://github.com/dieseltravis/esp8266-projects/blob/master/wifi-car/index.html
Anyone have any thoughts on what I might be doing wrong?