-->
Page 1 of 3

How to send large html data ( 4kb+ ) using Esp8266WebServer?

PostPosted: Sun May 29, 2016 12:25 am
by Rocha
Hi guys, i need some help, i need to provide nice pages using ESP8288, the size can fit on flash, but using only httpserver.send command, maximum data i have sent with success is 4kb, send more data ESP8266 do a self reset, i think is because out of memory.

i have tried the folowing way, but no success... sendContent has sent nothing

const char* ContentOne = R"(
4kb of html data in this place
)";

const char* ContentTwo = R"(
3kb of html data in this place
)";

void http_handle_page() {
httpServer.send(200, "text/html", "" );
httpServer.sendContent( ContentOne );
httpServer.sendContent( ContentTwo );
httpServer.client().stop();
}

Any help will be apreciated.

best regards.

Re: How to send large html data ( 4kb+ ) using Esp8266WebSer

PostPosted: Tue May 31, 2016 11:30 pm
by Subhajit Das
You can try:
Code: Select allconst char WelcomePagePart1[] PROGMEM = "......"; // large data
const char WelcomePagePart2[] PROGMEM = "......"; // large data
// in code
content = "";
    content += FPSTR(WelcomePagePart1);
  content += FPSTR(WelcomePagePart2);
LocalServer.send(statusCode, "text/html", content);

Re: How to send large html data ( 4kb+ ) using Esp8266WebSer

PostPosted: Wed Jun 01, 2016 12:13 am
by idolpx
I learned how to do this using SPIFFS to store my files by looking at projects using the ESPAsyncWebServer.

https://github.com/me-no-dev/ESPAsyncWebServer

So far this is the best way to do what you're trying to accomplish.

Re: How to send large html data ( 4kb+ ) using Esp8266WebSer

PostPosted: Wed Jun 01, 2016 7:24 am
by martinayotte
webserver.send() and webserver.sendContent() still use RAM buffer to send content to client.
You should use webserver.send_P() or webserver.sendContent_P() to send content directly from Flash PROGMEM to client.