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

ESPHome fails to build with esp-idf framework if wired ethernet is used #4637

Closed
utemkin opened this issue Jun 29, 2023 · 3 comments · Fixed by esphome/esphome#5037
Closed

Comments

@utemkin
Copy link

utemkin commented Jun 29, 2023

The problem

Build fails

Which version of ESPHome has the issue?

2023.6.2

What type of installation are you using?

Home Assistant Add-on

Which version of Home Assistant has the issue?

2023.6.3

What platform are you using?

ESP32-IDF

Board

wt32-eth01

Component causing the issue

components/ethernet

Example YAML snippet

`
esp32:
  board: wt32-eth01
  framework:
    type: esp-idf
    version: 5.0.2
    platform_version: 6.3.2
    # Custom sdkconfig options
    sdkconfig_options:
      CONFIG_COMPILER_OPTIMIZATION_SPEED: y
      CONFIG_GPIO_CTRL_FUNC_IN_IRAM: y
`
`
ethernet:
  type: LAN8720
  mdc_pin: GPIO23
  mdio_pin: GPIO18
  clk_mode: GPIO0_IN
  phy_addr: 1
  power_pin: GPIO16
`

Anything in the logs that might be useful for us?

`
INFO ESPHome 2023.6.2
INFO Reading configuration /config/esphome/climate.yaml...
WARNING The selected ESP-IDF framework version is not the recommended one. If there are connectivity or build issues please remove the manual version.
WARNING The selected ESP-IDF framework version is not the recommended one. If there are connectivity or build issues please remove the manual version.
INFO Generating C++ source...
INFO Updating https://github.com/espressif/esp-protocols.git@mdns-v1.0.9
INFO Compiling app...
Processing climate (board: wt32-eth01; framework: espidf; platform: platformio/espressif32@6.3.2)
--------------------------------------------------------------------------------
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
 - framework-espidf @ 3.50002.230601 (5.0.2) 
 - tool-cmake @ 3.16.4 
 - tool-ninja @ 1.7.1 
 - toolchain-esp32ulp @ 2.35.0-20220830 
 - toolchain-xtensa-esp32 @ 11.2.0+2022r1
Reading CMake configuration...
Dependency Graph
|-- noise-c @ 0.1.4
Compiling /data/climate/.pioenvs/climate/src/esphome/components/ethernet/esp_eth_phy_jl1101.o
src/esphome/components/ethernet/esp_eth_phy_jl1101.c:22:10: fatal error: eth_phy_regs_struct.h: No such file or directory

*****************************************************************************
* Looking for eth_phy_regs_struct.h dependency? Check our library registry!
*
* CLI  > platformio lib search "header:eth_phy_regs_struct.h"
* Web  > https://registry.platformio.org/search?q=header:eth_phy_regs_struct.h
*
*****************************************************************************

   22 | #include "eth_phy_regs_struct.h"
      |          ^~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
*** [/data/climate/.pioenvs/climate/src/esphome/components/ethernet/esp_eth_phy_jl1101.o] Error 1
========================== [FAILED] Took 4.64 seconds ==========================
`

Additional information

This happens because components\ethernet/esp_eth_phy_jl1101.c unconditionally includes eth_phy_regs_struct.h, which is part of Arduino framework (which is not available when building with esp-idf framework)

@utemkin utemkin changed the title ESPHome fails to build with esp-idf framework if wire ethernet is used ESPHome fails to build with esp-idf framework if wired ethernet is used Jun 29, 2023
@HeMan
Copy link

HeMan commented Jun 29, 2023

Is there any specific reason for you to specify version and platform_version? When I removed them I got it to compile.

@utemkin
Copy link
Author

utemkin commented Jun 30, 2023

Is there any specific reason for you to specify version and platform_version? When I removed them I got it to compile.

Yes. It uses ESP_IDF v4 by default. I would like to use new API like gptimer and so on. There's lots of improvements in v5 actually.

@randybb
Copy link

randybb commented Jun 30, 2023

There is a loot of breaking changes in IDF v5, so it will not be supported in a near future. Jesse mentioned that probably next year...

@github-actions github-actions bot locked and limited conversation to collaborators Nov 1, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants