Olimex Support Forum

Microcontrollers => ESP32 => Topic started by: arcimus on September 20, 2023, 12:51:51 AM

Title: ESP32-POE-ISO ESPHome: wrong chip ID
Post by: arcimus on September 20, 2023, 12:51:51 AM
Hello,

ESP32-POE-ISO powers on and accepts flashing, but ethernet does not connect.  Wifi works fine.  Logging shows:
[D][esp-idf:000]: E (368) lan87xx: lan87xx_init(499): wrong chip ID
[D][esp-idf:000]: E (369) esp_eth: esp_eth_driver_install(215): init phy failed

I read that this may be related to: https://github.com/espressif/arduino-esp32/issues/6142

However, it's my understanding that ESPHome uses espressif and therefore the delay should be in place.

I also attempted with ESPHome set to use the latest espressif and platform.  The error is now slightly different:
[V][esp-idf:000]: E (991) lan87xx: lan87xx_init(299): wrong chip OUI
[V][esp-idf:000]: E (992) esp_eth: esp_eth_driver_install(229): init phy failed

ESPHome yaml:
esphome:
  name: esphome-web-6fb690
  friendly_name: ESPHome Web 6fb690

esp32:
  board: esp32-poe-iso
  framework:
    type: esp-idf
    version: latest
    platform_version: 6.4.0

# Enable logging
logger:
  level: VERBOSE

# Enable Home Assistant API
api:
  encryption:
    key: "donaldduck="

ota:

ethernet:
  type: LAN8720
  mdc_pin: GPIO23
  mdio_pin: GPIO18
  clk_mode: GPIO17_OUT
  phy_addr: 0
  power_pin: GPIO12
Title: Re: ESP32-POE-ISO ESPHome: wrong chip ID
Post by: LubOlimex on September 20, 2023, 08:12:55 AM
Which version of ESP32-POE-ISO do you have? If you use WROVER version change "clk_mode: GPIO17_OUT" to  "clk_mode: GPIO0_OUT" so it looks like that:

ethernet:
type: LAN8720
mdc_pin: GPIO23
mdio_pin: GPIO18
clk_mode: GPIO0_OUT
phy_addr: 0
power_pin: GPIO12

Let me know how it goes.
Title: Re: ESP32-POE-ISO ESPHome: wrong chip ID
Post by: arcimus on September 20, 2023, 06:37:16 PM
Thanks for your reply.  I do not have the WROVER version.  I have the ESP32-PoE-ISO Rev.L.  I tried the different ethernet settings anyway, same error.
Title: Re: ESP32-POE-ISO ESPHome: wrong chip ID
Post by: LubOlimex on September 25, 2023, 09:40:05 AM
Then you initial config was alright:
type: LAN8720
mdc_pin: GPIO23
mdio_pin: GPIO18
clk_mode: GPIO17_OUT
phy_addr: 0
power_pin: GPIO12

Notice that just a few days ago a customer reported success with ESPHome and same chip (despite that he used WROVER version board uses same Ethernet chip): https://github.com/OLIMEX/ESP32-POE-ISO/issues/13

If the issue remains:

- report to esphome team or community with all details about the software you used

- test with different version of esphome (latest, older) depending on what you used so far

- try some other environment and demo to confirm the issue is not with the ethernet of the board, maybe use Arduino IDE for ESP32, which has a config for Olimex ESP32-PoE-ISO in the board selector, then download the demo ETH_LAN8720 from File -> Examples -> Ethernet.

- double check your cabling and network, sometimes networking problems come for the network settings themselves

