Hallo my board begun behaving herratically then got this error at startup:
E (124) lan87xx: lan87xx_pwrctl(409): power up timeout
E (125) lan87xx: lan87xx_init(491): power control failed
E (125) esp_eth: esp_eth_driver_install(223): init phy failed
[ 131][E][ETH.cpp:311] begin(): esp_eth_driver_install failed
I moved back to a basic example and the error is still there, has the Ethernet module been compromised?
Example:
/*
This sketch shows the Ethernet event usage
*/
#include <ETH.h>
static bool eth_connected = false;
void WiFiEvent(WiFiEvent_t event)
{
//debug.println("info: WiFiEvent Received");
switch (event)
{
case ARDUINO_EVENT_ETH_START:
debug.println("ETH Started");
// set eth hostname here
ETH.setHostname("esp32-ethernet");
break;
case ARDUINO_EVENT_ETH_CONNECTED:
debug.println("ETH Connected");
break;
case ARDUINO_EVENT_ETH_GOT_IP:
debug.print("ETH MAC: ");
debug.print(ETH.macAddress());
debug.print(", IPv4: ");
debug.print(ETH.localIP());
if (ETH.fullDuplex())
{
debug.print(", FULL_DUPLEX");
}
debug.print(", ");
debug.print(ETH.linkSpeed());
debug.println("Mbps");
eth_connected = true;
break;
case ARDUINO_EVENT_ETH_DISCONNECTED:
debug.println("ETH Disconnected");
eth_connected = false;
break;
case ARDUINO_EVENT_ETH_STOP:
debug.println("ETH Stopped");
eth_connected = false;
break;
default:
break;
}
}
void testClient(const char * host, uint16_t port)
{
Serial.print("\nconnecting to ");
Serial.println(host);
WiFiClient client;
if (!client.connect(host, port)) {
Serial.println("connection failed");
return;
}
client.printf("GET / HTTP/1.1\r\nHost: %s\r\n\r\n", host);
while (client.connected() && !client.available());
while (client.available()) {
Serial.write(client.read());
}
Serial.println("closing connection\n");
client.stop();
}
void setup()
{
Serial.begin(115200);
WiFi.onEvent(WiFiEvent);
ETH.begin();
}
void loop()
{
if (eth_connected) {
testClient("google.com", 80);
}
delay(10000);
}
Have tried a wifi example and it does work so the rest of the board seems to be ok.
Can be a driver issue, here a user seems to have encountered similar issue and it was related to the software:
https://github.com/espressif/esp-idf/issues/5425
Maybe try adding some delays in the code.
Did you recently update the Arduino IDE package?