找回密码
 立即注册

微信扫码登录

搜索
楼主: arnzh

[技术探讨] 近期esphome编译各种出错求助

[复制链接]

3

主题

60

回帖

633

积分

高级会员

积分
633
金钱
570
HASS币
0
 楼主| 发表于 前天 20:52 | 显示全部楼层
shay 发表于 2025-8-28 16:59
前几天也遇到了类似的问题,不过报错不一样,是提示缺少gcc编译器。我得解决办法是删除.pio里面的缓存,让es ...

怎么删除?是清除编译项吗?
回复

使用道具 举报

57

主题

334

回帖

1931

积分

金牌会员

积分
1931
金钱
1540
HASS币
50
发表于 前天 22:30 | 显示全部楼层
我的是8266 请几天 不能编译 编译多次后,下载依赖就好了,但是esp32始终不行
回复

使用道具 举报

57

主题

334

回帖

1931

积分

金牌会员

积分
1931
金钱
1540
HASS币
50
发表于 前天 22:32 | 显示全部楼层
external_components: [source /config/esphome/airm2m.yaml:15]
  -
    unable to access 'https://github.com/myhomeiot/esphome-components.git/': Failed to connect to github.com port 443 after 133442 ms: Couldn't connect to server.
    source: github://myhomeiot/esphome-components
回复

使用道具 举报

57

主题

334

回帖

1931

积分

金牌会员

积分
1931
金钱
1540
HASS币
50
发表于 前天 22:34 | 显示全部楼层
INFO ESPHome 2025.8.1
INFO Reading configuration /config/esphome/c3mor.yaml...
WARNING GPIO2 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 Compiling app...
Processing esp32c3mor (board: airm2m_core_esp32c3; framework: espidf; platform: https://github.com/pioarduino/platform-espressif32/releases/download/54.03.21-2/platform-espressif32.zip)
--------------------------------------------------------------------------------
INFO Package configuration completed successfully
Tool Manager: Installing https://github.com/pioarduino/esp-idf/releases/download/v5.4.2/esp-idf-v5.4.2.zip
INFO Installing https://github.com/pioarduino/esp-idf/releases/download/v5.4.2/esp-idf-v5.4.2.zip
Tool Manager: Error: Please read https://bit.ly/package-manager-ioerror
ERROR Error: Please read https://bit.ly/package-manager-ioerror
ConnectTimeout: Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/urllib3/connection.py", line 198, in _new_conn
    sock = connection.create_connection(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/urllib3/util/connection.py", line 85, in create_connection
    raise err
  File "/usr/local/lib/python3.12/site-packages/urllib3/util/connection.py", line 73, in create_connection
    sock.connect(sa)
TimeoutError: timed out

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/urllib3/connectionpool.py", line 787, in urlopen
    response = self._make_request(
               ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/urllib3/connectionpool.py", line 488, in _make_request
    raise new_e
  File "/usr/local/lib/python3.12/site-packages/urllib3/connectionpool.py", line 464, in _make_request
    self._validate_conn(conn)
  File "/usr/local/lib/python3.12/site-packages/urllib3/connectionpool.py", line 1093, in _validate_conn
    conn.connect()
  File "/usr/local/lib/python3.12/site-packages/urllib3/connection.py", line 753, in connect
    self.sock = sock = self._new_conn()
                       ^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/urllib3/connection.py", line 207, in _new_conn
    raise ConnectTimeoutError(
urllib3.exceptions.ConnectTimeoutError: (<urllib3.connection.HTTPSConnection object at 0x7f8a3c4c6000>, 'Connection to github.com timed out. (connect timeout=10)')

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/requests/adapters.py", line 644, in send
    resp = conn.urlopen(
           ^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/urllib3/connectionpool.py", line 841, in urlopen
    retries = retries.increment(
              ^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/urllib3/util/retry.py", line 519, in increment
    raise MaxRetryError(_pool, url, reason) from reason  # type: ignore[arg-type]
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='github.com', port=443): Max retries exceeded with url: /pioarduino/esp-idf/releases/download/v5.4.2/esp-idf-v5.4.2.zip (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x7f8a3c4c6000>, 'Connection to github.com timed out. (connect timeout=10)'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/platformio/__main__.py", line 103, in main
    cli()  # pylint: disable=no-value-for-parameter
    ^^^^^
  File "/usr/local/lib/python3.12/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/platformio/cli.py", line 85, in invoke
    return super().invoke(ctx)
           ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/click/decorators.py", line 33, in new_func
    return f(get_current_context(), *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/platformio/run/cli.py", line 147, in cli
    process_env(
  File "/usr/local/lib/python3.12/site-packages/platformio/run/cli.py", line 210, in process_env
    ).process()
      ^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/platformio/run/processor.py", line 81, in process
    install_project_env_dependencies(
  File "/usr/local/lib/python3.12/site-packages/platformio/package/commands/install.py", line 132, in install_project_env_dependencies
    _install_project_env_platform(project_env, options),
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/platformio/package/commands/install.py", line 149, in _install_project_env_platform
    PlatformPackageManager().install(
  File "/usr/local/lib/python3.12/site-packages/platformio/package/manager/platform.py", line 62, in install
    p.install_required_packages(force=force)
  File "/usr/local/lib/python3.12/site-packages/platformio/platform/_packages.py", line 76, in install_required_packages
    self.install_package(name, force=force)
  File "/usr/local/lib/python3.12/site-packages/platformio/platform/_packages.py", line 70, in install_package
    return self.pm.install(spec or self.get_package_spec(name), force=force)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/platformio/package/manager/_install.py", line 47, in install
    pkg = self._install(spec, skip_dependencies=skip_dependencies, force=force)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/platformio/package/manager/_install.py", line 97, in _install
    pkg = self.install_from_uri(spec.uri, spec)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/platformio/package/manager/_install.py", line 189, in install_from_uri
    dl_path = self.download(uri, checksum)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/platformio/package/manager/_download.py", line 88, in download
    raise exc
  File "/usr/local/lib/python3.12/site-packages/platformio/package/manager/_download.py", line 69, in download
    fd = FileDownloader(url)
         ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/platformio/package/download.py", line 33, in __init__
    self._http_response = self._http_session.get(
                          ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/requests/sessions.py", line 602, in get
    return self.request("GET", url, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/platformio/http.py", line 64, in request
    return super().request(
           ^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/requests/sessions.py", line 589, in request
    resp = self.send(prep, **send_kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/requests/sessions.py", line 703, in send
    r = adapter.send(request, **kwargs)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/requests/adapters.py", line 665, in send
    raise ConnectTimeout(e, request=request)
requests.exceptions.ConnectTimeout: HTTPSConnectionPool(host='github.com', port=443): Max retries exceeded with url: /pioarduino/esp-idf/releases/download/v5.4.2/esp-idf-v5.4.2.zip (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x7f8a3c4c6000>, 'Connection to github.com timed out. (connect timeout=10)'))

============================================================

An unexpected error occurred. Further steps:

* Verify that you have the latest version of PlatformIO using
  `python -m pip install -U platformio` command

* Try to find answer in FAQ Troubleshooting section
  https://docs.platformio.org/page/faq/index.html

* Report this problem to the developers
  https://github.com/platformio/platformio-core/issues

============================================================
回复

使用道具 举报

3

主题

60

回帖

633

积分

高级会员

积分
633
金钱
570
HASS币
0
 楼主| 发表于 前天 23:07 | 显示全部楼层
本帖最后由 arnzh 于 2025-8-28 23:08 编辑
yilaixtanbobo 发表于 2025-8-28 22:34
INFO ESPHome 2025.8.1
INFO Reading configuration /config/esphome/c3mor.yaml...
WARNING GPIO2 is a st ...

一样一样的。估计是8266依赖项比较小。
回复

使用道具 举报

shay 手机认证

16

主题

317

回帖

1804

积分

金牌会员

积分
1804
金钱
1466
HASS币
20
发表于 昨天 08:25 | 显示全部楼层
tanbobo 发表于 2025-8-28 22:32
external_components: [source /config/esphome/airm2m.yaml:15]
  -
    unable to access 'https://gith ...

你这个很明显,就是网络不通,科学上网吧。 我是整个删除.esphome目录,里面是编译平台的文件,只是清理项目的话,不管用。之前说删除.pio搞错了,这个操作和清理项目是一样的。
回复

使用道具 举报

3

主题

60

回帖

633

积分

高级会员

积分
633
金钱
570
HASS币
0
 楼主| 发表于 昨天 13:48 | 显示全部楼层
shay 发表于 2025-8-29 08:25
你这个很明显,就是网络不通,科学上网吧。 我是整个删除.esphome目录,里面是编译平台的文件,只是清理 ...

收到,主要是想问问有没有ha上好用的科学路子。
回复

使用道具 举报

5

主题

47

回帖

1455

积分

金牌会员

积分
1455
金钱
1403
HASS币
0
发表于 昨天 14:24 | 显示全部楼层
INFO Package configuration completed successfully
INFO Package configuration completed successfully
HARDWARE: ESP32C3 160MHz, 320KB RAM, 4MB Flash
- framework-arduinoespressif32 @ 3.2.1
- framework-arduinoespressif32-libs @ 5.4.0+sha.858a988d6e
- tool-esptoolpy @ 5.0.2
- tool-mklittlefs @ 3.2.0
- toolchain-riscv32-esp @ 14.2.0+20241119
Installing Arduino Python dependencies
Dependency Graph
|-- Networking @ 3.2.1
|-- AsyncTCP @ 3.4.5
|-- WiFi @ 3.2.1
|-- FS @ 3.2.1
|-- Update @ 3.2.1
|-- ESPAsyncWebServer @ 3.7.10
|-- ESP32 Async UDP @ 3.2.1
|-- DNSServer @ 3.2.1
|-- ESPmDNS @ 3.2.1
|-- noise-c @ 0.1.10
Compiling .pioenvs/bodypresence-32c3-2410/FrameworkArduinoVariant/variant.cpp.o
sh: 1: riscv32-esp-elf-g++: not found
Compiling .pioenvs/bodypresence-32c3-2410/lib4c5/Network/NetworkClient.cpp.o
*** [.pioenvs/bodypresence-32c3-2410/FrameworkArduinoVariant/variant.cpp.o] Error 127
sh: 1: riscv32-esp-elf-g++: not found
*** [.pioenvs/bodypresence-32c3-2410/lib4c5/Network/NetworkClient.cpp.o] Error 127
========================== [FAILED] Took 8.72 seconds ==========================

所有esp32c3的板子都是这个报错,哪位大佬帮忙看下如何处理呀
回复

使用道具 举报

7

主题

59

回帖

1022

积分

金牌会员

积分
1022
金钱
956
HASS币
0
发表于 昨天 15:27 | 显示全部楼层
一样的问题 第一次编译的时候用魔法下载依赖库以后就可以了
回复

使用道具 举报

shay 手机认证

16

主题

317

回帖

1804

积分

金牌会员

积分
1804
金钱
1466
HASS币
20
发表于 昨天 16:12 | 显示全部楼层
coolguy 发表于 2025-8-29 14:24
INFO Package configuration completed successfully
INFO Package configuration completed successfully
...

你这个问题和我的一样,重新下载编译环境就行了。删除.esphome的整个目录,重新编译就好了
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|Hassbian ( 晋ICP备17001384号-1 )

GMT+8, 2025-8-30 08:03 , Processed in 0.198762 second(s), 4 queries , MemCached On.

Powered by Discuz! X3.5

© 2001-2025 Discuz! Team.

快速回复 返回顶部 返回列表