Hi,
I would like to know if we can using Lan8720 to make ethernet connexion with Micropython ?
Sincerely
Eric
LAN8720
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: LAN8720
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.
Index to my micropython libraries.
Re: LAN8720
There is the driver for ESP32 port: network_lan.c and it works.pythoncoder wrote: ↑Thu Jan 18, 2018 5:38 amThere is no official driver for that chip and as far as I know nobody has written their own.
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: LAN8720
Apologies. Note to self: check subforum topic. I thought the question related to the Pyboard.
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.
Re: LAN8720
# 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?
#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?
-
- Posts: 61
- Joined: Fri Feb 15, 2019 9:22 am
Re: LAN8720
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 h743pythoncoder wrote: ↑Sat Jan 20, 2018 6:40 amApologies. Note to self: check subforum topic. I thought the question related to the Pyboard.
-
- Posts: 61
- Joined: Fri Feb 15, 2019 9:22 am
Re: LAN8720
#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
#GPIO17 - SMI_MDIO : MDIO (relocateable)
These two IO can be mapped arbitrarily. I actually tested them with 18 and 23, and they worked perfectly
Re: LAN8720
Will the SSL works on the socket over ethernet LAN8720 like as SSL works on the socket over the WiFi?