Open DaeMonSx opened 3 years ago
It's probably late to reply and I can understand why the original developer wouldn't bother with this issue, but for anyone who tries to use this forked lib as a drop-in replacement, make sure to not miss this important line from the author on "What's missing": All references to PROGMEM: an outdated hangover from Arduino code: totally unnecessary when proper memory management techniques are used.
beginResponse_P() and send_P() are not implemented here. Instead of these functions, call normal ones like beginResponse() or send(). They can handle PGM_P vars since those are basically const char type:
#define PGM_P const char *
Just make sure your PROGMEM variable is declared as a const char array. Example:
const char myHTMLPage[] PROGMEM = R"=====(
<!doctype html>page contents...
)=====";
Note that it should be a formatted string literal and not a byte array (basically should contain normal characters). The forked library doesn't really support streaming PROGMEM variable contents from flash, so the PROGMEM contents will be read from flash into RAM and implicitly converted to const String & (and sent as a reference). Once again: beware that the contents are first copied into RAM into a String object on the heap and then sent to the client! Make sure your page is not too large.
Then you can send the contents with a simple:
request->send(200, "text/html", myHTMLPage);
If you want to serve large pages that might not fit into RAM, you're better off actually reading a file from the filesystem and not from a variable:
request->send(LittleFS, "/myHTMLPage.html", "text/html");
Hi there
Phil has passed away ~ 1year ago, you can checkout the stable H4AsyncWebServer, use my fork, a complete PlatformIO environment for H4Plugins is available.
You might check dependencies under platformio.ini.
Oh my. Sorry to hear that.
Thank you for continuing his work!
You're welcome..
On Sun, Jul 9, 2023, 13:15 serpinio @.***> wrote:
Oh my. Sorry to hear that.
Thank you for continuing his work!
— Reply to this email directly, view it on GitHub https://github.com/philbowles/ESPAsyncWebServer/issues/1#issuecomment-1627669535, or unsubscribe https://github.com/notifications/unsubscribe-auth/AH3O7J6V3CU6AW7THF3ZYMTXPKADVANCNFSM4624QOPQ . You are receiving this because you commented.Message ID: @.***>
Having seen your lib, I will try to replace the me-no-dev asynctcp and webserver with your libs. Getting this error, any hints to solve the issue? thanks