Title: Re: ESP32-POE-ISO ESPHome: wrong chip ID
Post by: arcimus on October 04, 2023, 12:06:52 AM
I decided to keep it simple and try the ETH_LAN8720.ino example in Arduino IDE.  I followed the instructions here (https://www.olimex.com/Products/IoT/ESP32/_resources/Arudino-ESP32.txt), but each time I attempt an upload, I get:
esptool.py v4.5.1
Serial port COM4
Connecting......................................

A fatal error occurred: Failed to connect to ESP32: No serial data received.
For troubleshooting steps visit: https://docs.espressif.com/projects/esptool/en/latest/troubleshooting.html
Failed uploading: uploading error: exit status 2

Once, I received:
A fatal error occurred: Failed to connect to ESP32: Download mode successfully detected, but getting no sync reply: The serial TX path seems to be down.
For troubleshooting steps visit: https://docs.espressif.com/projects/esptool/en/latest/troubleshooting.html
Failed uploading: uploading error: exit status 2

I had no problems flashing ESPHome through the same setup.

Not sure if it's related, but when I view the Serial Monitor in Arduino IDE and press the RST1 button, sometimes I get:
rst:0x1 (POWERON_RESET),boot:0x2 (DOWNLOAD_BOOT(UART0/UART1/SDIO_REI_FEO_V2))
waiting for download
... but most of the time I see it boot ESPHome, ending with the wrong chip OUI error.
Title: Re: ESP32-POE-ISO ESPHome: wrong chip ID
Post by: LubOlimex on October 04, 2023, 08:25:37 AM
That is not good, can be caused by a lot of things. You can search online for that error "A fatal error occurred: Failed to connect to ESP32: Download mode successfully detected, but getting no sync reply: The serial TX path seems to be down.". I'd recommend first testing with another cable and USB port.

Title: Re: ESP32-POE-ISO ESPHome: wrong chip ID
Post by: John_L on December 06, 2023, 03:02:55 PM
I have the same problem, working with ESP-IDF.

E (1002) lan87xx: lan87xx_init(499): wrong chip ID
E (1002) esp_eth: esp_eth_driver_install(215): init phy failed

My code for LAN Networking is working perfectly fine on ESP32-Gateway boards, but fails on ESP32-PoE.
The menuconfig settings are all exactly the same, using RMII and the right pinning and so on.
Comparing the schematics for both boards, i cannot see any difference at all concering the Ethernet circuitry.

Here is my Ethernet initialization code:
   // MAC config
   eth_mac_config_t mac_config = ETH_MAC_DEFAULT_CONFIG();
   mac_config.smi_mdc_gpio_num = CONFIG_MYDEVICE_ETH_MDC_GPIO;
   mac_config.smi_mdio_gpio_num = CONFIG_MYDEVICE_ETH_MDIO_GPIO;

   // PHY config
   eth_phy_config_t phy_config = ETH_PHY_DEFAULT_CONFIG();
   phy_config.phy_addr = CONFIG_MYDEVICE_ETH_PHY_ADDR;
   phy_config.reset_gpio_num = CONFIG_MYDEVICE_ETH_PHY_RST_GPIO;

   esp_eth_mac_t *mac = esp_eth_mac_new_esp32(&mac_config);
   esp_eth_phy_t *phy = esp_eth_phy_new_lan87xx(&phy_config);

   esp_eth_config_t config = ETH_DEFAULT_CONFIG(mac, phy);
   eth_handle = NULL;
  
   ESP_ERROR_CHECK(esp_eth_driver_install(&config, &eth_handle));
   ESP_ERROR_CHECK(esp_netif_attach(eth_netif, esp_eth_new_netif_glue(eth_handle)));
   ESP_ERROR_CHECK(esp_eth_start(eth_handle));

As already mentioned, this code is working on ESP32-Gateway boards which leaves me bewildered what is going on.

Thanks a lot for help.
Title: Re: ESP32-POE-ISO ESPHome: wrong chip ID
Post by: LubOlimex on December 07, 2023, 08:46:51 AM
This doesn't seem like the same problem.

1. What are the exact names and variants of the ESP32 boards that you got? Neither ESP32-POE nor ESP32-GATEWAY has WROVER module, correct?

2. What is the hardware revision letter of ESP32-GATEWAY and what is the hardware revision of ESP32-POE? This should be printed at the bottom of the board under the name of the board.

3. What are the pin definitions in your code when it comes to the Ethernet? I mean what exactly are mdc_pin, mdio_pin, clk_mode, power_pin ?
Title: Re: ESP32-POE-ISO ESPHome: wrong chip ID
Post by: John_L on December 07, 2023, 11:46:59 AM
1. Both boards have ESP32-WROOM module
-----------------------------------
2. ESP32-POE: REV. L / ESP32-GATEWAY: REV. G
-----------------------------------
3. mdc_pin 23
   mdio_pin 18
   clk_mode 'Output RMII clock from internal' Pin 17
   power_pin ?? What do you mean by that? Cannot find anything like that in the menuconfig
Title: Re: ESP32-POE-ISO ESPHome: wrong chip ID
Post by: LubOlimex on December 07, 2023, 01:15:14 PM
It was somewhere around the power options, I believe it had to be enabled and GPIO assigned. But exact location varies depending on the ESP-IDF version used. It should be GPIO12. In the code it is "#define PIN_PHY_POWER 12" see here:

https://github.com/OLIMEX/ESP32-POE/blob/master/SOFTWARE/ESP-IDF/ESP32_PoE_Ethernet_IDFv4.4/main/ethernet_example_main.c

If you are using ESP-IDF, then try our Ethernet examples for ESP32-POE (use the folder depending on the ESP-IDF version that you use):

https://github.com/OLIMEX/ESP32-POE/tree/master/SOFTWARE/ESP-IDF

Maybe use the examples as basis or inspiration in your code.
Title: Re: ESP32-POE-ISO ESPHome: wrong chip ID
Post by: John_L on December 07, 2023, 03:13:25 PM
The example works, think i can go on from there.
I did not use the gpio_pad_selection, maybe that was the error...

tahnk you very much  :D
Title: Re: ESP32-POE-ISO ESPHome: wrong chip ID
Post by: arcimus on February 02, 2024, 11:01:31 PM
Coming back to this after having to work on some other things.

esphome is up to date.  I made various new esphome attempts all result in the same "wrong chip ID" error.  I tried different board and framework settings, as well as a couple different ethernet suggestions.

I updated Arduino IDE including the ESP32 packages.  In Arduino IDE, I was able to compile and upload the ETH_LAN8720.ino example.  Same "wrong chip ID" error.

A dozen or so results are easily googleable to see that there are folks out there getting the ESP32-POE-ISO to work with esphome.  Do I somehow have a bad board?  Any other suggestions?

Arduino IDE Output:
Sketch uses 757957 bytes (57%) of program storage space. Maximum is 1310720 bytes.
Global variables use 43732 bytes (13%) of dynamic memory, leaving 283948 bytes for local variables. Maximum is 327680 bytes.
esptool.py v4.5.1
Serial port COM4
Connecting.......
Chip is ESP32-D0WD-V3 (revision v3.0)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
Crystal is 40MHz
MAC: e0:5a:1b:6f:b6:90
Uploading stub...
Running stub...
Stub running...
Configuring flash size...
Flash will be erased from 0x00001000 to 0x00005fff...
Flash will be erased from 0x00008000 to 0x00008fff...
Flash will be erased from 0x0000e000 to 0x0000ffff...
Flash will be erased from 0x00010000 to 0x000cafff...
Compressed 17568 bytes to 12204...
Writing at 0x00001000... (100 %)
Wrote 17568 bytes (12204 compressed) at 0x00001000 in 1.5 seconds (effective 96.4 kbit/s)...
Hash of data verified.
Compressed 3072 bytes to 146...
Writing at 0x00008000... (100 %)
Wrote 3072 bytes (146 compressed) at 0x00008000 in 0.1 seconds (effective 265.4 kbit/s)...
Hash of data verified.
Compressed 8192 bytes to 47...
Writing at 0x0000e000... (100 %)
Wrote 8192 bytes (47 compressed) at 0x0000e000 in 0.1 seconds (effective 646.4 kbit/s)...
Hash of data verified.
Compressed 764256 bytes to 491787...
Writing at 0x00010000... (3 %)
Writing at 0x0001c3a6... (6 %)
Writing at 0x00027ce6... (9 %)
Writing at 0x00032d28... (12 %)
Writing at 0x00037e7f... (16 %)
Writing at 0x0003d435... (19 %)
Writing at 0x00042c82... (22 %)
Writing at 0x00048cb0... (25 %)
Writing at 0x0004df68... (29 %)
Writing at 0x00053115... (32 %)
Writing at 0x0005847d... (35 %)
Writing at 0x0005d652... (38 %)
Writing at 0x0006289c... (41 %)
Writing at 0x0006812d... (45 %)
Writing at 0x0006d39b... (48 %)
Writing at 0x00073084... (51 %)
Writing at 0x00078790... (54 %)
Writing at 0x0007d987... (58 %)
Writing at 0x00082d6e... (61 %)
Writing at 0x00088276... (64 %)
Writing at 0x0008d7ef... (67 %)
Writing at 0x00093016... (70 %)
Writing at 0x00098e7a... (74 %)
Writing at 0x0009e7d5... (77 %)
Writing at 0x000a4b97... (80 %)
Writing at 0x000af236... (83 %)
Writing at 0x000b46c2... (87 %)
Writing at 0x000b9e32... (90 %)
Writing at 0x000bf7cb... (93 %)
Writing at 0x000c4be2... (96 %)
Writing at 0x000ca80a... (100 %)
Wrote 764256 bytes (491787 compressed) at 0x00010000 in 43.9 seconds (effective 139.4 kbit/s)...
Hash of data verified.

Leaving...
Hard resetting via RTS pin...

rst:0x1 (POWERON_RESET),boot:0x1f (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0030,len:1184
load:0x40078000,len:13260
load:0x40080400,len:3028
entry 0x400805e4
E (41) lan87xx: lan87xx_init(499): wrong chip ID
E (41) esp_eth: esp_eth_driver_install(215): init phy failed
ets Jul 29 2019 12:21:46
Title: Re: ESP32-POE-ISO ESPHome: wrong chip ID
Post by: Stanimir5F on February 05, 2024, 08:43:09 AM
Hello arcimus!

Ideally I would like to see the exact code you are trying to upload but based on this
Quote from: arcimus on February 02, 2024, 11:01:31 PMI updated Arduino IDE including the ESP32 packages. In Arduino IDE, I was able to compile and upload the ETH_LAN8720.ino example.
I assume you haven't made changes and I have an idea what the issue may be.

In the latest version of the package (which is still in development as far as I am aware) they changed the default ETH_LAN8720 example a little bit.

In the older version the macros about the ethernet hardware were hidden inside the library files and the specifics could be overwritten from the "pins_arduino.h" header in the "variants" folder.
As for the new one these macros are presented at the very start of the sketch (before the include of the "ETH.h")

Take a look at it and more specifically lines 8-13.
By default it should be this:
#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       -1
#define ETH_CLK_MODE        ETH_CLOCK_GPIO0_IN
but in our hardware the PHY power is pin 12 and the EMAC clock OUT is pin 17 .
So the last 2 macros should be changed to:
#define ETH_PHY_POWER       12
#define ETH_CLK_MODE        ETH_CLOCK_GPIO17_OUT

Try it to see if it will solve the problem. Otherwise please post the code you are trying to upload (and also just in case the exact revision of the Espressif package you are using).

Stan, Olimex
Title: Re: ESP32-POE-ISO ESPHome: wrong chip ID
Post by: arcimus on February 06, 2024, 12:08:32 AM
Thanks for your reply.  I just tried again...

In Arduino IDE, I'm Running esp32 by Espressif 2.0.14 and Arduino ESP32 Boards by Arduino 2.0.13.

I found the current master version of the example here: https://github.com/espressif/arduino-esp32/blob/master/libraries/Ethernet/examples/ETH_LAN8720/ETH_LAN8720.ino
The one I'm using does not look like that.  I downloaded the current release v2.0.14 zip for espressif/arduino-esp32 and it also does not look like that.

Compiling the master version with the #define lines results in compilation errors.

https://docs.espressif.com/projects/arduino-esp32/en/latest/installing.html has a development release link.  I'll put that in Arduino IDE tomorrow and give it a shot.

Here's the v2.0.14 version
/*
    This sketch shows the Ethernet event usage

*/

#include <ETH.h>

static bool eth_connected = false;

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");
      eth_connected = true;
      break;
    case ARDUINO_EVENT_ETH_DISCONNECTED:
      Serial.println("ETH Disconnected");
      eth_connected = false;
      break;
    case ARDUINO_EVENT_ETH_STOP:
      Serial.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);
}

Here's the current master branch version:
/*
    This sketch shows the Ethernet event usage

*/

// 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       -1
#define ETH_CLK_MODE        ETH_CLOCK_GPIO0_IN

#include <ETH.h>

static bool eth_connected = false;

// WARNING: WiFiEvent is called from a separate FreeRTOS task (thread)!
void WiFiEvent(WiFiEvent_t event)
{
  switch (event) {
    case ARDUINO_EVENT_ETH_START:
      Serial.println("ETH Started");
      // The hostname must be set after the interface is started, but needs
      // to be set before DHCP, so set it from the event handler thread.
      ETH.setHostname("esp32-ethernet");
      break;
    case ARDUINO_EVENT_ETH_CONNECTED:
      Serial.println("ETH Connected");
      break;
    case ARDUINO_EVENT_ETH_GOT_IP:
      Serial.println("ETH Got IP");
      ETH.printInfo(Serial);
      eth_connected = true;
      break;
    case ARDUINO_EVENT_ETH_LOST_IP:
      Serial.println("ETH Lost IP");
      eth_connected = false;
      break;
    case ARDUINO_EVENT_ETH_DISCONNECTED:
      Serial.println("ETH Disconnected");
      eth_connected = false;
      break;
    case ARDUINO_EVENT_ETH_STOP:
      Serial.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);  // Will call WiFiEvent() from another thread.
  ETH.begin();
}

