ESP32-PoE2 Ethernet webserver not running

Started by Da_Stier, April 18, 2025, 10:12:42 PM

Previous topic - Next topic

Da_Stier

Hello all,

this is my first post on this forum.
I recently bought two ESP32-PoE2 boards.
https://www.olimex.com/Products/IoT/ESP32/ESP32-POE2/open-source-hardware

My board uses the WROVER module (not sure if there are other ESP32-PoE boards out there)

I try to get the basic Ethertnet webserver example to run.
This is the code I try to use.
https://github.com/OLIMEX/ESP32-POE/blob/master/SOFTWARE/ARDUINO/ESP32_PoE_Ethernet_WebServer/ESP32_PoE_Ethernet_WebServer.ino

I run the Arduino IDE 2.3.4 with the esp32 board plugin from Espressif Systems.
Its version is currently 2.0.11 as recommended in the code I try to run.
I chose the "ESP32 Wrover module" board definition.



The board is recognized as a COM port, the upload works just fine.
After uploading I get the following output on the serial terminal.

Setup...Registering event handler for ETH events...Starting ETH interface...E (1076) lan87xx: lan87xx_pwrctl(409): power up timeout
E (1076) lan87xx: lan87xx_init(491): power control failed
E (1076) esp_eth: esp_eth_driver_install(215): init phy failed
MDNS responder started
HTTP server started

I made sure to check the PHY settings in the ETH.h file that gets included at the top.

#ifndef ETH_PHY_ADDR
#define ETH_PHY_ADDR 0
#endif

#ifndef ETH_PHY_TYPE
#define ETH_PHY_TYPE ETH_PHY_LAN8720
#endif

#ifndef ETH_PHY_POWER
#define ETH_PHY_POWER 12
#endif

#ifndef ETH_PHY_MDC
#define ETH_PHY_MDC 23
#endif

#ifndef ETH_PHY_MDIO
#define ETH_PHY_MDIO 18
#endif

#ifndef ETH_CLK_MODE
#define ETH_CLK_MODE ETH_CLOCK_GPIO17_OUT
#endif




Does anybody know what I'm doing wrong?
If anyone has a working version of a standard Webserver over PoE for the ESP32-PoE2 board that he/she is willing to share I would be very happy as well.



Thanks,
Michael

LubOlimex

You are using the wrong pin for the clock. It is GPIO0 (not GPIO17). It should be like this:

#define ETH_CLK_MODE ETH_CLOCK_GPIO0_OUT

Refer to this demo:

https://github.com/OLIMEX/ESP32-POE2/blob/main/SOFTWARE/ARDUINO/LAN8720-POE2/LAN8720-POE2.ino
Technical support and documentation manager at Olimex

Da_Stier

Hello,

thank you very much for the fast reply, now it works fine.
So the problem was indeed me defining the wrong clk mode.

I think I got confused by the netlabel in the schematic being "
GPIO17\EMAC_CLK_OUT_18" on pin 5 of U7.

But after looking at U4 in the schematics, it makes a lot more sense now.


Thanks and best regards,
Michael

LubOlimex

Thank you for the update, glad it is now working. It is explained on page 9 of the manual and I've also written at the bottom of the product page, in the FAQ section:

- Ethernet doesn't work. Is my board defective?

- Make sure you've selected board variant with PSRAM enabled (this board has WROVER module, not WROOM). Make sure your code defines GPIO0 as Ethernet clock source pin.
Technical support and documentation manager at Olimex