esphome / issues

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

Update error esphome-xiaomi_bslamp2 #6290

Closed ADMiNZ closed 1 month ago

ADMiNZ commented 1 month ago

The problem

Hello. Starting from version 2024.8.3, the firmware for xiaomi_bslamp2 is no longer built. Before this version, everything was assembled without testing. The device itself works on the old firmware, but it always says that it needs to be updated but is not updated.

Which version of ESPHome has the issue?

2024.8.3-2024.9.1

What type of installation are you using?

Home Assistant Add-on

Which version of Home Assistant has the issue?

2024.9.3

What platform are you using?

ESP32

Board

xiaomi_bslamp2

Component causing the issue

https://github.com/mmakaay/esphome-xiaomi_bslamp2

Example YAML snippet

# --------------------------------------------------------------------------
# Substitutions
#
# These are substitutions as used by the configuration packages from below.
# You can uncomment and update the ones that you want to modify.
# --------------------------------------------------------------------------

substitutions:
  name: bedside-lamp
  friendly_name: Bedside Lamp
  #light_name: ${friendly_name} RGBWW Light
  #light_mode_text_sensor_name: ${friendly_name} Light Mode
  #default_transition_length: 800ms

# --------------------------------------------------------------------------
# Load configuration packages
#
# These provide a convenient way to compose your device configuration from
# some functional building blocks. Pick and mix the blocks that you need.
#
# For customization you can override options in your config or you can
# copy the contents of these packages directly in your config file as
# an example for your own customizations.
#
# Available packages are:
# - core.yaml                : core components & hardware setup
# - behavior_default.yaml    : default device behavior
# - ota_feedback.yaml        : enable visual feedback during OTA updates
# - activate_preset_svc.yaml : 'activate_preset' service for Home Assistant
# --------------------------------------------------------------------------

packages:
  bslamp2:
    url: https://github.com/mmakaay/esphome-xiaomi_bslamp2
    ref: dev
    files:
      - packages/core.yaml
      - packages/behavior_default.yaml
      - packages/ota_feedback.yaml
      - packages/activate_preset_svc.yaml
    refresh: 0s

# --------------------------------------------------------------------------
# Use your own preferences for these components.
# --------------------------------------------------------------------------

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

api:
  encryption:
    key: !secret api_key

ota:
  platform: esphome
  password: !secret ota_password

Anything in the logs that might be useful for us?

INFO ESPHome 2024.9.1
INFO Reading configuration /config/esphome/bedside-lamp.yaml...
INFO Updating https://github.com/mmakaay/esphome-xiaomi_bslamp2@dev
INFO Generating C++ source...
INFO Compiling app...
Processing bedside-lamp (board: esp32doit-devkit-v1; framework: espidf; platform: platformio/espressif32@5.4.0)
--------------------------------------------------------------------------------
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
 - framework-espidf @ 3.40407.0 (4.4.7) 
 - tool-cmake @ 3.16.4 
 - tool-ninja @ 1.7.1 
 - toolchain-esp32ulp @ 2.35.0-20220830 
 - toolchain-xtensa-esp32 @ 8.4.0+2021r2-patch5
Reading CMake configuration...
-- Building ESP-IDF components for target esp32
-- Project sdkconfig file /data/build/bedside-lamp/sdkconfig.bedside-lamp
-- Configuring incomplete, errors occurred!
See also "/data/build/bedside-lamp/.pioenvs/bedside-lamp/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).
Traceback (most recent call last):
  File "/data/cache/platformio/packages/framework-espidf/tools/kconfig_new/confgen.py", line 644, in <module>
    main()
  File "/data/cache/platformio/packages/framework-espidf/tools/kconfig_new/confgen.py", line 264, in main
    config = kconfiglib.Kconfig(args.kconfig)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.platformio/penv/.espidf-4.4.7/lib/python3.11/site-packages/kconfiglib.py", line 947, in __init__
    self._init(filename, warn, warn_to_stderr, encoding)
  File "/root/.platformio/penv/.espidf-4.4.7/lib/python3.11/site-packages/kconfiglib.py", line 1085, in _init
    self._parse_block(None, self.top_node, self.top_node).next = None
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.platformio/penv/.espidf-4.4.7/lib/python3.11/site-packages/kconfiglib.py", line 2982, in _parse_block
    prev = self._parse_block(None, parent, prev)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.platformio/penv/.espidf-4.4.7/lib/python3.11/site-packages/kconfiglib.py", line 2982, in _parse_block
    prev = self._parse_block(None, parent, prev)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.platformio/penv/.espidf-4.4.7/lib/python3.11/site-packages/kconfiglib.py", line 2907, in _parse_block
    while self._next_line():
          ^^^^^^^^^^^^^^^^^
  File "/root/.platformio/penv/.espidf-4.4.7/lib/python3.11/site-packages/kconfiglib.py", line 2224, in _next_line
    line = self._readline()
           ^^^^^^^^^^^^^^^^