void loop()
{
  if (eth_connected) {
    testClient("google.com", 80);
  }
  delay(10000);
}
Title: Re: ESP32-POE-ISO ESPHome: wrong chip ID
Post by: LubOlimex on February 06, 2024, 09:35:39 AM
Maybe the Ethernet got damaged somehow, maybe it a hardware problem, my advice is to either get another ESP32-POE-ISO board and compare behavior or drop me an e-mail support@olimex.com to start the warranty and returns procedure, our warranty and returns policy is detailed here:

https://www.olimex.com/wiki/GTC#Warranty
Title: Re: ESP32-POE-ISO ESPHome: wrong chip ID
Post by: daabutts on February 06, 2024, 06:09:32 PM
I am chasing the same problem.  Here is the code:

/*
    This sketch shows the Ethernet event usage
*/

#define ETH_PHY_TYPE        ETH_PHY_LAN8720
#define ETH_PHY_ADDR        0
#define ETH_PHY_MDC        23
#define ETH_PHY_MDIO        18

#define ETH_CLK_MODE ETH_CLOCK_GPIO17_OUT
#define ETH_PHY_POWER 12

#include <ETH.h>

static bool eth_connected = false;

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");
      eth_connected = true;
      break;
    case ARDUINO_EVENT_ETH_DISCONNECTED:
      Serial.println("ETH Disconnected");
      eth_connected = false;
      break;
    case ARDUINO_EVENT_ETH_STOP:
      Serial.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()
{
  Serial.print("ETH MAC: ");
  Serial.print(ETH.macAddress());
  Serial.print(", IPv4: ");
  Serial.println(ETH.localIP());
  delay(1000);
}

