esphome icon indicating copy to clipboard operation
esphome copied to clipboard

Make SPI Ethernet (W5500) compatible with ESP-IDF v5

Open fightforlife opened this issue 9 months ago • 1 comments

What does this implement/fix?

Currently the SPI Ethernet implementation for W5500 is not compatible with ESP-IDF v5 since there were 2 breaking changes from 4.x.x to 5.x.x.

  1. ETH_W5500_DEFAULT_CONFIG parameter list changed
  2. esp_mac.h is no longer indirectly included,.

This small PR fixes this.

Types of changes

  • [X] Bugfix (non-breaking change which fixes an issue)
  • [ ] New feature (non-breaking change which adds functionality)
  • [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • [ ] Other

Related issue or feature (if applicable): I did not create a bug ticket for this.

Pull request in esphome-docs with documentation (if applicable): No change in docs

Test Environment

  • [ ] ESP32
  • [X] ESP32 IDF
  • [ ] ESP8266
  • [ ] RP2040
  • [ ] BK72xx
  • [ ] RTL87xx

Example entry for config.yaml:

substitutions:
  name: gateway
  friendly_name: Gateway

esphome:
  name: ${name}
  friendly_name: ${friendly_name}

external_components:
  - source:
      type: git
      url: https://github.com/fightforlife/esphome
      ref: eth_spi_idf5
    components: [ ethernet ]
    refresh: 0s

esp32:
  board: esp32doit-devkit-v1
  variant: esp32
  framework:
    type: esp-idf
    version: 5.2.1
    platform_version: 6.7.0

esp32_ble_tracker:
  scan_parameters:
    active: false
    interval: 1100ms
    window: 1100ms

bluetooth_proxy:
  active: true
  cache_services: true

logger:
  level: DEBUG 
  baud_rate: 0

api:
  encryption:
    key: !secret api_secret

ota:
  platform: esphome
  password: !secret api_secret

ethernet:
  type: W5500
  clk_pin: GPIO18
  mosi_pin: GPIO23
  miso_pin: GPIO19
  cs_pin: GPIO5
  interrupt_pin: GPIO21
  reset_pin: GPIO22

Checklist:

  • [X] The code change is tested and works locally.
  • [ ] Tests have been added to verify that the new code works (under tests/ folder).

If user exposed functionality or configuration variables are added/changed:

fightforlife avatar May 19 '24 15:05 fightforlife