ESPAsyncWebServer icon indicating copy to clipboard operation
ESPAsyncWebServer copied to clipboard

Trying to load a 80 kB web page but sometimes it is not loading completely.

Open miguelfernando55 opened this issue 2 years ago • 2 comments

Sometimes when I reload the page, the source code shows up. Goingo to inpect -> source, only html and css are there. The js script is missing. I am using server.on with SPIFFS and servestatic. Does anybody knows how to solve this issue?

miguelfernando55 avatar Aug 09 '23 07:08 miguelfernando55

This sounds familiar, I had/have similar issues #1330 . You can check if you run out of heap. Another way to save some memory is to sendl files ie your js stuff as a .gz file.

wibenjamin avatar Aug 17 '23 15:08 wibenjamin

Hi all,

have the same issue here, it's a memory problem... I already tryed the workaround using a chunked response with the same result:

The free heap reduces every call to the callback function by the amount of "maxLen", so I assume the memory wasn't freed:

AsyncWebServerResponse* response = request->beginChunkedResponse(pszType, [request](uint8_t* buffer, size_t maxLen, size_t alreadySent) -> size_t ...

When the CPU runs out of mem, the async TCP lib says:

[ 28094][W][AsyncTCP.cpp:949] _poll(): pcb is NULL

After that everything related to Network hangs (No answer to Ping, or any request), till the watchdog resets the ESP...

trlink avatar Oct 05 '23 10:10 trlink