Skip to content

[Bug] Web interface broken and clipping #3

@GreenVaildSig

Description

@GreenVaildSig

Issue:

When flashing and configuring a TULv3 both with platformio or Webflasher the served webpage is broken in all common browsers (Firefox, Chrome tested).
After looking into the code I see in tul-knx-gateway/src/main.cpp at line 547:

    server.on("/", HTTP_GET, [](AsyncWebServerRequest *request){
        request->send(200, "text/html", index_html);
    });

AsyncWebServer should serve the html stored in tul-knx-gateway/src/index_html.h:

const char index_html[] PROGMEM = R"rawliteral(
<!DOCTYPE html>
<html lang="de">
<head>

// [ ... ]

</body>
</html>
)rawliteral";

The HTML "works" in a local .html file. However it seems that AsyncWebServer cuts off code or breaks the HTML at specific point (5778 Character). See screenshots.

Image Image

It seems like it breaks at the image-tag tul-knx-gateway/src/index_html.h at line 145. When removed, compiled and uploaded, the webbrowser loads the served webpage.
Maybe the embedded image is too large for the library to handle?

If I have the time, I'll look into it. Maybe the external AsyncWebServer can't handle too long lines. Maybe a LITTLEFS file could work, but that is a big overhead just for serving html code. Same behavior with newer version of AsyncWebServer ( see issue #2 ).


How to reproduce:

  • Clone repo, compile, flash and configure with test_improv. Or use webflasher and configure via UI.
  • View served webpage via browser => broken page
  • Remove image-tag, compile again etc
  • View served webpage via browser => healthy page

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions