How to use w5500 Ethernet module with esphome

hi, i want to connect my esp32 through ethernet . but only w5500 available here in my country which is not supported to esphome but running fine in ardiuno, can i use w5500 with esphome through custom components.

Take a look at https://github.com/spali/esphome-components/tree/master/components/ethernet_spi

I just tried this suggestion and couldn’t get it working. Also fixed ip address doesn’t seem to be supported anyway. Anyone know if/when W5500 will be supported within ESPHome? With W5500 being (apparently) the most prevalent network chip for the ESP32 hopefully this support is on the roadmap? Tx in advance! :slightly_smiling_face:

Probably somewhere in the future as in the past (and present) their is/was no official support. :raised_hands:

1 Like

Any updates on this? I also have the Lilygo T-ETH-Lite S3 with W5500. Trying to get it to run on ESPHome …

2 Likes

As it is esphome it could just work using the linked PR in the post before yours :raised_hands:

I actually got it running for my S3 chip with W5500.

For those interested my project here: GitHub - pixelwave/Wake-On-ESP32: Using an ESP32 to control multiple PCs via Ethernet.

The config:

esphome:
  name: ...
  friendly_name: ...
  platformio_options:
    board_build.flash_mode: dio

external_components:
  - source:
      type: git
      url: https://github.com/JeroenVanOort/esphome/
      ref: eth-w5500
    components: [ ethernet ]

ethernet:
  type: W5500
  clk_pin: GPIO10
  mosi_pin: GPIO12
  miso_pin: GPIO11
  cs_pin: GPIO09
  interrupt_pin: GPIO13
  reset_pin: GPIO14
  clock_speed: 30Mhz
3 Likes

Is the ethernet still working? I had it working until a few days ago that way but something seems to have broken:

INFO ESPHome 2024.2.2
INFO Reading configuration /config/esphome/calefaccion.yaml...
ERROR Unable to import component ethernet:
Traceback (most recent call last):
  File "/esphome/esphome/loader.py", line 169, in _lookup_module
    module = importlib.import_module(f"esphome.components.{domain}")
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1206, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1178, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1149, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/data/external_components/2f02e929/esphome/components/ethernet/__init__.py", line 11, in <module>
    from esphome.const import (
ImportError: cannot import name 'CONF_SPI' from 'esphome.const' (/esphome/esphome/const.py)
Failed config

ethernet: [source /config/esphome/common/T-ETH-Lite-ESP32S3.yaml:20]
  
  Component not found: ethernet.
  type: W5500
  clk_pin: GPIO10
  mosi_pin: GPIO12
  miso_pin: GPIO11
  cs_pin: GPIO09
  interrupt_pin: GPIO13
  reset_pin: GPIO14

I would appreciate help, thank you

Interesting … I have the same error message trying to access the ESP32 wireless. I would guess a recent esphome update somehow broke something.

But my esp32 itself is still running successfully via POE and ethernet now for 23 days 24/7. Probalby should not update it … x)

@EmilianoGetino … did you update your esp32 to latest version via esphome panel?

In this repo (W5500 spi ethernet · Issue #1235 · esphome/feature-requests · GitHub) the component is integrated with:

external_components:
  - source:
      type: git
      url: https://github.com/JeroenVanOort/esphome/
      ref: eth-w5500
    components: [ ethernet,network,api,esp32]

Can you try this? It adds some more components from the repo …

My ETH/POE controller still is detected in ESPHome and runs on this version:

Update from git:

“Have to use esphome dev version. Then it works. And no external files just with ethernet and w5500 i is in the dev core now.”

It should be soon as part of the esphome release since it is already merged in the dev. Until then will be a bit more tricky.

1 Like

With the new Firmware version 2024.3.0 it works perfectly, thanks for your help.

2 Likes

Could you take a copy of your settings?
I’m a beginner so I don’t have enough experience to do it alone… :frowning:

esp32:  
  board: esp32-s3-devkitc-1
  framework:
    type: esp-idf
   

ethernet:
  type: W5500
  clk_pin: GPIO10
  mosi_pin: GPIO12
  miso_pin: GPIO11
  cs_pin: GPIO09
  interrupt_pin: GPIO13
  reset_pin: GPIO14

Thanks!
Is it problem that I leave in the settings the wifi option, or I have to delete it? Could you take a picture about your hardware pin connections?

What is wrong?

Just disable wifi section :slight_smile:

Here w5500 never worked in esphome. Same hardware worked with tasmota.

i am using it… its working nice

ethernet:
type: w5500
clk_pin: GPIO18
mosi_pin: GPIO23
miso_pin: GPIO19
cs_pin: GPIO5
interrupt_pin: GPIO22

clock_speed: 30 # optional defaults to 30

manual_ip:
static_ip: 192.168.2.170
gateway: 192.168.2.3
subnet: 255.255.255.0

1 Like

which version of esphome u r using, if u are using too old version the update your esphome your problem will solve automatically