Can't enable ethernet

  1. My goal is: I’d like to connect my device via ethernet
  2. My actions are: I’ve connected a LAN8720 board to my ESP32 module according to this tutorial: Ethernet on ESP32 using LAN8720 Then I flashed a simple firmware with the ethernet library and then entered “mos config-set eth.enable=true”
  3. The result I see is: The device cannot initialize the ethernet driver and keeps rebooting. The relevant boot messages are:

[Oct 15 16:28:16.660] mgos_sys_config.c:470   MAC: fc:f5:c4:0f:78:84
[Oct 15 16:28:16.664] mgos_sys_config.c:478   WDT: 30 seconds
[Oct 15 16:28:16.768] e[0;31mE (1541) emac_esp32: emac_esp32_init(307): reset timeoute[0m
[Oct 15 16:28:16.774] e[0;31mE (1551) esp_eth: esp_eth_driver_install(198): init mac failede[0m
[Oct 15 16:28:16.781] esp32_eth.c:118         Ethernet driver init failed: -1
[Oct 15 16:28:16.786] mgos_deps_init.c:218    ethernet init failed
[Oct 15 16:28:16.790] mgos_freertos.c:184     MGOS init failed: -32
[Oct 15 16:28:17.298] mgos_vfs.c:1026         Unmounting filesystems
[Oct 15 16:28:17.303] mgos_system.c:43        Restarting

I also tried using mos config-set eth.phy_addr=1 first end enabling the ethernet interface afterwards, but that gave me the same results.

  1. My expectation & question is:
    Obviously I’d like my device to be able to connect via the ethernet interface.

Thanks a lot!

In the end I ordered the ESP32-EVB with integrated ethernet, now everything works fine.

Maybe you found a solution of this problem? I have the same.

The PHY address field should have the PHY address, not some random number. The PHY address is determined by a) seeing the PHY chip datasheet, b) seeing the schematic or inspecting the board and determining how the manufacturer wired the address pins.
An oscilloscope would help, working with hardware requires tools to see what the hardware is doing beyond what we think we told it to do.

Some other ramblings on how to properly set an ESP32 for some PHYs can be found by carefully searching this forum, I remember answering to some of them some years ago. IIRC there are also options to select some of the RMII pins, those also have to be setup according to your hardware.