Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 7 commits into from
May 28, 2024

Conversation

fightforlife
Copy link
Contributor

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

  • 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
  • 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:

  • 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:

@codecov-commenter
Copy link

codecov-commenter commented May 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 54.13%. Comparing base (4d8b5ed) to head (04f0a7d).
Report is 673 commits behind head on dev.

Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #6778      +/-   ##
==========================================
+ Coverage   53.70%   54.13%   +0.42%     
==========================================
  Files          50       50              
  Lines        9408     9619     +211     
  Branches     1654     1698      +44     
==========================================
+ Hits         5053     5207     +154     
- Misses       4056     4086      +30     
- Partials      299      326      +27     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@kbx81
Copy link
Member

kbx81 commented May 28, 2024

@fightforlife let's use your branch. 😄 I pushed the couple additional tweaks I had in my branch -- care to give it a quick test?

@kbx81
Copy link
Member

kbx81 commented May 28, 2024

I've confirmed this works on my W5500 board with an ESP32 Devkit board.

@kbx81 kbx81 merged commit 2b691ad into esphome:dev May 28, 2024
56 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators May 30, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants