ESP32-GATEWAY With EthernetWebServer Arduino Library

Started by philip556677, October 24, 2022, 04:43:39 PM

Previous topic - Next topic

philip556677

I have my ESP32 board (REV E) set up to use the ETH library. This is all working fine as I am able to receive pings to the device. I would like to use the EthernetWebServer library offered by Arduino to build a simple web server, but after getting it to compile, the server does not receive requests. My guess is that I need to define some pin mapping, but im not sure where or how to do that. Has anyone been able to get this library working with the ESP32-GATEWAY?

Attached below is the code I am trying to use.

#include <ETH.h>
#include <EthernetWebServer.h>
EthernetWebServer ethernetServer(80);

void handleEthernetRoot(){
    ethernetServer.send(200, "text/plain", "Hello from ESP32 Ethernet!");
}

void setup()
{
  Serial.begin(115200);
  ETH.begin();
  ethernetServer.on("/", handleEthernetRoot);
  ethernetServer.begin();
}

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