Here is the output:
...
entry 0x400805e4
E (122) lan87xx: lan87xx_pwrctl(409): power up timeout
E (122) lan87xx: lan87xx_init(491): power control failed
E (122) esp_eth: esp_eth_driver_install(215): init phy failed
ETH MAC: E (137) esp_eth: esp_eth_ioctl(348): ethernet driver handle can't be null
00:00:00:00:00:00, IPv4: 0.0.0.0

I have two ESP32-POE-ISO Rev L boards purchased from Mouser.com two weeks ago.  They both produce the same output. Using Arduino IDE V 2.2.1, CLI Version 0.34.0. 

What other information can I give you that would help you see the difference between my system and yours where Rev L works fine?

Thanks!
Devin




Title: Re: ESP32-POE-ISO ESPHome: wrong chip ID
Post by: LubOlimex on February 07, 2024, 08:47:01 AM
1. Which variant of ESP32-POE-ISO are you both using exactly? If you are using ESP32-POE-ISO-WROVER - then GPIO17 is not routed to ETH clock, but GPIO0 is and the define should be:

#define ETH_CLK_MODE ETH_CLOCK_GPIO0_OUT

I get the same error as you two if I try to use the code for ESP32-POE-ISO on ESP32-POE-ISO-WROVER board without the change to the clock source.

2. Which version of Arduino package are you using?

3. Which demo are you using - did you load it from the Arduino IDE itself (from File -> Examples -> ESP32 section -> Ethernet -> ETH_LAN8720)? Please do that.

If you are using regular ESP32-POE-ISO with WROOM module (not WROVER) I think there is some mismatch between Arduino IDE for ESP32 package version and the example used. Make sure to update to latest package version from tools -> board manager - (write esp32 in search field) and under esp32 by espressif systems update it. Alternatively, maybe during upgrades and downgrades something in the libraries got broken, I've had it happened here in the past. My first advice is to uninstall it all (including manually deleting folders with Arduino libraries and install a new latest versions). Make sure to keep backup of anything important.
Title: Re: ESP32-POE-ISO ESPHome: wrong chip ID
Post by: daabutts on February 07, 2024, 05:58:51 PM
Ok, that is the problem.  I didn't realize that Olimex built some EPS32-POE-ISO Rev L with WROVER chips and some with WROOM.  Good to know.

Using the change you have above, it works, here is my output:
entry 0x400805e4
ETH Started
ETH Connected
ETH MAC: C4:DD:57:6A:8C:6B, IPv4: 192.168.50.199, FULL_DUPLEX, 100Mbps

This is the code that works:
#define ETH_PHY_TYPE        ETH_PHY_LAN8720
#define ETH_PHY_ADDR        0
#define ETH_PHY_MDC        23
#define ETH_PHY_MDIO        18

