LAN8720

All ESP32 boards running MicroPython.
Target audience: MicroPython users with an ESP32 board.
Post Reply
ebelouet
Posts: 10
Joined: Mon Jan 15, 2018 9:01 pm

LAN8720

Post by ebelouet » Mon Jan 15, 2018 9:03 pm

Hi,

I would like to know if we can using Lan8720 to make ethernet connexion with Micropython ?

Sincerely
Eric

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: LAN8720

Post by pythoncoder » Thu Jan 18, 2018 5:38 am

There is no official driver for that chip and as far as I know nobody has written their own.
Peter Hinch
Index to my micropython libraries.

loboris
Posts: 344
Joined: Fri Oct 02, 2015 6:19 pm

Re: LAN8720

Post by loboris » Fri Jan 19, 2018 4:59 pm

pythoncoder wrote:
Thu Jan 18, 2018 5:38 am
There is no official driver for that chip and as far as I know nobody has written their own.
There is the driver for ESP32 port: network_lan.c and it works.

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: LAN8720

Post by pythoncoder » Sat Jan 20, 2018 6:40 am

Apologies. Note to self: check subforum topic. I thought the question related to the Pyboard. :oops:
Peter Hinch
Index to my micropython libraries.

296004848
Posts: 2
Joined: Sat Nov 27, 2021 3:17 pm

Re: LAN8720

Post by 296004848 » Sat Nov 27, 2021 3:27 pm

# LAN8720 MODULE

#GPIO00 - EMAC_TX_CLK : nINT/REFCLK (50MHz)
#GPIO16 - SMI_MDC : MDC (relocateable)
#GPIO17 - SMI_MDIO : MDIO (relocateable)
#GPIO19 - EMAC_TXD0 : TX0
#GPIO21 - EMAC_TX_EN : TX_EN
#GPIO22 - EMAC_TXD1 : TX1
#GPIO25 - EMAC_RXD0 : RX0
#GPIO26 - EMAC_RXD1 : RX1
#GPIO27 - EMAC_RX_DV : CRS
#GND : GND
#3V3 : VCC

# press RESET or power ON/OFF ESP32 several times until it boots
# speed: ftp get from ESP32 flash is 300KB/s (3Mbps)

# some free pins recommended for ESP32 to be used as JTAG programmer

#GPIO23 JTAG_TDI
#GPIO34 JTAG_TDO (was 19)
#GPIO18 JTAG_TCK
#GPIO5 JTAG_TMS (was 21)


import network
from machine import Pin
nl=network.LAN(mdc=Pin(16),mdio=Pin(17),power=None,id=0,phy_addr=1,phy_type=network.PHY_LAN8720)
nl.active(1)

>>> %Run -c $EDITOR_CONTENT
Traceback (most recent call last):
File "<stdin>", line 28, in <module>
OSError: esp_eth_driver_install failed
>>> %Run -c $EDITOR_CONTENT
Traceback (most recent call last):
File "<stdin>", line 28, in <module>
OSError: esp_eth_set_default_handlers failed (invalid parameter)

I used the above code but reported the error, what is the solution?

wangshujun@tom.com
Posts: 61
Joined: Fri Feb 15, 2019 9:22 am

Re: LAN8720

Post by wangshujun@tom.com » Tue Nov 30, 2021 12:57 am

pythoncoder wrote:
Sat Jan 20, 2018 6:40 am
Apologies. Note to self: check subforum topic. I thought the question related to the Pyboard. :oops:
After comparison, lan8720 and lan8742 are completely compatible in basic registers. It can work normally to directly match the drive of lan8742 with the built-in MAC on the boards of f407 and h743

wangshujun@tom.com
Posts: 61
Joined: Fri Feb 15, 2019 9:22 am

Re: LAN8720

Post by wangshujun@tom.com » Tue Nov 30, 2021 1:29 am

#GPIO16 - SMI_MDC : MDC (relocateable)
#GPIO17 - SMI_MDIO : MDIO (relocateable)

These two IO can be mapped arbitrarily. I actually tested them with 18 and 23, and they worked perfectly

beyonlo
Posts: 58
Joined: Thu Nov 26, 2015 8:03 pm

Re: LAN8720

Post by beyonlo » Wed Apr 13, 2022 9:22 pm

Will the SSL works on the socket over ethernet LAN8720 like as SSL works on the socket over the WiFi?

Post Reply