esphome / issues

Issue Tracker for ESPHome
https://esphome.io/
291 stars 34 forks source link

Issue compiling esphome 2024.6.1 on esp32-c6 #5938

Open ss89 opened 2 weeks ago

ss89 commented 2 weeks ago

The problem

I know the esp32-c6 is not officially supported (why actually? It's old enough and sdk is feature complete enough as well).

Still i would like to be able to compile esphome for this device.

It has worked for me for a long time, but stopped working with 2024.6.1 (didn't try 2024.6.0, as HA didn't show it to me).

Does anyone have a hint on how to make it comile again? I tried multiple esp-idf versions (5.2.0, 5.2.1, 5.2.2) and platform_versions (6.7.0, 6.6.0, 6.5.0, 6.4.0)

Which version of ESPHome has the issue?

2024.6.1

What type of installation are you using?

Home Assistant Add-on

Which version of Home Assistant has the issue?

2024.6.3

What platform are you using?

ESP32

Board

esp32-c6-devkitc-1

Component causing the issue

wifi

Example YAML snippet

esphome:
  name: heizung
  friendly_name: Heizung

esp32:
  board: esp32-c6-devkitc-1
  variant: esp32c6
  framework:
    type: esp-idf
    version: '5.1.1' # prior version used: 5.1.0
    platform_version: 6.5.0 #prior version used: https://github.com/stintel/platform-espressif32#esp32-c6-test

# Enable logging
logger:
  level: debug

# Enable Home Assistant API
api:
  encryption:
    key: "myApiEncryptionKey"

ota:
  password: "myOtaPassword"
  platform: esphome

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

one_wire:
  - pin: GPIO10
    platform: gpio

sensor:
  - platform: dallas_temp
    address: 0xetcEtcEtc
    name: 'temp'
    accuracy_decimals: 3

Anything in the logs that might be useful for us?

Compiling .pioenvs/heizung/src/esphome/components/wifi/wifi_component.o
Compiling .pioenvs/heizung/src/esphome/components/wifi/wifi_component_esp8266.o
Compiling .pioenvs/heizung/src/esphome/components/wifi/wifi_component_esp_idf.o
Compiling .pioenvs/heizung/src/esphome/components/wifi/wifi_component_libretiny.o
src/esphome/components/wifi/wifi_component.cpp:7:10: fatal error: esp_eap_client.h: No such file or directory

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

    7 | #include <esp_eap_client.h>
      |          ^~~~~~~~~~~~~~~~~~
compilation terminated.
*** [.pioenvs/heizung/src/esphome/components/wifi/wifi_component.o] Error 1

Additional information

No response

goldmann commented 2 weeks ago

I'm in the same boat. The problem is with this PR: https://github.com/esphome/esphome/pull/6756. The esp_eap_client.h header file is only available in IDF >= 5.2 and not 5.1.

goldmann commented 2 weeks ago

After I upgraded to IDF version 5.2.2 I was able to compile ESPHome (in my case) 2024.6.1.

ss89 commented 2 weeks ago

After I upgraded to IDF version 5.2.2 I was able to compile ESPHome (in my case) 2024.6.1.

Can you show your complete configuration? For me upping it to 5.2.2 gets me this error:

Reading CMake configuration...
-- git rev-parse returned 'fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).'
-- Building ESP-IDF components for target esp32c6
Processing 1 dependencies:
[1/1] idf (5.2.2)
-- Project sdkconfig file /data/build/heizung/sdkconfig.heizung
-- Configuring incomplete, errors occurred!
See also "/data/build/heizung/.pioenvs/heizung/CMakeFiles/CMakeOutput.log".

fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
CMake Error at /data/cache/platformio/packages/framework-espidf/tools/cmake/tool_version_check.cmake:36 (message):

  Tool doesn't match supported version from list ['esp-13.2.0_20230928']:
  /data/cache/platformio/packages/toolchain-riscv32-esp@12.2.0+20230208/bin/riscv32-esp-elf-gcc

  Please try to run 'idf.py fullclean' to solve it.

Call Stack (most recent call first):
  /data/cache/platformio/packages/framework-espidf/components/esp_common/project_include.cmake:10 (check_expected_tool_version)
  /data/cache/platformio/packages/framework-espidf/tools/cmake/build.cmake:400 (include)
  /data/cache/platformio/packages/framework-espidf/tools/cmake/build.cmake:624 (__build_process_project_includes)
  /data/cache/platformio/packages/framework-espidf/tools/cmake/project.cmake:605 (idf_build_process)
  CMakeLists.txt:3 (project)

EDIT: I am compiling it using the esphome addon inside HA.

goldmann commented 2 weeks ago

Have you cleaned up build files before attempting to build it?

Here's the relevant part of my config. I had to clean it up by removing some sections.

substitutions:
  devicename: io-4

captive_portal: {}
web_server:
  port: 80
esp32:
  board: dfrobot_firebeetle2_esp32e
  variant: esp32
  framework:
    type: esp-idf
    version: 5.2.2
    platform_version: 6.7.0
esphome:
  name: $devicename
ss89 commented 2 weeks ago

That board looks more like it is a regular esp32, not an esp32-c6 (different processor type).

Are you also using the firebeetle2 esp32e board or are you just compiling the firmware as if it was this board and then flash it to the esp32-c6?

goldmann commented 2 weeks ago

Ok, I must admit I totally missed the esp32-c6 board part of the report, I apologize for this. So, no, I do use the esp32e processor on the FireBeetle 2 (https://www.dfrobot.com/product-2195.html) board.

pimdo commented 1 day ago

Seems that header file added in v5.1.2: https://github.com/espressif/esp-idf/tree/v5.1.2/components/wpa_supplicant/esp_supplicant/include