Olimex ESP32-EVB Board Ethernet Not Working

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
simat
New user
Posts: 8
Joined: 06 Jul 2023, 14:55
Location: UK

Olimex ESP32-EVB Board Ethernet Not Working

#1 Post by simat » 06 Jul 2023, 15:18

Hi,

I've been using ESPeasy for a while now to post DS1820 temperature values into Domoticz with a ESP32-WROOM-32E over wifi. I've now purchased a Olimex ESP32-EVB board that has onboard LAN8710A ethernet but I can't get the ethernet to work.

I know that the Olimex board is supported as it is mentioned in the documentation https://espeasy.readthedocs.io/en/lates ... dware.html and direct support is also mentioned in https://github.com/letscontrolit/ESPEasy/pull/3229

Ethernet Settings are as follows

Preferred Network Medium = Ethernet
Ethernet Phy Type = LAN8710
Ethernet Phy Address = 0
GPIO > Ethernet MDC Pin = GPIO-23
GPIO < Ethernet MIO pin = GPIO-18
GPIO > Ethernet Power pin = None
Ethernet Clock = External crystal osc.

as per TD-ers entry in https://github.com/letscontrolit/ESPEas ... 4b029cfede
I've also set
i2c_sda = 13;
i2c_scl = 16;

I've check these pins on the Olimex board datasheet - Rev K https://github.com/OLIMEX/ESP32-EVB/blo ... _Rev_K.pdf

I've tried setting static IPs on the interface but still doesn't work. WIFI is fine.

Does anyone have any suggest for futher diagnosis of the problem ?

ESP32-D0WDQ5-V3 with ESPEasy_mega_20230623_custom_ESP32_4M316k_ETH.factory.bin have also tried normal release.

Best regards

Simon.

TD-er
Core team member
Posts: 8756
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Olimex ESP32-EVB Board Ethernet Not Working

#2 Post by TD-er » 06 Jul 2023, 17:09

Do you see any LED light up on the Ethernet switch when you plug in the board?
Also make sure NOT to use "high end" Ethernet cables with metal ground on the RJ45 plug.
Those may cause grounding issues with the switch and the Olimex board as those boards typically don't have isolation for the Ethernet port.

If there is no LED lighting up on the switch, probably the Ethernet chip doesn't get power.

simat
New user
Posts: 8
Joined: 06 Jul 2023, 14:55
Location: UK

Re: Olimex ESP32-EVB Board Ethernet Not Working

#3 Post by simat » 06 Jul 2023, 17:55

Hi TD-er,

Thanks for the reply, yes, we get green link lights both ends, with a flashing yellow LED on the board end and on the switch end.

My RJ45s are unsheilded so no ground loops and straight through not crossover.

simat
New user
Posts: 8
Joined: 06 Jul 2023, 14:55
Location: UK

Re: Olimex ESP32-EVB Board Ethernet Not Working

#4 Post by simat » 06 Jul 2023, 18:01

Get this on the serial port.

