SP32-POE-ISO-WROVER-EA Ethernet not working

Started by woodenplastic, September 13, 2023, 09:24:47 PM

Previous topic - Next topic

woodenplastic

Hi, with my ESP32 POE ISO i tried the basic ethernet example.
I just get this in the serial Monitor:

E (3253) lan87xx: lan87xx_pwrctl(409): power up timeout
E (3253) lan87xx: lan87xx_init(491): power control failed
E (3253) esp_eth: esp_eth_driver_install(215): init phy failed
E (3263) esp_eth: esp_eth_ioctl(348): ethernet driver handle can't be null

this are my definitions:
// NETWORK ETHERNET//////////////////////////////////////////////////////////////////////////////
#define ETH_CLK_MODE ETH_CLOCK_GPIO17_OUT
#define ETH_PHY_POWER 12
#include <ETH.h>


this is my setup begin:

void setup() {
  // CONNECTIONS ///////////////////////////////////////////////////////////////////////////////////
  delay(1000);
  Serial.begin(115200);
  WiFi.mode(WIFI_STA);
  delay(1000);
  // OLED DISPLAY ////////////////////////////////////////////////////////////////////////////

  if (!display.begin(0x3D)) {
    Serial.println("Unable to initialize OLED");
  } else {
    display.clearDisplay();
    void display_loading();
  }
  delay(1000);
  // BUTTON HANDLER //////////////////////////////////////////////////////////////////////////////
  if (mcp.begin() != 0) {
    Serial.println("Unable to initialize GPIOs");
  }
  mcp.pinMode(mcp.eGPA, INPUT_PULLUP);
  mcp.pinMode(mcp.eGPB, OUTPUT);
  mcp.digitalWrite(mcp.eGPB, HIGH);
  I2C_second.begin(SDA_PIN, SCL_PIN, 100000);
  // JSON CONFIG IN SPIFFS ///////////////////////////////////////////////////////////////////////////
  bool spiffsSetup = loadConfigFile();
  if (!spiffsSetup) {
    Serial.println(F("Forcing config mode as there is no saved config"));
  }
  delay(1000);
  // CONNECTIONS ///////////////////////////////////////////////////////////////////////////////////////
  WiFi.onEvent(WiFiEvent);
  ETH.begin();
  delay(1000);
  Udp.begin(localPort);
  PHY_MIDI.begin(MIDI_CHANNEL_OMNI);

  // BATTERY /////////////////////////////////////////////////////////////////////////////////
  pinMode(BATTERY, INPUT);
  pinMode(POWER_SENSE, INPUT);


please tell me what to do in Arduino IDE. The same sketch is working perfect on non wrover boards.
I get the same serial output when i do the basic ethernet example.

LubOlimex

The EMAC clock pin is GPIO0 when WROVER is used. This is visible in the middle of the schematic.

WROVER module uses two extra pins for the PSRAM and these pins can't be used for other purposes. This is important especially if you switch from regular version to WROVER version. This is easily noticeable in the schematic. GPIO17 and GPIO16 are used for the RAM, and those are replaced with, respectively, GPIO0 (if you previously used GPIO0 for other purposes, you have to free it) and GPIO33.
Technical support and documentation manager at Olimex

woodenplastic

Thank you very much!
For a noob like me its not easy to read schematics and i had enough trouble to set up I2C with other pins.
It would be lovely if there was a short summary of "watchouts" for wrover models on github.

Thanks again for your great product and Service!

LubOlimex

Glad that it works, I am cooking some updates in the manual regarding that part.
Technical support and documentation manager at Olimex

woodenplastic

Thanks!
Im tryin it out right now.
That means i have to define:

ETH_CLK_MODE ETH_CLOCK_GPIO0_OUT

Then i have to change my I2C Standart Pin for SCL to something else then GPIO16. the rest is taken care of by the board Manager?

It seems working, thanks again.

LubOlimex

Yes, pretty much. To re-iterate, when using WROVER (instead of WROOM), GPIO16 and GPIO17 are used by the PSRAM, and in our design:

GPIO16 gets replaced by GPIO33 (since GPIO16 is used for the PSRAM).

GPIO17 is replaced by GPIO0 (since GPIO17 is used for the PSRAM, but you already took care of that).
Technical support and documentation manager at Olimex

muenchris

#6
I have the same problem using your sample from here:
https://github.com/OLIMEX/ESP32-POE/blob/master/SOFTWARE/ARDUINO/ESP32_PoE_Ethernet_Arduino/ESP32_PoE_Ethernet_Arduino.ino

Even if I add the line
#define ETH_CLK_MODE ETH_CLOCK_GPIO0_OUT

before the #include ETH.h
I do not get a successful init of the ETH. What am I missing?

Edit:
Using this line as the ETH Begin I get at least rid of the errors, and it works!
    ETH.begin(ETH_PHY_ADDR, ETH_PHY_POWER, ETH_PHY_MDC, ETH_PHY_MDIO, ETH_PHY_TYPE, ETH_CLOCK_GPIO0_OUT, false);

I was trying to use for I2C:
GPIO 13 for SDA
GPIO 33 for SCL
But none of my sensors work with that.
I also have OLIMEX-POE-ISO (no WROVER) and use
GPIO 13 for SDA
GPIO 16 for SCL
And that works fine with the same sensors.
What am I missing ?

LubOlimex

As far I as understood you got the Ethernet working with the WROVER. My advice is to just use the built-in the ESP32 for Arduino package Ethernet example, from the examples, go to the ESP32 tab with examples and under Ethernet go to ETH_LAN8720.

About the GPIOs between WROOM and WROVER - did you change in your code GPIO16 to GPIO33?

Technical support and documentation manager at Olimex