can same firmware work for both ESP32-POE and ESP32-POE2 with network enabled ?

Started by mihaiadrian, July 20, 2025, 02:02:13 AM

Previous topic - Next topic

mihaiadrian

I see this written in ESP32-POE2:


    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.


So, this means, that instead of using this:

#define ETH_CLK_MODE ETH_CLOCK_GPIO17_OUT
#define ETH_PHY_POWER 12

the ETH_CLK_MODE will likely need to be set to 0

This is problematic in a infrastructure containing already old ESP32-POE where I want to add ESP32-POE2 as well and use same firmware. Because same firmware, as I understand , will not work for all the board. Of course, I could fix it at OTW (over the cable update ) software level to have 2 firmware and update some boards with a firmware and another boards with other firmware but I would like to avoid this - any mistake can lead to ... need to update manually the board not remotley which would be a pain. Until now, it works for me , with same firmware deployed via OTW for esp32-poe and esp32-poe-iso.

What I want to know - if there is a way to have 1/same firmware but which can work on both esp32-poe and esp32-poe2 and with network support enabled ?  If not, at least any way to read type of board from a ROM ? then I could dig into Ethernet to see if I can set that GPIO not from a define at compile time but later during running ( who knows if possible .. )

Also, do the pin configuration for esp32-poe32 is similar as described here  https://www.olimex.com/Products/IoT/ESP32/ESP32-POE/resources/ESP32-POE-GPIO.png  ?

thanks and regards,
Mihai

LubOlimex

You can do it in single firmware. There are different ways to do it.

For example, you can first read whether the main ESP32 chip is WROOM or WROVER via command and then based on the response load proper pin for the Ethernet clock. If it is WROVER then load:

#define ETH_CLK_MODE ETH_CLOCK_GPIO17_OUT

If it is WROOM then load:

#define ETH_CLK_MODE ETH_CLOCK_GPIO0_OUT

This can be done via the software means but command depends on the exact software that you use.

You can of course do a dirty workaround where your code does one of the initializations then checks if there is ping after 5 seconds and if there isn't, do the other initialization and check if there is ping then continue with the rest of the code. This will work empirically. You can always use GPIO12 to reset the Ethernet module between tests.
Technical support and documentation manager at Olimex