ESP32 + LAN8720 (Connection failed)

haythemjls
Posts: 27
Joined: Mon Apr 06, 2020 1:32 pm

ESP32 + LAN8720 (Connection failed)

Postby haythemjls » Fri Nov 12, 2021 8:59 am

Hello,
I'm working on a project based on ethernet communication via ESP32 + LAN8720 module. I tried to follow two hardware configuration:

-Configuration 1 : (using external clock 50 MHz)

#include <ETH.h>
#define ETH_CLK_MODE ETH_CLOCK_GPIO0_IN //(4k7 pullup)
// Pin# of the enable signal for the external crystal oscillator
#define ETH_POWER_PIN 17 // (phy_power 4k7 pulldown and extra wire to enable pin)
// Type of the Ethernet PHY (LAN8720 or TLK110)
#define ETH_TYPE ETH_PHY_LAN8720
// I²C-address of Ethernet PHY (0 or 1 for LAN8720, 31 for TLK110)
#define ETH_ADDR 0
// Pin# of the I²C clock signal for the Ethernet PHY
#define ETH_MDC_PIN 23
// Pin# of the I²C IO signal for the Ethernet PHY
#define ETH_MDIO_PIN 18



-Configuration 2 : (using internal clock 50 MHz from GPIO17 or GPIO16 or GPIO0)

#include <ETH.h>
#define ETH_CLK_MODE ETH_CLOCK_GPIO17_OUT
// Pin# of the enable signal for the external crystal oscillator (-1 to disable for internal APLL source)
#define ETH_POWER_PIN -1
// Type of the Ethernet PHY (LAN8720 or TLK110)
#define ETH_TYPE ETH_PHY_LAN8720
// I²C-address of Ethernet PHY (0 or 1 for LAN8720, 31 for TLK110)
#define ETH_ADDR 0
// Pin# of the I²C clock signal for the Ethernet PHY
#define ETH_MDC_PIN 23
// Pin# of the I²C IO signal for the Ethernet PHY
#define ETH_MDIO_PIN 18


Despit these tow configuration, I failed to make the communication succeed and always I get this message :
E (1024) emac: Timed out waiting for PHY register 0x2 to have value 0x0007(mask 0xffff). Current value 0xffff
E (2024) emac: Timed out waiting for PHY register 0x3 to have value 0xc0f0(mask 0xfff0). Current value 0xffff
E (2024) emac: Initialise PHY device Timeout


Any help please.

pipi61
Posts: 56
Joined: Fri Dec 23, 2016 10:58 pm

Re: ESP32 + LAN8720 (Connection failed)

Postby pipi61 » Wed Nov 17, 2021 10:18 pm

Whats modules used? How to wired/modificated?
try eth_addr 1

see more information https://sautter.com/blog/ethernet-on-es ... g-lan8720/ (old page)
https://github.com/espressif/arduino-es ... /1.0.5-rc6
esp32-1.0.5-rc6.zip\esp32-1.0.5-rc6\libraries\WiFi\examples\ETH_LAN8720....

mostafahk
Posts: 4
Joined: Tue Dec 29, 2020 6:07 am

Re: ESP32 + LAN8720 (Connection failed)

Postby mostafahk » Mon Nov 22, 2021 9:11 am

You should provide schematic info to help help on this issue.

haythemjls
Posts: 27
Joined: Mon Apr 06, 2020 1:32 pm

Re: ESP32 + LAN8720 (Connection failed)

Postby haythemjls » Mon Nov 22, 2021 2:01 pm

Hi and thank you for your reply, I have used LAN8720 module which hase crystal oscilator on the top face, and without "Waveshare" writen on the PCB.

I've solved problem of connection by soldering esp32 with LAN8720 module and using smals wires, but in the test I noticied there is a delay (5 min) in loading google.

any help please ?

pipi61
Posts: 56
Joined: Fri Dec 23, 2016 10:58 pm

Re: ESP32 + LAN8720 (Connection failed)

Postby pipi61 » Wed Nov 24, 2021 5:57 pm

I can't help you.
You do not provide any information.
No schematic, no program....
what it means "loading Google", what is/where is "google", is it your browser, website or whatever ?????
you need to be able to ask :)

haythemjls
Posts: 27
Joined: Mon Apr 06, 2020 1:32 pm

Re: ESP32 + LAN8720 (Connection failed)

Postby haythemjls » Fri Nov 26, 2021 12:35 pm

Hi !
I changed ESP32 with new version and the problem has been solved :)

Who is online

Users browsing this forum: No registered users and 57 guests