esphome / issues

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

Missing symbols for OtaESPHomeComponent when linking #6050

Open jwillikers opened 1 month ago

jwillikers commented 1 month ago

The problem

When attempting to update my configuration for the wake-word-voice-assistant on the ESP32 S3 Box 3, I receive a linking error.

Linking .pioenvs/esp32-s3-box-3-01/firmware.elf
/config/.esphome/platformio/packages/toolchain-xtensa-esp32s3/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld: missing --end-group; added as last command line option
/config/.esphome/platformio/packages/toolchain-xtensa-esp32s3/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld: .pioenvs/esp32-s3-box-3-01/src/main.o:(.literal._Z5setupv+0x5c): undefined reference to `vtable for esphome::ESPHomeOTAComponent'
/config/.esphome/platformio/packages/toolchain-xtensa-esp32s3/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld: .pioenvs/esp32-s3-box-3-01/src/main.o:(.literal._Z5setupv+0x958): undefined reference to `esphome::ESPHomeOTAComponent::set_port(unsigned short)'
/config/.esphome/platformio/packages/toolchain-xtensa-esp32s3/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld: .pioenvs/esp32-s3-box-3-01/src/main.o: in function `esphome::http_request::OtaHttpRequestComponent::OtaHttpRequestComponent()':
/config/.esphome/build/esp32-s3-box-3-01/src/esphome/components/http_request/ota/ota_http_request.h:25: undefined reference to `esphome::ESPHomeOTAComponent::set_port(unsigned short)'
collect2: error: ld returned 1 exit status
*** [.pioenvs/esp32-s3-box-3-01/firmware.elf] Error 1

Which version of ESPHome has the issue?

2024.7.0

What type of installation are you using?

Docker

Which version of Home Assistant has the issue?

No response

What platform are you using?

ESP32-IDF

Board

ESP32 S3 Box 3

Component causing the issue

ota

Example YAML snippet

substitutions:
  name: esp32-s3-box-3-01
  static_ip: 10.3.0.80
  friendly_name: ESP32 S3 Box 3 01

packages:
  static-network: !include
    file: common/static_network.yaml
  device_base:
    url: https://github.com/esphome/firmware
    ref: main
    files: [wake-word-voice-assistant/esp32-s3-box-3.yaml]
    refresh: 1d

api:
  encryption:
    key: !secret esp32_s3_box_3_01_api_encryption_key

ota:
  - id: !extend ota_esphome
    password: !secret esp32_s3_box_3_01_ota_esphome_password

wifi:
  enable_btm: true
  enable_rrm: true
  ssid: !secret wifi_ssid
  password: !secret wifi_password
  ap:
    ssid: "${name} Fallback"
    password: !secret esp32_s3_box_3_01_wifi_ap_password

Anything in the logs that might be useful for us?

INFO ESPHome 2024.7.0
INFO Reading configuration /config/esp32-s3-box-3-01.yaml...
INFO Updating https://github.com/esphome/esphome.git@pull/5230/head
INFO Updating https://github.com/jesserockz/esphome-components.git@None
WARNING GPIO0 is a strapping PIN and should only be used for I/O with care.
Attaching external pullup/down resistors to strapping pins can cause unexpected failures.
See https://esphome.io/guides/faq.html#why-am-i-getting-a-warning-about-strapping-pins
INFO Generating C++ source...
INFO Updating https://github.com/jesserockz/esp32-s3-box-3-board.git@main
INFO Updating https://github.com/espressif/esp-adf@v2.5
INFO Updating submodules (components/esp-sr, components/esp-adf-libs) for https://github.com/espressif/esp-adf@v2.5
INFO Updating https://github.com/espressif/esp-dsp@v1.2.0
INFO Updating https://github.com/espressif/esp-tflite-micro@v1.3.1
INFO Compiling app...
Processing esp32-s3-box-3-01 (board: esp32s3box; framework: espidf; platform: platformio/espressif32@5.4.0)
--------------------------------------------------------------------------------
HARDWARE: ESP32S3 240MHz, 320KB RAM, 16MB Flash
 - framework-espidf @ 3.40407.240606 (4.4.7) 
 - tool-cmake @ 3.16.4 
 - tool-ninja @ 1.7.1 
 - toolchain-esp32ulp @ 2.35.0-20220830 
 - toolchain-riscv32-esp @ 8.4.0+2021r2-patch5 
 - toolchain-xtensa-esp32s3 @ 8.4.0+2021r2-patch5
Creating a new virtual environment for IDF Python dependencies
Installing ESP-IDF's Python dependencies
Collecting urllib3<2
  Downloading urllib3-1.26.19-py2.py3-none-any.whl (143 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 143.9/143.9 kB 2.2 MB/s eta 0:00:00
Collecting cryptography<35.0.0,>=2.1.4
  Downloading cryptography-3.4.8-cp36-abi3-manylinux_2_24_x86_64.whl (3.0 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.0/3.0 MB 24.6 MB/s eta 0:00:00
Collecting future>=0.18.3
  Downloading future-1.0.0-py3-none-any.whl (491 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 491.3/491.3 kB 35.7 MB/s eta 0:00:00
Collecting pyparsing<2.4.0,>=2.0.3
  Downloading pyparsing-2.3.1-py2.py3-none-any.whl (61 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 61.8/61.8 kB 5.0 MB/s eta 0:00:00
Collecting kconfiglib~=13.7.1
  Downloading kconfiglib-13.7.1-py2.py3-none-any.whl (145 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 145.7/145.7 kB 18.1 MB/s eta 0:00:00
Collecting idf-component-manager~=1.0
  Downloading idf_component_manager-1.5.3-py2.py3-none-any.whl (161 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 161.3/161.3 kB 19.8 MB/s eta 0:00:00
Collecting cffi>=1.12
  Downloading cffi-1.16.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (464 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 464.8/464.8 kB 22.4 MB/s eta 0:00:00
Collecting packaging
  Downloading packaging-24.1-py3-none-any.whl (53 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 54.0/54.0 kB 5.3 MB/s eta 0:00:00
Collecting requests<3
  Downloading requests-2.32.3-py3-none-any.whl (64 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 64.9/64.9 kB 6.8 MB/s eta 0:00:00
Collecting requests-file<2
  Downloading requests_file-1.5.1-py2.py3-none-any.whl (3.7 kB)
Collecting requests-toolbelt
  Downloading requests_toolbelt-1.0.0-py2.py3-none-any.whl (54 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 54.5/54.5 kB 4.9 MB/s eta 0:00:00
Collecting schema<=0.7.5
  Downloading schema-0.7.5-py2.py3-none-any.whl (17 kB)
Collecting six
  Downloading six-1.16.0-py2.py3-none-any.whl (11 kB)
Collecting tqdm<5
  Downloading tqdm-4.66.4-py3-none-any.whl (78 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 78.3/78.3 kB 5.3 MB/s eta 0:00:00
Collecting colorama
  Downloading colorama-0.4.6-py2.py3-none-any.whl (25 kB)
Collecting pyyaml>5.2
  Downloading PyYAML-6.0.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (757 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 757.7/757.7 kB 51.1 MB/s eta 0:00:00
Collecting cachecontrol[filecache]>0.12.6
  Downloading cachecontrol-0.14.0-py3-none-any.whl (22 kB)
Collecting contextlib2>0.6.0
  Downloading contextlib2-21.6.0-py2.py3-none-any.whl (13 kB)
Collecting click
  Downloading click-8.1.7-py3-none-any.whl (97 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 97.9/97.9 kB 11.6 MB/s eta 0:00:00
Collecting msgpack<2.0.0,>=0.5.2
  Downloading msgpack-1.0.8-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (409 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 409.3/409.3 kB 29.4 MB/s eta 0:00:00
Collecting filelock>=3.8.0
  Downloading filelock-3.15.4-py3-none-any.whl (16 kB)
Collecting pycparser
  Downloading pycparser-2.22-py3-none-any.whl (117 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 117.6/117.6 kB 13.7 MB/s eta 0:00:00
Collecting charset-normalizer<4,>=2
  Downloading charset_normalizer-3.3.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (140 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 140.3/140.3 kB 16.5 MB/s eta 0:00:00
Collecting idna<4,>=2.5
  Downloading idna-3.7-py3-none-any.whl (66 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 66.8/66.8 kB 7.8 MB/s eta 0:00:00
Collecting certifi>=2017.4.17
  Downloading certifi-2024.7.4-py3-none-any.whl (162 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 163.0/163.0 kB 19.6 MB/s eta 0:00:00
Installing collected packages: pyparsing, urllib3, tqdm, six, pyyaml, pycparser, packaging, msgpack, kconfiglib, idna, future, filelock, contextlib2, colorama, click, charset-normalizer, certifi, schema, requests, cffi, requests-toolbelt, requests-file, cryptography, cachecontrol, idf-component-manager
Successfully installed cachecontrol-0.14.0 certifi-2024.7.4 cffi-1.16.0 charset-normalizer-3.3.2 click-8.1.7 colorama-0.4.6 contextlib2-21.6.0 cryptography-3.4.8 filelock-3.15.4 future-1.0.0 idf-component-manager-1.5.3 idna-3.7 kconfiglib-13.7.1 msgpack-1.0.8 packaging-24.1 pycparser-2.22 pyparsing-2.3.1 pyyaml-6.0.1 requests-2.32.3 requests-file-1.5.1 requests-toolbelt-1.0.0 schema-0.7.5 six-1.16.0 tqdm-4.66.4 urllib3-1.26.19
Reading CMake configuration...
Dependency Graph
|-- ArduinoJson @ 6.18.5
|-- Improv @ 1.2.3
|-- noise-c @ 0.1.4
|-- ESPMicroSpeechFeatures @ 1.0.0
Linking .pioenvs/esp32-s3-box-3-01/firmware.elf
/config/.esphome/platformio/packages/toolchain-xtensa-esp32s3/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld: missing --end-group; added as last command line option
/config/.esphome/platformio/packages/toolchain-xtensa-esp32s3/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld: .pioenvs/esp32-s3-box-3-01/src/main.o:(.literal._Z5setupv+0x5c): undefined reference to `vtable for esphome::ESPHomeOTAComponent'
/config/.esphome/platformio/packages/toolchain-xtensa-esp32s3/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld: .pioenvs/esp32-s3-box-3-01/src/main.o:(.literal._Z5setupv+0x958): undefined reference to `esphome::ESPHomeOTAComponent::set_port(unsigned short)'
/config/.esphome/platformio/packages/toolchain-xtensa-esp32s3/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld: .pioenvs/esp32-s3-box-3-01/src/main.o: in function `esphome::http_request::OtaHttpRequestComponent::OtaHttpRequestComponent()':
/config/.esphome/build/esp32-s3-box-3-01/src/esphome/components/http_request/ota/ota_http_request.h:25: undefined reference to `esphome::ESPHomeOTAComponent::set_port(unsigned short)'
collect2: error: ld returned 1 exit status
*** [.pioenvs/esp32-s3-box-3-01/firmware.elf] Error 1
========================= [FAILED] Took 30.62 seconds =========================

Additional information

My full configuration is available here.

gschmidl commented 1 month ago

Same happens for me on the M5Stack Atom Echo, whether I fully specify ota and update, leave them out, or adapt this config.

Abdull commented 1 week ago

Using esphome version 2024.7.3.

After adding

ota:
  - platform: esphome
    password: ""

to YAML file foo.yaml, then executing esphome run foo.yaml, I got similar errors mesages.

I was able to mitigate this problem by first cleaning the project with esphome clean foo.yaml, then executing esphome run foo.yaml again.