OSError: [Errno 5] Input/output error
CMake Error at /data/cache/platformio/packages/framework-espidf/tools/cmake/kconfig.cmake:266 (message):
  Failed to run confgen.py
  (/root/.platformio/penv/.espidf-4.4.7/bin/python;/data/cache/platformio/packages/framework-espidf/tools/kconfig_new/confgen.py;--kconfig;/data/cache/platformio/packages/framework-espidf/Kconfig;--sdkconfig-rename;/data/cache/platformio/packages/framework-espidf/sdkconfig.rename;--config;/data/build/bedside-lamp/sdkconfig.bedside-lamp;--env-file;/data/build/bedside-lamp/.pioenvs/bedside-lamp/config.env).
  Error 1
Call Stack (most recent call first):
  /data/cache/platformio/packages/framework-espidf/tools/cmake/build.cmake:534 (__kconfig_generate_config)
  /data/cache/platformio/packages/framework-espidf/tools/cmake/project.cmake:476 (idf_build_process)
  CMakeLists.txt:3 (project)

========================== [FAILED] Took 5.98 seconds ==========================

Additional information

No response

kcajjones commented 1 month ago

I'm getting similar errors compiling updates for my Raspberry Pi Pico W. I've not found a solution/cause yet.

mmakaay commented 1 month ago

I'm the author of the bslamp2 component, and I just did a fresh build (fully fresh build cache + paltformio cache) of the firmware. This build was successful using ESPHome 2024.9.2. So this does not seem to be a general issue.

Some output from my build:

INFO ESPHome 2024.9.2
------8<------
Processing bedside-lamp-office (board: esp32dev; framework: espidf; platform: platformio/espressif32@5.4.0)
--------------------------------------------------------------------------------
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB 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-xtensa-esp32 @ 8.4.0+2021r2-patch5

The only difference with my output is framework-espidf @ 3.40407.240606 which is framework-espidf @ 3.40407.0 (4.4.7) in the log of the failed build. So that might be a pointer at the source of the build issue?

@kcajjones : Do you see the same pattern in the output of your build?

@kcajjones / @ADMiNZ : What platform are you building the code on? I am building on an ADM64 myself. Any chance that your using something like ARM on a raspberry Pi or so?

ADMiNZ commented 1 month ago

Hello @mmakaay.

I am using x86 processor (AMD64)

ADMiNZ commented 1 month ago

Tried updating just now.

My config Above is the most standard one

