Playing around with the ESPHOME and W5500 ethernet module on different ESP32 boards. Goal is to be able to use SPI for ethernet and I²C for other sensors or extensions.
And even with this small sized board, there is some room for extra connections!
Possible improvements to investigate:
- CLK wire for the W5500 SPI bus is set to GPIO08
- GPIO08 is also the linked to the status led of the ESP32 C3 super mini development board
- possible or better to use GPIO02 instead?
- update 18.01.2024: switching CLK to GPIO02 did not seem to work...
At first, I only got it to work with the arduino framework:
esphome:
name: esp32c3-super-mini
friendly_name: esp32c3-super-mini
esp32:
board: esp32-c3-devkitm-1
framework:
type: arduino
# Enable logging
logger:
level: DEBUG
# Enable Home Assistant API
api:
ota:
ethernet:
type: W5500
mosi_pin: GPIO10
miso_pin: GPIO09
clk_pin: GPIO08
cs_pin: GPIO5
reset_pin: GPIO04
interrupt_pin: GPIO03
clock_speed: 25MHz
i2c:
scl: GPIO07
sda: GPIO06
scan: True
id: bus_a
sensor:
- platform: bmp280
temperature:
name: "Temperature"
unit_of_measurement: °C
accuracy_decimals: 1
pressure:
name: "Pressure"
unit_of_measurement: hPa
accuracy_decimals: 0
i2c_id: bus_a
address: 0x76
After some iterations, it also works with the esp-idf framework; some tweaking of the platformio options was necessary:
esphome:
name: esp32c3-super-mini-idf
friendly_name: esp32c3-super-mini-idf
platformio_options:
board_build.flash_mode: dio
board_build.mcu: esp32c3
board_build.f_cpu: 160000000L
esp32:
board: esp32-c3-devkitm-1
framework:
type: esp-idf
So far, connection seems to be lightning fast and super stable.
In my experience, the easiest way of flashing the new ESP32C3 boards is by using the Adafruit ESPTool.
Work in progress on a pcb design for a small board with ethernet connection and exposure of all remaining GPIOs.
See PCB folder for first design attempt.
Two more pins left for other purposes!
I didn't manage to get the board working with the arduino framework. Esp-idf framework works fine as follows:
esphome:
name: seeed-xiao-c3-w5500
friendly_name: seeed-xiao-c3-w5500
platformio_options:
board_build.flash_mode: dio
board_build.mcu: esp32c3
board_build.f_cpu: 160000000L
esp32:
board: seeed_xiao_esp32c3
variant: esp32c3
framework:
type: esp-idf
# Enable logging
logger:
# Enable Home Assistant API
api:
ota:
ethernet:
type: W5500
mosi_pin: 10
miso_pin: 9
clk_pin: 8
cs_pin: 4
reset_pin: 2
interrupt_pin: 3
clock_speed: 25MHz
i2c:
scl: 7
sda: 6
scan: True
id: bus_a
sensor:
- platform: bmp280
temperature:
name: "Temperatuur"
unit_of_measurement: °C
accuracy_decimals: 1
pressure:
name: "Luchtdruk"
unit_of_measurement: hPa
accuracy_decimals: 0
i2c_id: bus_a
address: 0x76
binary_sensor:
- platform: status
name: "Status"
text_sensor:
- platform: ethernet_info
ip_address:
name: IP Address
switch:
- platform: restart
name: "Restart"
Flashing: see https://github.com/Xinyuan-LilyGO/LilyGO-T-ETH-Series?tab=readme-ov-file
I managed to get the board operational, but I had to upload the code from within ESPHome in Home Assistant; uploading a bin file did not work.
esphome:
name: lilygo-t-eth-lite-w5500
friendly_name: lilygo-t-eth-lite-w5500
platformio_options:
board_build.flash_mode: dio
esp32:
board: esp32-s3-devkitc-1
framework:
type: esp-idf
# Enable logging
logger:
# Enable Home Assistant API
api:
ota:
ethernet:
type: W5500
mosi_pin: 12
miso_pin: 11
clk_pin: 10
cs_pin: 9
reset_pin: 14
interrupt_pin: 13
clock_speed: 25MHz
binary_sensor:
- platform: status
name: "Status"
text_sensor:
- platform: ethernet_info
ip_address:
name: IP Address
switch:
- platform: restart
name: "Restart"