multiple ESP32-POE2 (new) do not randomly start with POE power

Started by joopheuvel, May 04, 2025, 12:36:19 PM

Previous topic - Next topic

joopheuvel

ESP32-POE2 does not randomly with POE.
I have 8 new POE2 and they after powering up the sometimes start fine, sometimes they hang.
I have added serial logging as first line in setup() but the system does not even get there.
It looks like that when I start with USB power, and after that connect (upowered) ETH it works fine and the board starts normally.
Also peculiar, if I connect the board to powered POE (48v), and the board does not start, pressing the reset button does the job and then starts the boarrd okay.
I am compiling with Arduino IDE and board manager ESP32 1.06 (so select POE and have pin assignment for wrover ethernet in my code) as newer versions are too bulky and have issues. I have some 100 ESP-ISO running without issues with this code. Code cannot be issue because when board starts, all works fine, ETH, Wifi, BLE, connections.
Help is appreciated as I have trying to find the issue for days now...
Loops like with POE2 power, the reset circuit does not properly get executed or order of timing is an issue?
Thanks.
Joop van den heuvel

LubOlimex

Have you enabled PSRAM from the board selection settings?

You said you have pin assignment for GPIO as Ethernet clock source pin, but is it placed in the proper place? Can you confirm it is placed before including ETH.h for ETH.begin()?

What are the exact definitions for the Ethernet that you used?

Technical support and documentation manager at Olimex

joopheuvel

Thanks for getting back to me!
This is the code for the Ethernet and yes it is before the include of ETH.h and ETH.begin().

    #ifndef ETH_PHY_TYPE
      #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_GPIO0_OUT
    #endif
  #endif

I have IDE boardmanager 1.06 and I cannot select PSRAM/Wrover from the pulldown in that configuration. I see that for the boardmanager 3.0 also some other extra olimex specific code is downloaded, can that be the issue?
The PSram selection is only possible with board manager 3.00 and up. However if I choose that board manager I get many Firebase/strange SSL/TCP timeout errors making the operation unreliable. I would like to stay on 1.06, I have 100+ with POE-ISO running with this codebase just fine. And as indicated in 20% of the cases I plug in the POE-ETH cable it starts, in the other cases it doesn't.
Thanks!
Joop

LubOlimex

The lack of PSRAM might be an issue. Maybe instead of selecting ESP32-POE from the menu - use some generic "ESP32 WROVER module" entry or similar?

Another idea to lower down the possibilities - temporary switch to latest release of ESP32 package for Arduino IDE (I guess 3.2.0). Then try simple Ethernet code and see if the problem on power up remains. If it goes away then the problem was in the software/libraries/esp32 package version. If it remains then it could be something bigger.
Technical support and documentation manager at Olimex

joopheuvel

Indeed, One of the things I tried as well, going to the latest ESP32 PlatformManager. When I do, I run into multiple issues of SD MMC not working, to Firebase giving compiler errors but can switch off oblviously) to some other libraries I need to rewrite (OTA and FirebaseStorage). Also, the new Firebase libraries have their stability issues as well. Anyway, I may need to go ahead and overcome/bypass all this to do a try with the latest platform manager. What extra's are implemented in the download with latest IDE platform manager (I see in boards.txt)  ? Does extra stability code get added?

" esp32-poe.menu.PSRAM.enabled.build.defines=-DBOARD_HAS_PSRAM -mfix-esp32-psram-cache-issue -mfix-esp32-psram-cache-strategy=memw "

Thanks.
Joop

LubOlimex

What I can say for sure is I get errors with Ethernet when:

- I use latest ESP32 release;
- I select ESP32-POE from the board selector;
- I disable PSRAM from the board options.

This leads to Ethernet problems with ESP32-POE2.

Technical support and documentation manager at Olimex

joopheuvel

Hi.
I assume you get that ethernet error, because when you select PSRAM,
also the pin assignments from the ETH controller are set for Wrover (or did
you define them in the sketch/code?).
For me the problem is that starting with POE power simply is unreliable. Sometimes it works, but also sometimes it doesn't. Does not seem to be SW related.
Strangly enough when I start with USB power (and a regular ethernet cable), it works 100% of the time.
And... when it does not start with POE power, when I press the reset button, the board always does start after that buttonpress. Looks more to me a POE power timing Reset_ESP32 issue?
Thx.
Joop

LubOlimex

Maybe it can be a problem or bug in the older libraries in ESP32 for Arduino IDE?

Maybe adding a delay before Ethernet initialization might fix it. The thing is that the ESP32 chip needs to be well powered before the Ethernet has started, because if the Ethernet starts before the clock coming from the ESP32, then the Ethernet will hang. Usually that is controlled by the Ethernet power pin (e.g. keep the Ethernet in reset via GPIO12 and then after some moments, say 1 second, release it and initialize it). But maybe this was not properly done in 1.0.6.
Technical support and documentation manager at Olimex

joopheuvel

Thanks.
I already had delays first thing in the setup(). Tried everything from nothing to 1s, to 10s.
The only alternative seems to be to go to and test the latestboardmanager and rewrite all code for the parts that then do not properly work yet (SDMMC, Firebase, OTA).
Or I redesign everything and have it run on a POE(ISO), these are reliable and allways start without issues.
Joop

joopheuvel

Hi.
In dispair, I tried this just after the setup:

  pinMode(ETH_PHY_POWER, OUTPUT);  // SECOND LED RELAY FOR ATTENTION
  pinMode(ETH_CLK_MODE, OUTPUT);
  digitalWrite(ETH_PHY_POWER, OFF);  // SET OFF
  digitalWrite(ETH_CLK_MODE, OFF);  // SET OFF

  delay(3000);

Then a bit later comes the ETH.begin() code etc...

And for now I am getting better results after plugging in the POE_ETH cable
I am getting 10 out of 10 good startups. Cross fingers.
Do you understand why this may help?
Joop

LubOlimex

Yes. Probably the old libraries (in 1.0.6) didn't hold the Ethernet chip in reset long enough, so it turned on too fast. If we want a good start we want Ethernet chip to be held in reset via the PHY power pin (GPIO12) UNTIL the Ethernet clock is provided to the LAN8720 chip.

IF LAN8720 gets powered up BEFORE ESP32's GPIO provided Ethernet clock, the LAN8720 can hang. This is mention in LAN8720's manual on page 33:

"During a Hardware reset, an external clock must be supplied to the XTAL1/CLKIN signal."

https://ww1.microchip.com/downloads/en/devicedoc/00002165b.pdf
Technical support and documentation manager at Olimex

joopheuvel

Great!
Happy that I have your acknowledgement and it was not just hit and mis. Relieved!
Final question, this does not seem to bethe  case for the narrow POE and POE-ISO based boards, as they are wired differently? Or they have other ETH controllers?
Joop

LubOlimex

Depends on which ESP32-POE and ESP32-POE-ISO variant you mean. The base variant with WROVER chip is different compared to ESP32-POE2. It uses GPIO17 for Ethernet clock and GPIO17 is just a regular pin which probably is available sooner. While in ESP32-POE2 and ESP32-POE-WROVER or ESP32-POE-ISO-WROVER the Ethernet clock pin is GPIO0 which is a bootstrap pin so it is held in certain level during boot to ensure proper boot configuration.
Technical support and documentation manager at Olimex