rst:0x1 (POWERON_RESET),boot:0x1b (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:2
load:0x3fff0030,len:184
load:0x40078000,len:12732
ho 0 tail 12 room 4
load:0x40080400,len:2908
entry 0x400805c4
▒U177 : Info :

INIT : Booting version: ESP_Easy_mega_20230623_custom_ESP32_4M316k_ETH, (GitHub Actions) mega-20230623 (ESP32 SDK 4.4.5.230614)
179 : Info : INIT : Free RAM:248412
180 : Info : INIT : Cold Boot - Restart Reason: CPU0: Vbat power on reset CPU1: for APP CPU, reseted by PRO CPU
181 : Info : FS : Mounting...
210 : Info : FS : Mount successful, used 141815 bytes of 290156
228 : Info : CRC : Settings CRC ...OK
277 : Info : CRC : SecuritySettings CRC ...OK
340 : Info : INIT : I2C
342 : Info : INIT : SPI not enabled
374 : Info : INIT : Free RAM:242496
406 : Info : INFO : Plugins: 26 (ESP32 SDK 4.4.5.230614)
407 : Info : ETH PHY Type: LAN8710/LAN8720 PHY Addr: 0 Eth Clock mode: External crystal oscillator MDC Pin: 23 MIO Pin: 18 Power Pin: -1
408 : Error : ETH: Settings not correct!!!
409 : Info : Set Network mode: WiFi
511 : Info : WIFI : Set WiFi to STA
612 : Info : WiFi : Event STA Started
717 : Info : WiFi : Start network scan all channels
6933 : Info : WiFi : Scan finished, found: 6
6936 : Info : WiFi : Best AP candidate: BTHH-AA55 60:26:EF:3B:4B:82 Ch:11 (-75dBm) - gn
6937 : Info : WiFi : Added known candidate, try to connect
6938 : Info : WIFI : Arduino wifi status: WL_DISCONNECTED 6 ESPeasy internal wifi status: DISCONNECTED
6942 : Info : Webserver: start
8295 : Info : WD : Uptime 0 ConnectFailures 0 FreeMem 193428 WiFiStatus WL_DISCONNECTED 6 ESPeasy internal wifi status: DISCONNECTED



Line "408 : Error : ETH: Settings not correct!!!"

But "407 : Info : ETH PHY Type: LAN8710/LAN8720 PHY Addr: 0 Eth Clock mode: External crystal oscillator MDC Pin: 23 MIO Pin: 18 Power Pin: -1" match my settings..

What am I missing. Does i2c need additional settings ?

Is a delay before starting the ethernet required - as per https://github.com/espressif/arduino-esp32/issues/6142

The Olimex forum mentions the below delay

void setup()
{
delay(1000);
Serial.begin(115200);
WiFi.onEvent(WiFiEvent);
ETH.begin();
}

simat
New user
Posts: 8
Joined: 06 Jul 2023, 14:55
Location: UK

Re: Olimex ESP32-EVB Board Ethernet Not Working

#5 Post by simat » 06 Jul 2023, 18:19

OK, getting somewhere now, I changed the Ethernet Power Pin to GPIO32 which is one of the relays on the ESP32-EVB board.

The ethernet now works but we lose control of the RELAY as if we turn the relay off, we would loose network access.


What should the power pin be ?

INIT : Booting version: ESP_Easy_mega_20230623_custom_ESP32_4M316k_ETH, (GitHub Actions) mega-20230623 (ESP32 SDK 4.4.5.230614)
180 : Info : INIT : Free RAM:248412
181 : Info : INIT : Cold Boot - Restart Reason: CPU0: Vbat power on reset CPU1: for APP CPU, reseted by PRO CPU
182 : Info : FS : Mounting...
211 : Info : FS : Mount successful, used 141815 bytes of 290156
229 : Info : CRC : Settings CRC ...OK
279 : Info : CRC : SecuritySettings CRC ...OK
342 : Info : INIT : I2C
344 : Info : INIT : SPI not enabled
376 : Info : INIT : Free RAM:242452
408 : Info : INFO : Plugins: 26 (ESP32 SDK 4.4.5.230614)
409 : Info : ETH PHY Type: LAN8710/LAN8720 PHY Addr: 0 Eth Clock mode: External crystal oscillator MDC Pin: 23 MIO Pin: 18 Power Pin: 32
410 : Info : ETH power ON
811 : Info : ethResetGPIOpins()
2442 : Info : ETH IP : Static IP : 10.0.32.55 GW: 10.0.32.241 SN: 255.255.255.0 DNS: 8.8.8.8
2446 : Info : ETH event: Started
2447 : Info : ETH event: Connected
2447 : Info : ETH event: Got IP
2498 : Info : Webserver: start
2499 : Info : processEthernetConnected()
2500 : Info : ETH IP : Static IP : 10.0.32.55 GW: 10.0.32.241 SN: 255.255.255.0 DNS: 8.8.8.8
2502 : Info : ETH event: Got IP
2503 : Info : ETH MAC: E0:5A:1B:66:54:C7 Static IP: 10.0.32.55 (ESP-Ethernet-2) GW: 10.0.32.241 SN: 255.255.255.0 DNS: 8.8.8.8/0.0.0.0 FULL_DUPLEX 100Mbps duration: 54 ms
2504 : Info : WIFI : Arduino wifi status: WL_NO_SHIELD 255 ESPeasy internal wifi status: DISCONNECTED
2505 : Info : UDP : Start listening on port 8266
2506 : Info : firstLoopConnectionsEstablished
3832 : Info : WD : Uptime 0 ConnectFailures 0 FreeMem 206172 EthSpeedState Link Up Full Duplex 100Mbps ETH status: Conn. IP Init
33832 : Info : WD : Uptime 1 ConnectFailures 0 FreeMem 205920 EthSpeedState Link Up Full Duplex 100Mbps ETH status: Conn. IP Init
63832 : Info : WD : Uptime 1 ConnectFailures 0 FreeMem 205928 EthSpeedState Link Up Full Duplex 100Mbps ETH status: Conn. IP Init

simat
New user
Posts: 8
Joined: 06 Jul 2023, 14:55
Location: UK

Re: Olimex ESP32-EVB Board Ethernet Not Working

#6 Post by simat » 06 Jul 2023, 18:35

Setting for ETHERNET power to GPIO23 also enables the interface.

406 : Info : ETH PHY Type: LAN8710/LAN8720 PHY Addr: 0 Eth Clock mode: External crystal oscillator MDC Pin: 23 MIO Pin: 18 Power Pin: 23
407 : Info : ETH power ON
808 : Info : ethResetGPIOpins()

Is this a bug ?

TD-er
Core team member
Posts: 8756
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Olimex ESP32-EVB Board Ethernet Not Working

#7 Post by TD-er » 06 Jul 2023, 19:49

Yep, the check for correct settings is probably a bit too strict.
I will look into this.
You could also use some other pin like GPIO-2 which is probably connected to a LED, as it is only toggled when Ethernet is turned on.
It may also toggle when you remove the Ethernet plug, but not sure if that's still in there.

Edit:
Made an issue for it: https://github.com/letscontrolit/ESPEasy/issues/4724

User avatar
Ath
Normal user
Posts: 3519
Joined: 10 Jun 2018, 12:06
Location: NL

Re: Olimex ESP32-EVB Board Ethernet Not Working

#8 Post by Ath » 06 Jul 2023, 20:12

Found this page that quite clearly lists all GPIO pins and their function on this board.
Also, the official schematics for the board are available in this pdf file, but I've been unable to determine yet what the actual ETH-PWR pin should be :?

Switching on the relay to power the ETH isn't as this is expected to be working, or it would be a hardware 'bug', also the hardware design doesn't suggest this.
/Ton (PayPal.me)

simat
New user
Posts: 8
Joined: 06 Jul 2023, 14:55
Location: UK

Re: Olimex ESP32-EVB Board Ethernet Not Working

#9 Post by simat » 06 Jul 2023, 20:27

With Power pin set to GPIO23 or 17 (no LED on this board)

Disconnecting network cable, enables the WIFI and that connects fine, and then reconnecting the network cable, drops the WIFI connection and re-establishes NIC link.

Looking at the schematic, there is no "PWR EN pin" its hardwired to 3.3v and the OSC is external.

Works very nicely and super fast.

User avatar
Ath
Normal user
Posts: 3519
Joined: 10 Jun 2018, 12:06
Location: NL

Re: Olimex ESP32-EVB Board Ethernet Not Working

#10 Post by Ath » 06 Jul 2023, 21:00

I've just added a PR #4725 to relax the Ethernet checks to allow that Power GPIO pin to be set to None.
Can be tested from this GH Actions run once the build is finished.
/Ton (PayPal.me)

TD-er
Core team member
Posts: 8756
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Olimex ESP32-EVB Board Ethernet Not Working

#11 Post by TD-er » 06 Jul 2023, 22:54

Just one warning about the LAN chip used on this board...
It is possible to fry the chip and it doesn't take that much to do so.
Not sure what happened on the boards I have with that chip, whether it was a matter of badly handling it or static discharge.

I have used this chip myself on a few boards I designed and its schematics were highly "inspired" by the Olimex boards.
However I have seen in total 3 boards which were working just fine and after they have been moved to another enclosure the LAN chip was no longer working. (3 boards out of roughly 500 pcs)
So it is not very likely to get damaged, but since I have absolutely no clue to how these got damaged, I just want to warn you it is possible to damage these chips.

simat
New user
Posts: 8
Joined: 06 Jul 2023, 14:55
Location: UK

Re: Olimex ESP32-EVB Board Ethernet Not Working

#12 Post by simat » 07 Jul 2023, 07:32

What revision of Olimex board do you have, mine is Rev.K and has the magnetics built into the RJ45 socket, might not be too good for galvanic isolation ?

I also have a chinese board (Dingtian 4CH relay) with the LAN8720A, that uses seperate magnetics and has lasted many year through some nasty lightning storms.

S.

TD-er
Core team member
Posts: 8756
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Olimex ESP32-EVB Board Ethernet Not Working

#13 Post by TD-er » 07 Jul 2023, 12:05

I have my Olimex boards for quite some time, so the revision is probably a lot earlier in the alfabet.

The magnetics/coils are there only for the data lines, not for the metal shield of the RJ45 header.
So any shielded ethernet cable with metal shields on the connector probably has those connected on both ends and this will connect the ground of the board with the ground of the switch and those may differ quite a bit.

simat
New user
Posts: 8
Joined: 06 Jul 2023, 14:55
Location: UK

Re: Olimex ESP32-EVB Board Ethernet Not Working

#14 Post by simat » 08 Jul 2023, 08:35

Ath wrote: 06 Jul 2023, 21:00 I've just added a PR #4725 to relax the Ethernet checks to allow that Power GPIO pin to be set to None.
Can be tested from this GH Actions run once the build is finished.
Morning,

I tested - ESPEasy_mega_20230706_ESP32_PR#4725_5479113156\bin\ESP_Easy_mega_20230706_normal_ESP32_4M316k_ETH.factory.bin

with the Ethernet Power Pin set to NONE and it all works fine.

Thanks for the quick response.

Simon.

Post Reply

Who is online

Users browsing this forum: No registered users and 41 guests