无法使用 CLI 编译 esphome。 volupteous.error.Invalid:克隆到“.esphome\idf_components cd5e7e1”

问题描述 投票:0回答:1

我对 esphome 和家庭助理非常陌生,只是谷歌搜索错误并没有帮助我。我正在尝试让树莓派通过 wifi 与 esp32 设备进行通信。两者都成功连接到网络,但我无法再编译以适用于 esp32 设备。 我在 Windows 机器上使用 CLI 来编译它,因为使用基于 Web 的编译器在我的 Raspberry Pi 3B+ 上效果不佳。大约一周前我确实设法让它工作,然后它出现了下面的错误,并且从那时起就不允许进一步编译。

我认为它与 git 存储库有关,但我的 git 知识非常少,我不知道如何测试它正在寻找的 git 存储库是否有效。 任何帮助表示赞赏。

>esphome run .\workshop.yaml

INFO ESPHome 2024.12.2
INFO Reading configuration .\workshop.yaml...
INFO Generating C++ source...
INFO Cloning https://github.com/espressif/[email protected]
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "C:\Users\jb\AppData\Local\Programs\Python\Python311\Scripts\esphome.exe\__main__.py", line 7, in <module>
  File "C:\Users\jb\AppData\Local\Programs\Python\Python311\Lib\site-packages\esphome\__main__.py", line 1036, in main
    return run_esphome(sys.argv)
           ^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\jb\AppData\Local\Programs\Python\Python311\Lib\site-packages\esphome\__main__.py", line 1023, in run_esphome
    rc = POST_CONFIG_ACTIONS[args.command](args, config)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\jb\AppData\Local\Programs\Python\Python311\Lib\site-packages\esphome\__main__.py", line 503, in command_run
    exit_code = write_cpp(config)
                ^^^^^^^^^^^^^^^^^
  File "C:\Users\jb\AppData\Local\Programs\Python\Python311\Lib\site-packages\esphome\__main__.py", line 213, in write_cpp
    return write_cpp_file()
           ^^^^^^^^^^^^^^^^
  File "C:\Users\jb\AppData\Local\Programs\Python\Python311\Lib\site-packages\esphome\__main__.py", line 231, in write_cpp_file
    writer.write_cpp(code_s)
  File "C:\Users\jb\AppData\Local\Programs\Python\Python311\Lib\site-packages\esphome\writer.py", line 341, in write_cpp
    copy_src_tree()
  File "C:\Users\jb\AppData\Local\Programs\Python\Python311\Lib\site-packages\esphome\writer.py", line 307, in copy_src_tree
    copy_files()
  File "C:\Users\jb\AppData\Local\Programs\Python\Python311\Lib\site-packages\esphome\components\esp32\__init__.py", line 801, in copy_files
    repo_dir, _ = git.clone_or_update(
                  ^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\jb\AppData\Local\Programs\Python\Python311\Lib\site-packages\esphome\git.py", line 67, in clone_or_update
    run_git_command(cmd)
  File "C:\Users\jb\AppData\Local\Programs\Python\Python311\Lib\site-packages\esphome\git.py", line 32, in run_git_command
    raise cv.Invalid(err_str)
voluptuous.error.Invalid: Cloning into '.esphome\idf_components\7cd5e7e1'... 

我的配置文件:workshop.yaml

esphome:
  name: esphome-web-baa3a0
  friendly_name: Workshop
  area: workshop
  min_version: 2024.11.0
  name_add_mac_suffix: false

esp32:
  board: esp32dev
  framework:
    type: esp-idf

# Enable logging
logger:

# Enable Home Assistant API
api:

# Allow Over-The-Air updates
ota:
- platform: esphome

wifi:
  ssid: <Hidden>
  password: <Hidden>
  manual_ip:
    static_ip: 192.168.1.102
    gateway: 192.168.1.1
    subnet: 255.255.255.0

switch:
  - platform: gpio
    name: "relay"
    pin: GPIO16

  - platform: gpio
    name: "led"
    pin: GPIO23
esphome
1个回答
0
投票

原来是和配置文件有关。使用以前版本的配置允许编译。不确定是哪一点。但结束这个问题

© www.soinside.com 2019 - 2024. All rights reserved.