Replies: 12 comments
-
Wondering if this is not linked to #70... Really weird! |
Beta Was this translation helpful? Give feedback.
-
Well can be... After esp8266 bootup, nothing happens ( no crash) Hence I did not link that to "fast page change" - thats heap issue i believe |
Beta Was this translation helpful? Give feedback.
-
@DaeMonSxy : if you can adapt one of the example in the project, or send me an .ino file I can put in the project (in examples) as a reproductible use case, I can try to have a look with my D1 Mini. |
Beta Was this translation helpful? Give feedback.
-
can you tell us what is behind the macro AsyncWebServerResponse *response = request->beginResponse(200, F("text/html; charset=UTF-8"), zippedHtml, len);
response->addHeader(F("content-type"), "text/html; charset=UTF-8");
response->addHeader(F("Content-Encoding"), "gzip");
request->send(response); I too use ESP8266 with latest library version, serving g-zipped contents without any problem. |
Beta Was this translation helpful? Give feedback.
-
Thanks @lumapu ! I didn't even notice FPSTR |
Beta Was this translation helpful? Give feedback.
-
yes, i have tried "simplified" versioned also.
also tried without F macros, same issue happened.(thats been my first thought also.) |
Beta Was this translation helpful? Give feedback.
-
well, im not sure i can do that soon, going to be busy this days. I do not use ino or arduino in past few years - im on platformio. meanwhile, did a bit of checking, if i pass html code: - it is working OK the crash occurs if used: uint - crashing
|
Beta Was this translation helpful? Give feedback.
-
Yeah but it prevents you from gzip encoding, so not ideal... Did you try same code as @lumapu, without using your macros ? |
Beta Was this translation helpful? Give feedback.
-
yes, same - crashing : ` const uint8_t system_html[] PROGMEM = { //---------------------------------------------------------------------------- void sendHTMLResponse(AsyncWebServerRequest *request, const uint8_t *htmlContent, size_t htmlSize, const char *contentType, html_pages_t setpage) WServer.on("/syst", HTTP_GET, [](AsyncWebServerRequest *request) { //---------------------------------------------------------------------------- Exception (3): LoadStoreError: Processor internal physical address or data error during load or store
<<<stack<<< 0x40269d2f in system_get_sdk_version at ??:? --------------- CUT HERE FOR EXCEPTION DECODER ---------------` |
Beta Was this translation helpful? Give feedback.
-
I think found the problem. We're using the following prototype: AsyncWebServerResponse* AsyncWebServerRequest::beginResponse(int code, const char* contentType, const uint8_t* content, size_t len, AwsTemplateProcessor callback); You're passing a I tried that by implementing your macros step by step to my code. Once I started passing Stack trace
Then digging further I found out that the last argument of your function void sendStaticResponse(AsyncWebServerRequest *request, const uint8_t *htmlContent, size_t htmlSize, const char *contentType); has to be void sendStaticResponse(AsyncWebServerRequest *request, const uint8_t *htmlContent, size_t htmlSize, const _FlashStringHelper* contentType); now you have to pass the In the end I don't know if this webserver library can be improved or your code has to be changed. I'm curious how this will be solved 😊 |
Beta Was this translation helpful? Give feedback.
-
side note: my code size shrinked a few bytes using the macros, thanks for sharing 👍
|
Beta Was this translation helpful? Give feedback.
-
The other option is to use
and
or... use const String& contentType in your I don't think the library is at fault here because @lumapu : thanks for pointing to the right direction! ESP8266 is definitely ugly ! 4-5 years remaining and it is dead! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
beginResponse_P works okay, but it will be deprecated,
so i turned to beginResponse ... now crashing..
platform: esp8266
page content:
[[deprecated("Replaced by beginResponse(...)")]]
AsyncWebServerResponse* beginResponse_P(int code, const String& contentType, const uint8_t* content, size_t len, AwsTemplateProcessor callback = nullptr) {
return beginResponse(code, contentType, content, len, callback);
}
crash:
Beta Was this translation helpful? Give feedback.
All reactions