← index #16561PR #9710
Off-topic · high · value 1.527
QUERY · ISSUE

ESP32 + W5500: network.LAN() fails without an interrupt pin

openby YamadaKyoheiopened 2025-01-10updated 2025-11-17
bugport-esp32

Port, board and/or hardware

AtomS3 Lite, Atomic PoE Base (W5500)

MicroPython version

MicroPython v1.24.1 on 2024-11-29; M5Stack AtomS3 Lite with ESP32S3

Reproduction

  1. Connect an AtomS3 Lite to an Atomic PoE Base.
  2. Run the following script:
import machine
import network
spi = machine.SPI(1, sck=machine.Pin(5), mosi=machine.Pin(8), miso=machine.Pin(7))
lan = network.LAN(phy_type=network.PHY_W5500, spi=spi, phy_addr=1, cs=machine.Pin(6))

Expected behaviour

network.LAN() succeeds.

Observed behaviour

network.LAN() fails.

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
OSError: esp_eth_driver_install failed with invalid argument

Additional Information

Some W5500 modules don’t include an interrupt pin, so ESP-IDF provides a polling mode (commit).
To enable polling, int_gpio_num must be set to -1 and poll_period_ms must be greater than 0.
However, esp_eth_driver_install() fails because poll_period_ms is 0 in ETH_W5500_DEFAULT_CONFIG.
To fix this, we either need to set poll_period_ms to greater than 0 in network_lan.c or change its default in ESP-IDF.

Code of Conduct

Yes, I agree

CANDIDATE · PULL REQUEST

esp32/network_lan: Add clock configuration.

closedby bartek-wopened 2022-10-22updated 2023-01-18
port-esp32

Allow support for Olimex esp32-poe board family.

Testes with code snippet on esp32-poe-iso:

import network
import machine

lan = network.LAN(mdc = machine.Pin(23), mdio = machine.Pin(18), power=machine.Pin(12), phy_type = network.PHY_LAN8720, phy_addr=0, clock_out = machine.Pin(17))
lan.active(1)
lan.ifconfig()

Solves issue https://github.com/micropython/micropython/issues/9100

Signed-off-by: Bartek bartekwolowiec@gmail.com

Keyboard

j / / n
next pair
k / / p
previous pair
1 / / h
show query pane
2 / / l
show candidate pane
c
copy suggested comment
r
toggle reasoning
g i
go to index
?
show this help
esc
close overlays

press ? or esc to close

copied