//#define ETH_CLK_MODE ETH_CLOCK_GPIO17_OUT  //ESP32-POE-ISO Rev L with WROOM
#define ETH_CLK_MODE ETH_CLOCK_GPIO0_OUT    //ESP32-POE-ISO Rev L with WROVER
#define ETH_PHY_POWER 12

#include <ETH.h>

Thanks for your help!
Title: Re: ESP32-POE-ISO ESPHome: wrong chip ID
Post by: arcimus on February 07, 2024, 08:37:09 PM
I uninstalled Arduino IDE, reinstalled, and used their development release link: https://espressif.github.io/arduino-esp32/package_esp32_dev_index.json

Doing so allowed install of esp32:3.0.0-alpha3 by espressif.  The ETH_LAN8720.ino example now includes the #define lines that Stan mentioned.  I was able to make Stan's changes, compile and upload.

However, we once again get a wrong chip error:
rst:0x1 (POWERON_RESET),boot:0x1f (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0030,len:1256
load:0x40078000,len:13832
load:0x40080400,len:4
load:0x40080404,len:3048
entry 0x40080590
E (42) lan87xx: lan87xx_init(299): wrong chip OUI
E (43) esp_eth: esp_eth_driver_install(229): init phy failed

I have ordered a new ESP32-POE-ISO and will report my findings.

EDIT, just saw LubOlimex questions:
1.  I have ESP32-PoE-ISO Rev.L WROOM
2.  esp32:3.0.0-alpha3 by espressif, noted above
3. I used the ETH_LAN8720.ino you can browse to in the IDE, updated with Stan's definitions.  I did delete folders when I reinstalled.  Here's the code:
/*
    This sketch shows the Ethernet event usage

*/

// 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

#include <ETH.h>

static bool eth_connected = false;

// WARNING: WiFiEvent is called from a separate FreeRTOS task (thread)!
void WiFiEvent(WiFiEvent_t event)
{
  switch (event) {
    case ARDUINO_EVENT_ETH_START:
      Serial.println("ETH Started");
      // The hostname must be set after the interface is started, but needs
      // to be set before DHCP, so set it from the event handler thread.
      ETH.setHostname("esp32-ethernet");
      break;
    case ARDUINO_EVENT_ETH_CONNECTED:
      Serial.println("ETH Connected");
      break;
    case ARDUINO_EVENT_ETH_GOT_IP:
      Serial.println("ETH Got IP");
      ETH.printInfo(Serial);
      eth_connected = true;
      break;
    case ARDUINO_EVENT_ETH_LOST_IP:
      Serial.println("ETH Lost IP");
      eth_connected = false;
      break;
    case ARDUINO_EVENT_ETH_DISCONNECTED:
      Serial.println("ETH Disconnected");
      eth_connected = false;
      break;
    case ARDUINO_EVENT_ETH_STOP:
      Serial.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);  // Will call WiFiEvent() from another thread.
  ETH.begin();
}

void loop()
{
  if (eth_connected) {
    testClient("google.com", 80);
  }
  delay(10000);
}
Title: Re: ESP32-POE-ISO ESPHome: wrong chip ID
Post by: LubOlimex on February 08, 2024, 08:27:57 AM
I believe it is this one: https://github.com/espressif/esp-idf/issues/12557
Title: Re: ESP32-POE-ISO ESPHome: wrong chip ID
Post by: Stanimir5F on February 08, 2024, 08:59:13 AM
Hi arcimus!

I tried with your code (literally copy paste) and it worked here. I am also with the esp32 3.0.0-alpha3. I don't know if that will affect the outcome at all but still I am using Windows 10 x64.

One other thing that you can test if you have installed esp-idf 5.x you can test with this example (https://github.com/OLIMEX/ESP32-POE/tree/master/SOFTWARE/ESP-IDF/ESP32_PoE_Ethernet_IDFv5.3) just to see if it is somehow hardware related..

The 5.3 in the name of the project is because it was done with 5.3 version of the esp-idf although it works with 5.1 as well. Note that in the menuconfig since there is no power pin, the reset phy is set to 12.

Stan, Olimex
Title: Re: ESP32-POE-ISO ESPHome: wrong chip ID
Post by: arcimus on February 09, 2024, 09:31:51 PM
I received another ESP32-POE-ISO from Mouser.  Works!  It's all setup with esphome connected via POE ethernet.  I'll look into returning my original unit.  Thanks much for your assistance.