ESP32-POE: esp_eth_driver_install failed

Started by aguglie, January 27, 2024, 11:06:10 AM

Previous topic - Next topic

aguglie

Hello everyone,

I'm testing out my brand new ESP32-POE, but I cannot get it to work, neither with the standard example code or with any other example, I always get the following error:

E (123) lan87xx: lan87xx_pwrctl(409): power up timeout
E (124) lan87xx: lan87xx_init(491): power control failed
E (124) esp_eth: esp_eth_driver_install(215): init phy failed
[   144][E][ETH.cpp:320] begin(): esp_eth_driver_install failed

Do you have any idea? Maybe is the board broken?

I attach the code, which essentially is the 'Simple Ethernet and SD card demo for Arduino' example with the SD card part stripped.

#include <ETH.h>

void WiFiEvent(WiFiEvent_t event)
{
  switch (event) {
    case ARDUINO_EVENT_ETH_START:
      Serial.println("ETH Started");
      //set eth hostname here
      ETH.setHostname("esp32-ethernet");
      break;
    case ARDUINO_EVENT_ETH_CONNECTED:
      Serial.println("ETH Connected");
      break;
    case ARDUINO_EVENT_ETH_GOT_IP:
      Serial.print("ETH MAC: ");
      Serial.print(ETH.macAddress());
      Serial.print(", IPv4: ");
      Serial.print(ETH.localIP());
      if (ETH.fullDuplex()) {
        Serial.print(", FULL_DUPLEX");
      }
      Serial.print(", ");
      Serial.print(ETH.linkSpeed());
      Serial.println("Mbps");
      break;
    case ARDUINO_EVENT_ETH_DISCONNECTED:
      Serial.println("ETH Disconnected");
      break;
    case ARDUINO_EVENT_ETH_STOP:
      Serial.println("ETH Stopped");
      break;
    default:
      break;
  }
}

void setup()
{
    Serial.begin(115200);
    WiFi.onEvent(WiFiEvent);
    ETH.begin();
}



void loop()
{
}

Thank you :)

LubOlimex

What board did you select in the board selector, is it ESP32-POE?
Technical support and documentation manager at Olimex

Stanimir5F

Hello aguglie!

Which version of the ESP32 package are you using?

If it is "3.0.0-alpha3" keep in mind in their "ETH_LAN8720" example they have added at the start of the code a section which involves few macros whose values needs to be specified depending on the board (lines 6-13). In the case of ESP32-POE it has to look like this:
// Important to be defined BEFORE including ETH.h for ETH.begin() to work.
// Example RMII LAN8720 (Olimex, etc.)
#define ETH_PHY_TYPE        ETH_PHY_LAN8720
#define ETH_PHY_ADDR         0
#define ETH_PHY_MDC         23
#define ETH_PHY_MDIO        18
#define ETH_PHY_POWER       12
#define ETH_CLK_MODE        ETH_CLOCK_GPIO17_OUT
So if this is the case you might as well have to added them too before the include of the <ETH.h> file.


In the 2.x.x versions these were not part of the code and the values were taken either from the variants/pins_arduino.h file or with default one.

With 2.0.14 the default " ETH_LAN8720" example should work without any modifications since the values are defined in the pins_arduino.h file (lines 6-7) for ESP32-POE:
#define ETH_CLK_MODE ETH_CLOCK_GPIO17_OUT
#define ETH_PHY_POWER 12


Stan, Olimex
May the Source be with You!