1

I have an Arduino sketch that serves an HTML web page using the standard Ethernet library (https://github.com/arduino-libraries/Ethernet) and the Ethernet Web Server library (https://github.com/khoih-prog/EthernetWebServer). I am serving HTML stored directly in the Arduino memory. The processor is the ARM Cortex M0+. Here is an extract from the code I am using:

#include <Ethernet.h>
#include <EthernetWebServer.h>

#define webpage "Big HTML string"

EthernetWebServer webServer;
void setup()
{
  SerialUSB.begin(9600);

  Ethernet.begin(settings.macAddress, settings.ipAddress, settings.ipAddressDns, settings.ipAddressGateway, settings.ipAddressSubnet); // 'settings' is a struct declared elsewhere
  webServer = EthernetWebServer(settings.portHttp);

  webServer.on("/login", [&webServer]{ // /login handler
    webServer.send(200, "text/html", webpage);
  });
}

void loop()
{
  webServer.handleClient();
}

When I refresh the page (send GET request) more than 9 times or so the Arduino freezes. I have checked by placing SerialUSB.println() inside the code and it seems to stop before even entering the "/login handler" callback.

Does anyone know the cause or at least how to solve this?

1
  • the EthernetWebServer library is very new. create an issue in the GitHub repository – Juraj Jul 17 '20 at 15:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.