You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
had some fun time making a LilyGo board work with MP-1.19.1and later compiled with esp idf 4.4.2. It was quite a lengthy endeavor before I saw the Ethernet control lights coming on and the adapter registering its IP address. For the impatient the fork I used is available on https://github.com/wthie/micropython the modifications are in one place and are minimal.
Why use LAN when WLAN is onboard already?
In my experience developing and building LoRa base stations I found that with a lot of safety features like watchdog code, reboots, reconnects I was not able to keep a board able to reconnect on WLAN for more than a week, rebooting was not my preferred way of operating several of these basestations. The search was on for a more stable connection to network based resources and with this I bought a LilyGo board with a LAN8720 adapter. After making the adapter work I now enjoy not only a week of uptime and connectivity in my base stations but months and hopefully years.
The search for a solution to make LAN 8720 power up and work
To my dismay and using the mp-1.19.1 stable branch I was first not able to make the adapter work. Scrounging the web I found quite a few people dropping acid remarks about low board quality but no one seemed to have information ready which would explain all these non functioning boards with LAN 8720 adapters including mine (8720 being an adapter which in my opinion works really well). Studying the hardware and the pins used on several of the boards it became clear that the pin4 was used to power on/off the LAN 8720 adapter in all of the cases of non functioning boards. Digging through the code revealed that sample code provided for different boards did not use the infamous pin4 but retrofitting code for powering the LAN8720 with pin4 into the sample C code made the adapter work. After that it was a no brainer to retrofit the ports/esp32/network_lan.c file with an additional parameter for the power pin.
Python code to initialize the LAN 8720
# the pins used are for a LilyGo T-internet-COM board
#
import network
import machine as m
station=network.LAN(id=0, mdc=m.Pin(23), mdio=m.Pin(18), power=m.Pin(4), reset=m.Pin(5), phy_addr=0x00, phy_type=network.PHY_LAN8720)
station.active(True) # start dhcp configuration
station.isconnected() # if True then check the dhcp configuration with the line below
station.ifconfig() # print dhcp configuration
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Aloha
had some fun time making a LilyGo board work with MP-1.19.1and later compiled with esp idf 4.4.2. It was quite a lengthy endeavor before I saw the Ethernet control lights coming on and the adapter registering its IP address. For the impatient the fork I used is available on https://github.com/wthie/micropython the modifications are in one place and are minimal.
Why use LAN when WLAN is onboard already?
In my experience developing and building LoRa base stations I found that with a lot of safety features like watchdog code, reboots, reconnects I was not able to keep a board able to reconnect on WLAN for more than a week, rebooting was not my preferred way of operating several of these basestations. The search was on for a more stable connection to network based resources and with this I bought a LilyGo board with a LAN8720 adapter. After making the adapter work I now enjoy not only a week of uptime and connectivity in my base stations but months and hopefully years.
The search for a solution to make LAN 8720 power up and work
To my dismay and using the mp-1.19.1 stable branch I was first not able to make the adapter work. Scrounging the web I found quite a few people dropping acid remarks about low board quality but no one seemed to have information ready which would explain all these non functioning boards with LAN 8720 adapters including mine (8720 being an adapter which in my opinion works really well). Studying the hardware and the pins used on several of the boards it became clear that the pin4 was used to power on/off the LAN 8720 adapter in all of the cases of non functioning boards. Digging through the code revealed that sample code provided for different boards did not use the infamous pin4 but retrofitting code for powering the LAN8720 with pin4 into the sample C code made the adapter work. After that it was a no brainer to retrofit the ports/esp32/network_lan.c file with an additional parameter for the power pin.
Python code to initialize the LAN 8720
Beta Was this translation helpful? Give feedback.
All reactions