Your new topic does not fit any of the above??? Check first. Then post here. Thanks.

Moderator: igrr

User avatar
By rascalsailor
#95052 I am doing a webserver using the code at: https://circuitdigest.com/microcontroller-projects/ajax-with-esp8266-dynamic-web-page-update-without-reloading
The esp8266 keeps resetting and that seems to be an issue with storage in Program memory causing a corruption to the main code.
I read the post at https://www.esp8266.com/viewtopic.php?p=48388 But there it uses server.send(...) as my code from the example is doing.
As I understand it, I need to use:
Code: Select allserver.send_P(200, "text/html", s );

rather than:
Code: Select allserver.send(200, "text/html", s );

I'm getting an error saying that send_P expects 4 arguments.
Can anyone advise how to correctly send a page from prog memory?
thanks
Russell
User avatar
By rooppoorali
#95069 From here: https://links2004.github.io/Arduino/d3/ ... erver.html
it looks like there are two types of send_P function.

void send_P (int code, PGM_P content_type, PGM_P content)

void send_P (int code, PGM_P content_type, PGM_P content, size_t contentLength)

You may have you specify the text's length in the forth parameter.