ESP32编译出现Cannot establish a connection to the component registry.报错

前言

(1)在对ESP32开发使用的时候,很容易踩坑,但是总是找不到问题所在。很多时候只能去外网查资料,语言不通,而且有墙特别的难受。就算能够找到乐鑫的工作人员询问,也整个过程也感觉有些许麻烦。
(2)今天我就分享一个我遇到的编译时候的bug。
(3)与本文相关的信息链接:https://github.com/espressif/esp-box/issues/63

正文

报错信息

(1)今天测试代码,一个一模一样的代码,只是加了一个一行代码,编译就出现如下报错,直接把我干傻了。我想我还没有拉跨到写一行代码就报错的离谱程度吧。于是为了验证我是不是离谱到这个境界,我就将我写的那一行代码注释掉,重新编译。依旧出现如下报错。

[0/1] Re-running CMake...
-- ccache will be used for faster recompilation
-- git rev-parse returned 'fatal: not a git repository (or any of the parent directories): .git'
-- Could not use 'git describe' to determine PROJECT_VER.
-- Building ESP-IDF components for target esp32s3
CMake Error at F:/HoloCubic/IDF/Enter_ESP-IDF_container_directory/esp-idf/tools/cmake/build.cmake:540 (message):
  ERROR: Cannot establish a connection to the component registry.  Are you
  connected to the internet?

Call Stack (most recent call first):
  F:/HoloCubic/IDF/Enter_ESP-IDF_container_directory/esp-idf/tools/cmake/project.cmake:547 (idf_build_process)
  CMakeLists.txt:14 (project)


-- Configuring incomplete, errors occurred!
See also "F:/HoloCubic/github_esp_box_V0.5.0/esp-box/examples/factory_demo/build/CMakeFiles/CMakeOutput.log".  
FAILED: build.ninja
F:\HoloCubic\IDF\Enter_ESP-IDF_Tools_directory\tools\cmake\3.24.0\bin\cmake.exe --regenerate-during-build -SF:\HoloCubic\github_esp_box_V0.5.0\esp-box\examples\factory_demo -BF:\HoloCubic\github_esp_box_V0.5.0\esp-box\examples\factory_demo\build
ninja: error: rebuilding 'build.ninja': subcommand failed

 *  终端进程“C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe -Command ninja ”已终止,退出代码: 1

原因1

被限速了

(1)ESP32的程序编译,是需要访问GitHub的。GitHub虽然是技术交流网站,但是也是在外网,虽说没有被墙但是也是被限速了。所以当你编译的时候,有可能因为限速之后的网速太慢,导致编译失败。

处理办法

(1)找到工程目录下,进入main文件夹

在这里插入图片描述

(2)打开idf_component.yml文件按照如下修改

/*--- 原来的是国外的GitHub仓库 ---*/
git: https://github.com/espressif/esp-rainmaker.git
/*--- 现在修改为国内的Gitee仓库 ---*/
git: https://gitee.com/EspressifSystems/esp-rainmaker.git

在这里插入图片描述

原因2

ESP-IDF版本太老了

(1)例如我个人使用的是ESP32BOX,依赖IDF5.0 版本。如果版本地域IDF5.0,那么就会出现如上问题。

处理办法

(1)很简单,更新IDF版本(苦笑)。我只能告诉各位vscode如何更新,其他环境怎么更新需要自己找。

在这里插入图片描述

总结

测试结果

(1)点击编译,之后就会进行漫长的等待,如果打印"…"说明在和git仓库建立联系,不用担心,等待个四五分钟的样子就可以了。这个因人而异具体时间我也不太清楚。
在这里插入图片描述

关于ESP32BOX使用出现问题怎么办?

(1)可以直接去GitHub提交issues,或者先看看有没有人遇到和你一样的问题。
https://github.com/espressif/esp-box/issues?q=is%3Aopen+is%3Aissue

在这里插入图片描述

(2)联系淘宝客服,直接和乐鑫的FAE对接。我就是这样的,然后就拉了一个群,远程帮我处理问题。

猜你喜欢

转载自blog.csdn.net/qq_63922192/article/details/132864336