0

I'm working on building a web page on the ESP8266, using the ESP8266WebServer library. The problem is with larger html files, I'm not able to load the pages, despite having plenty of program space and memory available.

I believe the issue is an memory overflow in webserver.send(200,"text/html",htmlDoc);

Is there a way I can "stitch" the webpage together by breaking the webpage up into smaller pieces?

1 Answer 1

2

I suggest, you are using the ARDUINO EDI for coding, and using the ESP8266WebServer library.

I have done the same, and noticed, that at ARDUINO EDI 1.65, The web-page will produce much more code / RAMusage, than using ARDUINO 1.68 or 1.69.

Next, use for static Webpage-Text, the F() function like this

 ////////////////////
 // make html footer
 ////////////////////
 void MakeHTTPFooter(void)
{
G_WebSeite += F("\r\n<div style=\"font-size:x-small\">");
G_WebSeite += F("\r\n\t<BR>Aufrufz&auml;hler = ");
G_WebSeite += G_ulReqcount;
G_WebSeite += F("\r\n\t<BR>Uptimez&auml;hler = ");
G_WebSeite += CalcUptime(Guptime);
G_WebSeite += F("\r\n\t<BR>Verbindungsz&auml;hler = ");
G_WebSeite += G_ulReconncount;
G_WebSeite += F("\r\n\t<BR>WiFi-Staerke = ");
G_WebSeite += G_WiFiSignalStrength;
G_WebSeite += F("dbm");
G_WebSeite += F("\r\n\t<BR>Freies RAM = ");
G_WebSeite += (uint32_t)system_get_free_heap_size();
G_WebSeite += F("\r\n</div>\r\n</body>\r\n</html>");
delay(1);
}

To save RAM.

To send the Webpage, I have seen some code where the Large web page is streamt in short pieces to the Client.

Sorry but I have not stored the link, please search here the Internet, for Streaming large Webpages.

I hope this will help you.

Mickbaer from Berlin Germany

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.