I got my ESP8266 board working as a webserver. Whenever it receives a web request, I respond with:
void arranqueweb()
{
server.sendHeader("Cache-Control", "no-cache, no-store, must-revalidate");
server.sendHeader("Pragma", "no-cache");
server.sendHeader("Expires", "-1");
//server.sendHeader("Content-Length", "-1");
server.setContentLength(CONTENT_LENGTH_UNKNOWN);
server.send(200, "text/html", "");
server.sendContent("<html><head><meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" /><meta name=\"apple-mobile-web-app-capable\" content=\"yes\" /><meta name=\"apple-mobile-web-app-status-bar-style\" content=\"black-translucent\" /><style>body {font-family:arial;} </style>");
server.sendContent("</head><body><h1>Node 1</h1>");
server.sendContent("<h6>Node test v 0.5</h6></body></html>");
server.client().stop();
}
When using Arduino esp8266 v2.3.0 core (http://arduino.esp8266.com/stable/packa ... index.json) my code worked *almost* ok: The only problem was on the web browser, in my computer, which after receiving the webpage generated by the code above, it kept busy (like if waiting something from the server) for 5 more seconds.
So I decided to give Arduino core v2.4.0rc1 for esp8266 a try, on the hope that this was a bug which has been solved.
After compiling my code using v2.4.0rc1, and making the same request from my computer with Google Chrome, into the ESP8266 web server, now Chrome shows my page -even faster than before, I think-, but then it keeps indefinitely in a loading state. So it is much worse.
When "inspecting" the network traffic (using Google Chrome's inspect), I can see that at first the page is 200 OK, but after a second or so of finishing loading, this change into:
Status: failed
net::ERR_INCOMPLETE_CHUNKED_ENCODING
Am I missing something ? (surely I am !)
Any help is most appreciated!
Enrique