ESP32 C3 modbus-master官方例程编译报错

hoo_wave
Posts: 14
Joined: Mon Dec 11, 2023 2:57 am

ESP32 C3 modbus-master官方例程编译报错

Postby hoo_wave » Mon Dec 11, 2023 6:50 am

编译时出现如下错误,请问如何解决?谢谢
————————————————————————
编译环境VScode+IDF插件,IDF版本5.1.1

Code: Select all

Dependencies lock doesn't exist, solving dependencies.
.CMake Error at E:/esp/esp-idf/tools/cmake/build.cmake:540 (message):
  WARNING: HTTPSConnectionPool(host='components-file.espressif.com',
  port=443): Max retries exceeded with url:
  /components/espressif/esp-modbus.json (Caused by
  ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at
  0x000001496CBD9210>, 'Connection to components-file.espressif.com timed
  out.  (connect timeout=6.05)'))

  HINT: Please check manifest file of the following component(s): main

  ERROR: Because project depends on espressif/esp-modbus (^1.0) which doesn't
  match any versions, version solving failed.

Call Stack (most recent call first):
  E:/esp/esp-idf/tools/cmake/project.cmake:547 (idf_build_process)
  CMakeLists.txt:8 (project)


-- Configuring incomplete, errors occurred!
See also "E:/H3/mb_master/build/CMakeFiles/CMakeOutput.log".

 *  The terminal process "C:\WINDOWS\System32\cmd.exe /d /c cmake -G Ninja -DPYTHON_DEPS_CHECKED=1 -DESP_PLATFORM=1 -B e:\H3\mb_master\build -S e:\H3\mb_master" terminated with exit code: 1. 

ESP_WangYX
Posts: 97
Joined: Mon Jun 28, 2021 12:48 pm

Re: ESP32 C3 modbus-master官方例程编译报错

Postby ESP_WangYX » Mon Dec 11, 2023 1:05 pm

请在 esp-idf 目录运行 git submodule update --init,并执行 ./install.sh,确保正确安装了 IDF Component Manager: https://docs.espressif.com/projects/esp ... nager.html
如果还报告该错误,请在 main 目录下的idf_component.yml 文件内,删除 version 信息,取消其版本检测。

hoo_wave
Posts: 14
Joined: Mon Dec 11, 2023 2:57 am

Re: ESP32 C3 modbus-master官方例程编译报错

Postby hoo_wave » Mon Dec 11, 2023 3:08 pm

感谢您的解答回复!!问题已解决,是我的环境搭建有问题

解决办法:删除电脑中所有与IDF有关的环境变量。

PS:该方法虽然可以正常编译下载,但还是提示缺少"modbus_params.h"文件

ESP_alisitsyn
Posts: 211
Joined: Fri Feb 01, 2019 4:02 pm
Contact:

Re: ESP32 C3 modbus-master官方例程编译报错

Postby ESP_alisitsyn » Fri Dec 15, 2023 11:03 am


Who is online

Users browsing this forum: No registered users and 113 guests