INFO ESPHome 2024.9.2
INFO Reading configuration /config/esphome/bedside-lamp.yaml...
INFO Updating https://github.com/mmakaay/esphome-xiaomi_bslamp2/@dev
INFO Updating https://github.com/mmakaay/esphome-xiaomi_bslamp2@dev
INFO Generating C++ source...
INFO Compiling app...
Processing bedside-lamp (board: esp32doit-devkit-v1; framework: espidf; platform: platformio/espressif32@5.4.0)
--------------------------------------------------------------------------------
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
 - framework-espidf @ 3.40407.0 (4.4.7) 
 - tool-cmake @ 3.16.4 
 - tool-ninja @ 1.7.1 
 - toolchain-esp32ulp @ 2.35.0-20220830 
 - toolchain-xtensa-esp32 @ 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.20-py2.py3-none-any.whl (144 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 144.2/144.2 kB 1.1 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 7.2 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 7.2 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 14.3 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 5.9 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 9.4 MB/s eta 0:00:00
Collecting cffi>=1.12
  Downloading cffi-1.17.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (467 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 467.2/467.2 kB 8.0 MB/s eta 0:00:00
Collecting packaging
  Downloading packaging-24.1-py3-none-any.whl (53 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 54.0/54.0 kB 3.0 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 8.4 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 5.5 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.5-py3-none-any.whl (78 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 78.4/78.4 kB 3.8 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.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (762 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 763.0/763.0 kB 9.9 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 6.9 MB/s eta 0:00:00
Collecting msgpack<2.0.0,>=0.5.2
  Downloading msgpack-1.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (403 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 403.7/403.7 kB 7.5 MB/s eta 0:00:00
Collecting filelock>=3.8.0
  Downloading filelock-3.16.1-py3-none-any.whl (16 kB)
Collecting pycparser
  Downloading pycparser-2.22-py3-none-any.whl (117 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 117.6/117.6 kB 6.0 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 5.5 MB/s eta 0:00:00
Collecting idna<4,>=2.5
  Downloading idna-3.10-py3-none-any.whl (70 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 70.4/70.4 kB 4.0 MB/s eta 0:00:00
Collecting certifi>=2017.4.17
  Downloading certifi-2024.8.30-py3-none-any.whl (167 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 167.3/167.3 kB 3.4 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.8.30 cffi-1.17.1 charset-normalizer-3.3.2 click-8.1.7 colorama-0.4.6 contextlib2-21.6.0 cryptography-3.4.8 filelock-3.16.1 future-1.0.0 idf-component-manager-1.5.3 idna-3.10 kconfiglib-13.7.1 msgpack-1.1.0 packaging-24.1 pycparser-2.22 pyparsing-2.3.1 pyyaml-6.0.2 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.5 urllib3-1.26.20
Reading CMake configuration...
-- Found Git: /usr/bin/git (found version "2.39.5") 
-- The C compiler identification is GNU 8.4.0
-- The CXX compiler identification is GNU 8.4.0
-- The ASM compiler identification is GNU
-- Found assembler: /data/cache/platformio/packages/toolchain-xtensa-esp32/bin/xtensa-esp32-elf-gcc
-- Check for working C compiler: /data/cache/platformio/packages/toolchain-xtensa-esp32/bin/xtensa-esp32-elf-gcc
-- Check for working C compiler: /data/cache/platformio/packages/toolchain-xtensa-esp32/bin/xtensa-esp32-elf-gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /data/cache/platformio/packages/toolchain-xtensa-esp32/bin/xtensa-esp32-elf-g++
-- Check for working CXX compiler: /data/cache/platformio/packages/toolchain-xtensa-esp32/bin/xtensa-esp32-elf-g++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Building ESP-IDF components for target esp32
-- Project sdkconfig file /data/build/bedside-lamp/sdkconfig.bedside-lamp
-- Configuring incomplete, errors occurred!
See also "/data/build/bedside-lamp/.pioenvs/bedside-lamp/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).
Traceback (most recent call last):
  File "/data/cache/platformio/packages/framework-espidf/tools/kconfig_new/confgen.py", line 644, in <module>
    main()
  File "/data/cache/platformio/packages/framework-espidf/tools/kconfig_new/confgen.py", line 264, in main
    config = kconfiglib.Kconfig(args.kconfig)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.platformio/penv/.espidf-4.4.7/lib/python3.11/site-packages/kconfiglib.py", line 947, in __init__
    self._init(filename, warn, warn_to_stderr, encoding)
  File "/root/.platformio/penv/.espidf-4.4.7/lib/python3.11/site-packages/kconfiglib.py", line 1085, in _init
    self._parse_block(None, self.top_node, self.top_node).next = None
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.platformio/penv/.espidf-4.4.7/lib/python3.11/site-packages/kconfiglib.py", line 2982, in _parse_block
    prev = self._parse_block(None, parent, prev)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.platformio/penv/.espidf-4.4.7/lib/python3.11/site-packages/kconfiglib.py", line 2982, in _parse_block
    prev = self._parse_block(None, parent, prev)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.platformio/penv/.espidf-4.4.7/lib/python3.11/site-packages/kconfiglib.py", line 2907, in _parse_block
    while self._next_line():
          ^^^^^^^^^^^^^^^^^
  File "/root/.platformio/penv/.espidf-4.4.7/lib/python3.11/site-packages/kconfiglib.py", line 2224, in _next_line
    line = self._readline()
           ^^^^^^^^^^^^^^^^
OSError: [Errno 5] Input/output error
CMake Error at /data/cache/platformio/packages/framework-espidf/tools/cmake/kconfig.cmake:266 (message):
  Failed to run confgen.py
  (/root/.platformio/penv/.espidf-4.4.7/bin/python;/data/cache/platformio/packages/framework-espidf/tools/kconfig_new/confgen.py;--kconfig;/data/cache/platformio/packages/framework-espidf/Kconfig;--sdkconfig-rename;/data/cache/platformio/packages/framework-espidf/sdkconfig.rename;--config;/data/build/bedside-lamp/sdkconfig.bedside-lamp;--env-file;/data/build/bedside-lamp/.pioenvs/bedside-lamp/config.env).
  Error 1
Call Stack (most recent call first):
  /data/cache/platformio/packages/framework-espidf/tools/cmake/build.cmake:534 (__kconfig_generate_config)
  /data/cache/platformio/packages/framework-espidf/tools/cmake/project.cmake:476 (idf_build_process)
  CMakeLists.txt:3 (project)

========================= [FAILED] Took 30.74 seconds =========================
randybb commented 1 month ago

Yea, no issue (at least not with the stable one. dev is a bit different story, but it is related only to singlecore esp32).

Try to clean your build files and if this will not help remove/add the esphome addon (all files will be preserved)/

ADMiNZ commented 1 month ago

Thank you very much @randybb, @mmakaay Removing and installing esphome helped! :)