espressif / esp-iot-solution

Espressif IoT Library. IoT Device Drivers, Documentations And Solutions.
Apache License 2.0
1.8k stars 740 forks source link

Build Error when fetching Component Dependencies for WS2812 LED Strips example (AEGHB-553) #335

Closed hayschan closed 4 months ago

hayschan commented 4 months ago

Answers checklist.

IDF version.

v5.1.2

Espressif SoC revision.

ESP32

Operating System used.

Windows

How did you build your project?

VS Code IDE

If you are using Windows, please specify command line type.

PowerShell

Development Kit.

N/A

Steps to reproduce.

Here is the step-by-step process to reproduce the build error I encountered:

  1. Environment Setup: Ensure the ESP-IDF environment is set up according to the official ESP-IDF setup guide. I'm using ESP-IDF version 5.1.
  2. Project Preparation: Clone the ESP IoT Solution repository to a local directory. For this example, let's assume it's cloned to D:\GitHub\esp-iot-solution.
  3. Navigate to Project Directory: Open PowerShell and navigate to the WS2812 LED Strips example directory using cd D:\GitHub\esp-iot-solution\examples\indicator\ws2812_strips.
  4. Attempt to Build: Run idf.py build to start the build process. When attempting to build the project, the process fails with errors related to fetching component dependencies. Specifically, it fails to fetch the led_indicator and led_strip components, with error messages indicating a failure to establish a connection to components-file.espressif.com. Below is an excerpt from the build log:

Build Logs.

Using component placed at D:\GitHub\esp-iot-solution\examples\indicator\components\cmd_led_indicator for dependency cmd_led_indicator(*), specified in D:/GitHub/esp-iot-solution/examples/indicator/ws2812_strips/main\idf_component.yml

Using component placed at D:\GitHub\esp-iot-solution\components\led\led_indicator for dependency led_indicator(*), specified in D:/GitHub/esp-iot-solution/examples/indicator/ws2812_strips/main\idf_component.yml

CMake Error at D:/esp-idf/tools/cmake/build.cmake:540 (message):
  WARNING: HTTPSConnectionPool(host='components-file.espressif.com',
  port=443): Max retries exceeded with url:
  /components/espressif/cmake_utilities.json (Caused by
  SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol
  (_ssl.c:992)')))

  WARNING: HTTPSConnectionPool(host='components-file.espressif.com',
  port=443): Max retries exceeded with url:
  /components/espressif/led_strip.json (Caused by SSLError(SSLEOFError(8,
  'EOF occurred in violation of protocol (_ssl.c:992)')))

  ERROR: Because no versions of led_indicator match >=0.0.0,<0.9.1 || >0.9.1

   and led_indicator (0.9.1) depends on espressif/led_strip (>=2.5.2), led_indicator (>=0.0.0) requires espressif/led_strip (>=2.5.2).

  So, because no versions of espressif/led_strip match >=2.5.2
....-- Configuring incomplete, errors occurred!
See also "D:/GitHub/esp-iot-solution/examples/indicator/ws2812_strips/build/CMakeFiles/CMakeOutput.log".

   and project depends on led_indicator (*), version solving failed.

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

More Information.

hayschan commented 4 months ago

Follow-Up: Persistent Build Error When Fetching Component Dependencies

Since my initial issue report, I have undertaken further troubleshooting steps to address the build error related to fetching component dependencies for the WS2812 LED Strips example. Despite these efforts, the problem persists. Below is a summary of the additional actions I've taken:

  1. Set Environment Variables via Command Prompt: I attempted to configure the proxy settings by setting the environment variables directly in the command prompt using both HTTP and HTTPS protocols:

    • set http_proxy=http://127.0.0.1:7890
    • set https_proxy=https://127.0.0.1:7890
  2. Set Environment Variables via PowerShell: I also tried to configure the proxy settings in PowerShell, ensuring that both HTTP and HTTPS proxies were set:

    • $env:HTTP_PROXY = "http://127.0.0.1:7890"
    • $env:HTTPS_PROXY = "https://127.0.0.1:7890"
  3. Proxy Direct Mode: I switched the proxy to direct mode, bypassing the proxy settings to see if a direct connection would solve the issue.

  4. Turning Off Proxy Software: Finally, I completely turned off the proxy software to eliminate any potential interference it might be causing.

hayschan commented 4 months ago

I've managed to resolve the issue I was facing with connecting to the ESP component registry due to network restrictions. The solution was to correctly configure both my environment variables and Git to use a proxy.

My solution

Please note that my proxy address and port are examples. For example purpose, they will be 127.0.0.1 and 2334. The port should vary if you use different proxy software. You should the address according to your proxy software configuration that probably.

Here's how I did it, which might be helpful for others encountering similar connectivity issues:

[Environment]::SetEnvironmentVariable("HTTP_PROXY", "http://127.0.0.1:2334", [EnvironmentVariableTarget]::User)
[Environment]::SetEnvironmentVariable("HTTPS_PROXY", "http://127.0.0.1:2334", [EnvironmentVariableTarget]::User)
git config --global http.proxy http://127.0.0.1:2334
git config --global https.proxy http://127.0.0.1:2334

After setting these, make sure to verify the configuration with:

echo $env:HTTP_PROXY
echo $env:HTTPS_PROXY
git config --global --get http.proxy
git config --global --get https.proxy

This approach ensured that both my system environment and Git were correctly using the proxy, allowing me to bypass the network restrictions and successfully connect to the ESP component registry. Hopefully, this solution can help others facing similar issues.