Fiskusmati
Active member
Hello.
I'm running below test code. It does produce unexpected result on my setup.
It should print out only zeros on html page. But instead it looks like that:
It seems like it is printing some random garbage in the middle, if payload length is higher or equal 11585 bytes.
Looks like this payload is split into 3 TCP packets, but on the third packet, there are unexpected bytes at the beginning of the payload:
Can anyone replicate that, or knows how to solve this issue? Thanks.
I'm running below test code. It does produce unexpected result on my setup.
C:
#if !(defined(CORE_TEENSY) && defined(__IMXRT1062__) && defined(ARDUINO_TEENSY41))
#error Only Teensy 4.1 supported
#endif
#define BUFFER_SIZE 32000
#include "QNEthernet.h" // https://github.com/ssilverman/QNEthernet
using namespace qindesign::network;
#include <AsyncWebServer_Teensy41.h>
AsyncWebServer server(80);
void handleRoot(AsyncWebServerRequest *request) {
char temp[BUFFER_SIZE];
memset(temp, 0, sizeof(temp));
strcat(temp, "<html><body>");
for (int i = 0; i < 11559; i++) {
strcat(temp, "0");
}
strcat(temp, "</body></html>");
request->send(200, "text/html", temp);
Serial.println(strlen(temp));
}
void setup() {
Serial.begin(115200);
Ethernet.begin();
if (!Ethernet.waitForLocalIP(5000)) {
Serial.println(F("Failed to configure Ethernet"));
if (!Ethernet.linkStatus()) {
Serial.println(F("Ethernet cable is not connected."));
}
// Stay here forever
while (true) {
delay(1);
}
} else {
Serial.print(F("Connected! IP address:"));
Serial.println(Ethernet.localIP());
}
delay(1000);
server.on("/", HTTP_GET, [](AsyncWebServerRequest *request) {
handleRoot(request);
});
server.begin();
Serial.print(F("HTTP EthernetWebServer is @ IP : "));
Serial.println(Ethernet.localIP());
}
void loop() {
}
It should print out only zeros on html page. But instead it looks like that:
It seems like it is printing some random garbage in the middle, if payload length is higher or equal 11585 bytes.
Looks like this payload is split into 3 TCP packets, but on the third packet, there are unexpected bytes at the beginning of the payload:
Can anyone replicate that, or knows how to solve this issue? Thanks.
Last edited: