NameError: name 'config' is not defined when PIO pulled the Expressif files from Git

I usually work with Arduinos… hence, not much of an idea with ESP.
I last worked on this ESP project in Dec 2024, and it worked.
I just upgraded VScode on Linux oto latest, when PIO updated ESP things as below. which resulted in an error (NameError: name ‘config’ is not defined)

Resolving esp32doit-devkit-v1 dependencies...
Platform Manager: Installing git+https://github.com/Jason2866/platform-espressif32.git#Arduino/IDF5
git version 2.34.1
Cloning into '/home/maxg/.platformio/.cache/tmp/pkg-installing-qlue68u8'...

Platform Manager: espressif32@2025.3.10+sha.ba3a7b4 has been installed!
Tool Manager: Installing https://github.com/Jason2866/esp32-arduino-lib-builder/releases/download/3467/framework-arduinoespressif32-all-release_v5.1-7e10045.zip
Downloading 0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100%
Unpacking 0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100%
Tool Manager: framework-arduinoespressif32@3.0.8+sha.7e10045 has been installed!
Tool Manager: Installing https://github.com/tasmota/esp-idf/releases/download/v5.1.6.250320/esp-idf-v5.1.6.zip
Downloading 0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100%
Unpacking 0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100%
Tool Manager: framework-espidf@3.50106.0 has been installed!
Tool Manager: Installing espressif/toolchain-xtensa-esp32 @ 12.2.0+20230208
Downloading 0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100%
Unpacking 0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100%
Tool Manager: toolchain-xtensa-esp32@12.2.0+20230208 has been installed!
Tool Manager: Installing platformio/toolchain-esp32ulp @ ~1.23500.0
Downloading 0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100%
Unpacking 0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100%
Tool Manager: toolchain-esp32ulp@1.23500.220830 has been installed!
Tool Manager: Installing espressif/tool-xtensa-esp-elf-gdb @ ~12.1.0
Downloading 0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100%
Unpacking 0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100%
Tool Manager: tool-xtensa-esp-elf-gdb@12.1.0+20221002 has been installed!
Tool Manager: Installing espressif/tool-riscv32-esp-elf-gdb @ ~12.1.0
Downloading 0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100%
Unpacking 0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100%
Tool Manager: tool-riscv32-esp-elf-gdb@12.1.0+20221002 has been installed!
Tool Manager: Installing https://github.com/tasmota/esptool/releases/download/v4.8.8/esptool.zip
Downloading 0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100%
Unpacking 0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100%
Tool Manager: tool-esptoolpy@4.8.8 has been installed!
Tool Manager: Installing tasmota/tool-mklittlefs @ ^3.2.0
Downloading 0% 10% 20% 30% 40% 50% 60% 70%
Unpacking 0% 10% 20%
Tool Manager: tool-mklittlefs@3.2.0 has been installed!
Tool Manager: Installing platformio/tool-cmake @ ~3.21.0
Downloading 0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100%
Unpacking 0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100%
Tool Manager: tool-cmake@3.21.3 has been installed!
Tool Manager: Installing platformio/tool-ninja @ ^1.7.0
Downloading 0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100%
Unpacking 0% 10% 20%
Tool Manager: tool-ninja@1.7.1 has been installed!
Updating metadata for the vscode IDE...
UserSideException: Processing esp32doit-devkit-v1 (platform: https://github.com/Jason2866/platform-espressif32.git#Arduino/IDF5; board: esp32doit-devkit-v1; framework: arduino, espidf)
--------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
NameError: name 'config' is not defined:
  File "/home/maxg/.platformio/penv/lib/python3.10/site-packages/platformio/builder/main.py", line 173:
    env.SConscript("$BUILD_SCRIPT")
  File "/home/maxg/.platformio/packages/tool-scons/scons-local-4.8.1/SCons/Script/SConscript.py", line 620:
    return _SConscript(self.fs, *files, **subst_kw)
  File "/home/maxg/.platformio/packages/tool-scons/scons-local-4.8.1/SCons/Script/SConscript.py", line 280:
    exec(compile(scriptdata, scriptname, 'exec'), call_stack[-1].globals)
  File "/home/maxg/.platformio/platforms/espressif32/builder/main.py", line 313:
    if not check_lib_archive_exists():
  File "/home/maxg/.platformio/platforms/espressif32/builder/main.py", line 306:
    for section in config.sections():
========================== [FAILED] Took 0.35 seconds ==========================

Any ideas what I need to do to fix this? Thanks.

I think the prupose of that was to get Arduiono-ESP32 core 3.x or ESP-IDF 5?

You should be using one of the relases in https://github.com/pioarduino/platform-espressif32 for Arduino-ESP32 3.x, e.g.

; Arduino-ESP32 3.2.0 (based on ESP-IDF v5.4.1)
platform = https://github.com/pioarduino/platform-espressif32/releases/download/54.03.20/platform-espressif32.zip

If it’s a pure ESP-IDF project and you need 5.x, then you can use the official platform (https://github.com/platformio/platform-espressif32/releases, e.g.

platform = espressif32@6.11.0

Thank you… my .ini says this:

[env:esp32doit-devkit-v1]
;platform = espressif32
platform = https://github.com/Jason2866/platform-espressif32.git#Arduino/IDF5
board = esp32doit-devkit-v1
framework = arduino, espidf

monitor_speed = 115200

which I believe was auto-created when I selected the board.
Huh, tis is where it came from :slight_smile:

Assuming this is a pure ESP project (not sure what a non-pure project would be; I am not flippant, I simply don’t know), I should select your second option.
(A while later) done. No errors during install. :slight_smile:

After stumbling over the ‘compile issue’ I remembered that we dealt with this before.
However, I have now used your first option and it compiles again error-free.
So a non-pure ESP project is one that requires Arduino functions.

Mhm, for modern Arduino-ESP32 3.x with ESP-IDF base modifications (which you seem to do in your project, although I wonder which ESP-IDF settings you needed to change, or whether they’re still necessary in up-to-date Arduino-ESP32 core version?) it’s bettter to use the first platform, pioarduino, since the official espressif32 platform only gives you the Arduino-ESP32 2.x core.

I was too fast with ‘error-free’ :frowning: Yes, was updating my previous post while you posted too.

image

Line 30 is `#include <Arduino.h>'.

And when I hit compile it says: command ‘platformio-ide.build’ not found… but after while it came up with an output:

Resolving esp32doit-devkit-v1 dependencies...
Already up-to-date.
Updating metadata for the vscode IDE...
UserSideException: Processing esp32doit-devkit-v1 (platform: https://github.com/pioarduino/platform-espressif32/releases/download/54.03.20/platform-espressif32.zip; board: esp32doit-devkit-v1; framework: arduino, espidf)
--------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/esp32doit-devkit-v1.html
PLATFORM: Espressif 32 (54.3.20) > DOIT ESP32 DEVKIT V1
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
DEBUG: Current (cmsis-dap) External (cmsis-dap, esp-bridge, esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)
PACKAGES: 
 - framework-arduinoespressif32 @ 3.2.0 
 - framework-arduinoespressif32-libs @ 5.4.0+sha.2f7dcd862a 
 - framework-espidf @ 3.50401.0 (5.4.1) 
 - tool-cmake @ 3.30.2 
 - tool-esptoolpy @ 4.8.9 
 - tool-mklittlefs @ 3.2.0 
 - tool-ninja @ 1.7.1 
 - tool-riscv32-esp-elf-gdb @ 14.2.0+20240403 
 - tool-xtensa-esp-elf-gdb @ 14.2.0+20240403 
 - toolchain-esp32ulp @ 1.23800.240113 (2.38.0) 
 - toolchain-xtensa-esp-elf @ 14.2.0+20241119
Warning! Arduino framework as an ESP-IDF component doesn't handle the `variant` field! The default `esp32` variant will be used.
Reading CMake configuration...
-- git rev-parse returned 'fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).'
-- Building ESP-IDF components for target esp32
NOTICE: Skipping optional dependency: espressif/esp-sr
NOTICE: Skipping optional dependency: espressif/esp_hosted
NOTICE: Skipping optional dependency: espressif/esp_wifi_remote
NOTICE: Skipping optional dependency: espressif/esp-sr
NOTICE: Skipping optional dependency: espressif/esp_hosted
NOTICE: Skipping optional dependency: espressif/esp_wifi_remote
NOTICE: Skipping optional dependency: espressif/esp-sr
NOTICE: Skipping optional dependency: espressif/esp_hosted
NOTICE: Skipping optional dependency: espressif/esp_wifi_remote
NOTICE: 
Following dependencies have new versions available:
Dependency "espressif/esp-dsp": "1.4.12" -> "1.6.4"
Dependency "espressif/esp_modem": "1.1.0" -> "1.4.0"
Dependency "joltwallet/littlefs": "1.14.5" -> "1.20.0"
Consider running "idf.py update-dependencies" to update your lock file.
Processing 25 dependencies:
[1/25] chmorgan/esp-libhelix-mp3 (1.0.3)
[2/25] espressif/cbor (0.6.0~1)
[3/25] espressif/esp-dsp (1.4.12)
[4/25] espressif/esp-modbus (1.0.18)
[5/25] espressif/esp-serial-flasher (0.0.11)
[6/25] espressif/esp-zboss-lib (1.6.3)
[7/25] espressif/esp-zigbee-lib (1.6.3)
[8/25] espressif/esp_diag_data_store (1.0.2)
[9/25] espressif/esp_diagnostics (1.2.1)
[10/25] espressif/esp_insights (1.2.2)
[11/25] espressif/esp_modem (1.1.0)
[12/25] espressif/esp_rainmaker (1.5.2)
[13/25] espressif/esp_rcp_update (1.2.0)
[14/25] espressif/esp_schedule (1.2.0)
[15/25] espressif/esp_secure_cert_mgr (2.5.0)
[16/25] espressif/jsmn (1.1.0)
[17/25] espressif/json_generator (1.1.2)
[18/25] espressif/json_parser (1.0.3)
[19/25] espressif/libsodium (1.0.20~2)
[20/25] espressif/mdns (1.8.2)
[21/25] espressif/network_provisioning (1.0.2)
[22/25] espressif/qrcode (0.1.0~2)
[23/25] espressif/rmaker_common (1.4.6)
[24/25] joltwallet/littlefs (1.14.5)
[25/25] idf (5.4.1)
-- DEBUG: Use esp-modbus component folder: /home/maxg/Workspaces/PlatformIO/Projects/EGO_Automation/managed_components/espressif__esp-modbus.
NOTICE: Skipping optional dependency: espressif/esp-sr
NOTICE: Skipping optional dependency: espressif/esp_hosted
NOTICE: Skipping optional dependency: espressif/esp_wifi_remote
-- Project sdkconfig file /home/maxg/Workspaces/PlatformIO/Projects/EGO_Automation/sdkconfig.esp32doit-devkit-v1
-- Configuring incomplete, errors occurred!

fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
Traceback (most recent call last):
  File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/home/maxg/.platformio/penv/.espidf-5.4.1/lib/python3.10/site-packages/kconfgen/__main__.py", line 5, in <module>
    from .core import main
  File "/home/maxg/.platformio/penv/.espidf-5.4.1/lib/python3.10/site-packages/kconfgen/core.py", line 29, in <module>
    import esp_idf_kconfig.gen_kconfig_doc as gen_kconfig_doc
  File "/home/maxg/.platformio/penv/.espidf-5.4.1/lib/python3.10/site-packages/esp_idf_kconfig/gen_kconfig_doc.py", line 14, in <module>
    import kconfiglib.core as kconfiglib
  File "/home/maxg/.platformio/penv/.espidf-5.4.1/lib/python3.10/site-packages/kconfiglib/__init__.py", line 3, in <module>
    from .core import Kconfig  # noqa F401
  File "/home/maxg/.platformio/penv/.espidf-5.4.1/lib/python3.10/site-packages/kconfiglib/core.py", line 27, in <module>
    from kconfiglib.report import PRAGMA_PREFIX
  File "/home/maxg/.platformio/penv/.espidf-5.4.1/lib/python3.10/site-packages/kconfiglib/report.py", line 29, in <module>
    from rich import print as rprint
ModuleNotFoundError: No module named 'rich'
CMake Error at /home/maxg/.platformio/packages/framework-espidf/tools/cmake/kconfig.cmake:209 (message):
  Failed to run kconfgen
  (/home/maxg/.platformio/penv/.espidf-5.4.1/bin/python;-m;kconfgen;--list-separator=semicolon;--kconfig;/home/maxg/.platformio/packages/framework-espidf/Kconfig;--sdkconfig-rename;/home/maxg/.platformio/packages/framework-espidf/sdkconfig.rename;--config;/home/maxg/Workspaces/PlatformIO/Projects/EGO_Automation/sdkconfig.esp32doit-devkit-v1;--defaults;/home/maxg/Workspaces/PlatformIO/Projects/EGO_Automation/sdkconfig.defaults;--env-file;/home/maxg/Workspaces/PlatformIO/Projects/EGO_Automation/.pio/build/esp32doit-devkit-v1/config.env).
  Error 1
Call Stack (most recent call first):
  /home/maxg/.platformio/packages/framework-espidf/tools/cmake/build.cmake:681 (__kconfig_generate_config)
  /home/maxg/.platformio/packages/framework-espidf/tools/cmake/project.cmake:717 (idf_build_process)
  CMakeLists.txt:3 (project)



========================= [FAILED] Took 51.07 seconds =========================

Mhm, it seems ti didn’t install the python env correctly… Can you rm -rf /home/maxg/.platformio/penv/ and restart VSCode? That should reinstall the PIO core and the ESP-IDF python envs upon restart.

Hmm… deleted… installed itself, ended up with this:

Resolving esp32doit-devkit-v1 dependencies...
Already up-to-date.
Updating metadata for the vscode IDE...
UserSideException: Processing esp32doit-devkit-v1 (platform: https://github.com/pioarduino/platform-espressif32/releases/download/54.03.20/platform-espressif32.zip; board: esp32doit-devkit-v1; framework: arduino, espidf)
--------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/esp32doit-devkit-v1.html
PLATFORM: Espressif 32 (54.3.20) > DOIT ESP32 DEVKIT V1
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
DEBUG: Current (cmsis-dap) External (cmsis-dap, esp-bridge, esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)
PACKAGES: 
 - framework-arduinoespressif32 @ 3.2.0 
 - framework-arduinoespressif32-libs @ 5.4.0+sha.2f7dcd862a 
 - framework-espidf @ 3.50401.0 (5.4.1) 
 - tool-cmake @ 3.30.2 
 - tool-esptoolpy @ 4.8.9 
 - tool-mklittlefs @ 3.2.0 
 - tool-ninja @ 1.7.1 
 - tool-riscv32-esp-elf-gdb @ 14.2.0+20240403 
 - tool-xtensa-esp-elf-gdb @ 14.2.0+20240403 
 - toolchain-esp32ulp @ 1.23800.240113 (2.38.0) 
 - toolchain-xtensa-esp-elf @ 14.2.0+20241119
Installing Arduino Python dependencies
Collecting wheel>=0.35.1
  Using cached wheel-0.45.1-py3-none-any.whl.metadata (2.3 kB)
Collecting rich-click>=1.8.6
  Using cached rich_click-1.8.9-py3-none-any.whl.metadata (7.9 kB)
Collecting PyYAML>=6.0.2
  Using cached PyYAML-6.0.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (2.1 kB)
Collecting intelhex>=2.3.0
  Using cached intelhex-2.3.0-py2.py3-none-any.whl.metadata (2.7 kB)
Requirement already satisfied: click>=7 in /home/maxg/.platformio/penv/lib/python3.10/site-packages (from rich-click>=1.8.6) (8.1.7)
Collecting rich>=10.7 (from rich-click>=1.8.6)
  Using cached rich-14.0.0-py3-none-any.whl.metadata (18 kB)
Requirement already satisfied: typing_extensions>=4 in /home/maxg/.platformio/penv/lib/python3.10/site-packages (from rich-click>=1.8.6) (4.14.0)
Collecting markdown-it-py>=2.2.0 (from rich>=10.7->rich-click>=1.8.6)
  Using cached markdown_it_py-3.0.0-py3-none-any.whl.metadata (6.9 kB)
Collecting pygments<3.0.0,>=2.13.0 (from rich>=10.7->rich-click>=1.8.6)
  Using cached pygments-2.19.1-py3-none-any.whl.metadata (2.5 kB)
Collecting mdurl~=0.1 (from markdown-it-py>=2.2.0->rich>=10.7->rich-click>=1.8.6)
  Using cached mdurl-0.1.2-py3-none-any.whl.metadata (1.6 kB)
Using cached wheel-0.45.1-py3-none-any.whl (72 kB)
Using cached rich_click-1.8.9-py3-none-any.whl (36 kB)
Using cached PyYAML-6.0.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (751 kB)
Using cached intelhex-2.3.0-py2.py3-none-any.whl (50 kB)
Using cached rich-14.0.0-py3-none-any.whl (243 kB)
Using cached pygments-2.19.1-py3-none-any.whl (1.2 MB)
Using cached markdown_it_py-3.0.0-py3-none-any.whl (87 kB)
Using cached mdurl-0.1.2-py3-none-any.whl (10.0 kB)
Installing collected packages: intelhex, wheel, PyYAML, pygments, mdurl, markdown-it-py, rich, rich-click

Successfully installed PyYAML-6.0.2 intelhex-2.3.0 markdown-it-py-3.0.0 mdurl-0.1.2 pygments-2.19.1 rich-14.0.0 rich-click-1.8.9 wheel-0.45.1
Creating a new virtual environment for IDF Python dependencies
Installing ESP-IDF's Python dependencies
Collecting wheel>=0.35.1
  Using cached wheel-0.45.1-py3-none-any.whl (72 kB)
Collecting urllib3<2
  Using cached urllib3-1.26.20-py2.py3-none-any.whl (144 kB)
Collecting cryptography~=41.0.1
  Using cached cryptography-41.0.7-cp37-abi3-manylinux_2_28_x86_64.whl (4.4 MB)
Collecting future>=0.18.3
  Using cached future-1.0.0-py3-none-any.whl (491 kB)
Collecting pyparsing<4,>=3.1.0
  Using cached pyparsing-3.2.3-py3-none-any.whl (111 kB)
Collecting idf-component-manager~=2.0.1
  Using cached idf_component_manager-2.0.4-py3-none-any.whl (151 kB)
Collecting esp-idf-kconfig>=2.5.0
  Using cached esp_idf_kconfig-3.0.0-py3-none-any.whl (153 kB)
Collecting cffi>=1.12
  Using cached cffi-1.17.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (446 kB)
Collecting requests-file
  Using cached requests_file-2.1.0-py2.py3-none-any.whl (4.2 kB)
Collecting pydantic-settings
  Using cached pydantic_settings-2.9.1-py3-none-any.whl (44 kB)
Collecting tqdm
  Using cached tqdm-4.67.1-py3-none-any.whl (78 kB)
Collecting requests
  Using cached requests-2.32.3-py3-none-any.whl (64 kB)
Collecting requests-toolbelt
  Using cached requests_toolbelt-1.0.0-py2.py3-none-any.whl (54 kB)
Collecting pydantic
  Using cached pydantic-2.11.5-py3-none-any.whl (444 kB)
Collecting pydantic-core
  Using cached pydantic_core-2.34.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.0 MB)
Collecting colorama
  Using cached colorama-0.4.6-py2.py3-none-any.whl (25 kB)
Collecting typing-extensions
  Using cached typing_extensions-4.14.0-py3-none-any.whl (43 kB)
Collecting pyyaml
  Using cached PyYAML-6.0.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (751 kB)
Collecting jsonref
  Using cached jsonref-1.1.0-py3-none-any.whl (9.4 kB)
Collecting click
  Using cached click-8.2.1-py3-none-any.whl (102 kB)
Collecting pycparser
  Using cached pycparser-2.22-py3-none-any.whl (117 kB)
Collecting annotated-types>=0.6.0
  Using cached annotated_types-0.7.0-py3-none-any.whl (13 kB)
Collecting pydantic-core
  Using cached pydantic_core-2.33.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.0 MB)
Collecting typing-inspection>=0.4.0
  Using cached typing_inspection-0.4.1-py3-none-any.whl (14 kB)
Collecting python-dotenv>=0.21.0
  Using cached python_dotenv-1.1.0-py3-none-any.whl (20 kB)
Collecting idna<4,>=2.5
  Using cached idna-3.10-py3-none-any.whl (70 kB)
Collecting certifi>=2017.4.17
  Using cached certifi-2025.4.26-py3-none-any.whl (159 kB)
Collecting charset-normalizer<4,>=2
  Using cached charset_normalizer-3.4.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (149 kB)
Installing collected packages: wheel, urllib3, typing-extensions, tqdm, pyyaml, python-dotenv, pyparsing, pycparser, jsonref, idna, future, esp-idf-kconfig, colorama, click, charset-normalizer, certifi, annotated-types, typing-inspection, requests, pydantic-core, cffi, requests-toolbelt, requests-file, pydantic, cryptography, pydantic-settings, idf-component-manager
Successfully installed annotated-types-0.7.0 certifi-2025.4.26 cffi-1.17.1 charset-normalizer-3.4.2 click-8.2.1 colorama-0.4.6 cryptography-41.0.7 esp-idf-kconfig-3.0.0 future-1.0.0 idf-component-manager-2.0.4 idna-3.10 jsonref-1.1.0 pycparser-2.22 pydantic-2.11.5 pydantic-core-2.33.2 pydantic-settings-2.9.1 pyparsing-3.2.3 python-dotenv-1.1.0 pyyaml-6.0.2 requests-2.32.3 requests-file-2.1.0 requests-toolbelt-1.0.0 tqdm-4.67.1 typing-extensions-4.14.0 typing-inspection-0.4.1 urllib3-1.26.20 wheel-0.45.1
Warning! Arduino framework as an ESP-IDF component doesn't handle the `variant` field! The default `esp32` variant will be used.
Reading CMake configuration...
-- git rev-parse returned 'fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).'
-- Building ESP-IDF components for target esp32
NOTICE: Skipping optional dependency: espressif/esp-sr
NOTICE: Skipping optional dependency: espressif/esp_hosted
NOTICE: Skipping optional dependency: espressif/esp_wifi_remote
NOTICE: Skipping optional dependency: espressif/esp-sr
NOTICE: Skipping optional dependency: espressif/esp_hosted
NOTICE: Skipping optional dependency: espressif/esp_wifi_remote
NOTICE: Skipping optional dependency: espressif/esp-sr
NOTICE: Skipping optional dependency: espressif/esp_hosted
NOTICE: Skipping optional dependency: espressif/esp_wifi_remote
NOTICE: 
Following dependencies have new versions available:
Dependency "espressif/esp-dsp": "1.4.12" -> "1.6.4"
Dependency "espressif/esp_modem": "1.1.0" -> "1.4.0"
Dependency "joltwallet/littlefs": "1.14.5" -> "1.20.0"
Consider running "idf.py update-dependencies" to update your lock file.
Processing 25 dependencies:
[1/25] chmorgan/esp-libhelix-mp3 (1.0.3)
[2/25] espressif/cbor (0.6.0~1)
[3/25] espressif/esp-dsp (1.4.12)
[4/25] espressif/esp-modbus (1.0.18)
[5/25] espressif/esp-serial-flasher (0.0.11)
[6/25] espressif/esp-zboss-lib (1.6.3)
[7/25] espressif/esp-zigbee-lib (1.6.3)
[8/25] espressif/esp_diag_data_store (1.0.2)
[9/25] espressif/esp_diagnostics (1.2.1)
[10/25] espressif/esp_insights (1.2.2)
[11/25] espressif/esp_modem (1.1.0)
[12/25] espressif/esp_rainmaker (1.5.2)
[13/25] espressif/esp_rcp_update (1.2.0)
[14/25] espressif/esp_schedule (1.2.0)
[15/25] espressif/esp_secure_cert_mgr (2.5.0)
[16/25] espressif/jsmn (1.1.0)
[17/25] espressif/json_generator (1.1.2)
[18/25] espressif/json_parser (1.0.3)
[19/25] espressif/libsodium (1.0.20~2)
[20/25] espressif/mdns (1.8.2)
[21/25] espressif/network_provisioning (1.0.2)
[22/25] espressif/qrcode (0.1.0~2)
[23/25] espressif/rmaker_common (1.4.6)
[24/25] joltwallet/littlefs (1.14.5)
[25/25] idf (5.4.1)
-- DEBUG: Use esp-modbus component folder: /home/maxg/Workspaces/PlatformIO/Projects/EGO_Automation/managed_components/espressif__esp-modbus.
NOTICE: Skipping optional dependency: espressif/esp-sr
NOTICE: Skipping optional dependency: espressif/esp_hosted
NOTICE: Skipping optional dependency: espressif/esp_wifi_remote
-- Project sdkconfig file /home/maxg/Workspaces/PlatformIO/Projects/EGO_Automation/sdkconfig.esp32doit-devkit-v1
-- Configuring incomplete, errors occurred!

fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
Traceback (most recent call last):
  File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/home/maxg/.platformio/penv/.espidf-5.4.1/lib/python3.10/site-packages/kconfgen/__main__.py", line 5, in <module>
    from .core import main
  File "/home/maxg/.platformio/penv/.espidf-5.4.1/lib/python3.10/site-packages/kconfgen/core.py", line 29, in <module>
    import esp_idf_kconfig.gen_kconfig_doc as gen_kconfig_doc
  File "/home/maxg/.platformio/penv/.espidf-5.4.1/lib/python3.10/site-packages/esp_idf_kconfig/gen_kconfig_doc.py", line 14, in <module>
    import kconfiglib.core as kconfiglib
  File "/home/maxg/.platformio/penv/.espidf-5.4.1/lib/python3.10/site-packages/kconfiglib/__init__.py", line 3, in <module>
    from .core import Kconfig  # noqa F401
  File "/home/maxg/.platformio/penv/.espidf-5.4.1/lib/python3.10/site-packages/kconfiglib/core.py", line 27, in <module>
    from kconfiglib.report import PRAGMA_PREFIX
  File "/home/maxg/.platformio/penv/.espidf-5.4.1/lib/python3.10/site-packages/kconfiglib/report.py", line 29, in <module>
    from rich import print as rprint
ModuleNotFoundError: No module named 'rich'
CMake Error at /home/maxg/.platformio/packages/framework-espidf/tools/cmake/kconfig.cmake:209 (message):
  Failed to run kconfgen
  (/home/maxg/.platformio/penv/.espidf-5.4.1/bin/python;-m;kconfgen;--list-separator=semicolon;--kconfig;/home/maxg/.platformio/packages/framework-espidf/Kconfig;--sdkconfig-rename;/home/maxg/.platformio/packages/framework-espidf/sdkconfig.rename;--config;/home/maxg/Workspaces/PlatformIO/Projects/EGO_Automation/sdkconfig.esp32doit-devkit-v1;--defaults;/home/maxg/Workspaces/PlatformIO/Projects/EGO_Automation/sdkconfig.defaults;--env-file;/home/maxg/Workspaces/PlatformIO/Projects/EGO_Automation/.pio/build/esp32doit-devkit-v1/config.env).
  Error 1
Call Stack (most recent call first):
  /home/maxg/.platformio/packages/framework-espidf/tools/cmake/build.cmake:681 (__kconfig_generate_config)
  /home/maxg/.platformio/packages/framework-espidf/tools/cmake/project.cmake:717 (idf_build_process)
  CMakeLists.txt:3 (project)



========================= [FAILED] Took 69.87 seconds =========================

Mhm, I have not seen that before. Looks like it’s missing a Python dependency even though environment was cleanly reinstalled. Maybe @jason2866 has some ideas?

Yes, the espressif component kconfig has been updated and needs now the python module rich. The needed change is done already in pioarduino in the development branches. To fix on your current install. Install module rich in your pyenv which is used from Platformio. When using VSC this should work. Opening a Terminal and fire the command pip3 install rich.

Writing here from mobile phone is a pain here!

2 Likes

I would never have figured this out…

When I ran the command I get this:

# [2025-06-08 08:00] maxg@x570 ~/Workspaces/PlatformIO/Projects/EGO_Automation $ 
pip3 install rich
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: rich in /usr/lib/python3/dist-packages (11.2.0)
Requirement already satisfied: colorama<0.5.0,>=0.4.0 in /usr/lib/python3/dist-packages (from rich) (0.4.4)
Requirement already satisfied: commonmark<0.10.0,>=0.9.0 in /usr/lib/python3/dist-packages (from rich) (0.9.1)
Requirement already satisfied: pygments<3.0.0,>=2.6.0 in /usr/lib/python3/dist-packages (from rich) (2.11.2)

Does this mean this component is already installed.
VScode also came up saying something along the lines “Python environment not writeable; do you want to install this in a virtual environment”. I simply closed this message, seeing the above commentary.

I have deleted PIO
Removed cache and toolchain folders
Opened VCcode and PIO installed itself…
However, still the same error.

Maybe it is the incorrect platform files?

Any hints appreciated.

Does this still happen if you set

platform = https://github.com/pioarduino/platform-espressif32.git

again do rm -rf /home/maxg/.platformio/penv/ and restart VSCode?

Unfortunately yes…

The first thing after VScode started was this…

08/06/2025, 17:38:12] Unable to resolve configuration with compilerPath "/home/maxg/.platformio/packages/toolchain-atmelavr/bin/avr-gcc".  Using "/usr/bin/clang-18" instead.
[08/06/2025, 17:38:14] Unable to resolve configuration with compilerPath "/home/maxg/.platformio/packages/toolchain-xtensa-esp32@8.4.0+2021r2-patch5/bin/xtensa-esp32-elf-gcc".  Using "/usr/bin/clang-18" instead.
[08/06/2025, 17:38:14] Unable to resolve configuration with compilerPath "/home/maxg/.platformio/packages/toolchain-gccarmnoneeabi/bin/arm-none-eabi-gcc".  Using "/usr/bin/clang-18" instead.
[08/06/2025, 17:38:14] Unable to resolve configuration with compilerPath "/home/maxg/.platformio/packages/toolchain-xtensa/bin/xtensa-lx106-elf-gcc".  Using "/usr/bin/clang-18" instead.

… it’s seems to get weirder by the day…

And after PIO updated, I get this…

Resolving esp32doit-devkit-v1 dependencies...
Tool Manager: Installing https://github.com/Jason2866/esp32-arduino-lib-builder/releases/download/3467/framework-arduinoespressif32-all-release_v5.1-7e10045.zip
Unpacking 0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100%
Tool Manager: framework-arduinoespressif32@3.0.8+sha.7e10045 has been installed!
Tool Manager: Installing https://github.com/tasmota/esp-idf/releases/download/v5.1.6.250320/esp-idf-v5.1.6.zip
Unpacking 0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100%
Tool Manager: framework-espidf@3.50106.0 has been installed!
Tool Manager: Installing espressif/toolchain-xtensa-esp32 @ 12.2.0+20230208
Unpacking 0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100%
Tool Manager: toolchain-xtensa-esp32@12.2.0+20230208 has been installed!
Tool Manager: Installing platformio/toolchain-esp32ulp @ ~1.23500.0
Unpacking 0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100%
Tool Manager: toolchain-esp32ulp@1.23500.220830 has been installed!
Tool Manager: Installing espressif/tool-xtensa-esp-elf-gdb @ ~12.1.0
Unpacking 0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100%
Tool Manager: tool-xtensa-esp-elf-gdb@12.1.0+20221002 has been installed!
Tool Manager: Installing espressif/tool-riscv32-esp-elf-gdb @ ~12.1.0
Unpacking 0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100%
Tool Manager: tool-riscv32-esp-elf-gdb@12.1.0+20221002 has been installed!
Tool Manager: Installing https://github.com/tasmota/esptool/releases/download/v4.8.8/esptool.zip
Unpacking 0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100%
Tool Manager: tool-esptoolpy@4.8.8 has been installed!
Tool Manager: Installing platformio/tool-cmake @ ~3.21.0
Unpacking 0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100%
Tool Manager: tool-cmake@3.21.3 has been installed!
Already up-to-date.
Updating metadata for the vscode IDE...
UserSideException: Processing esp32doit-devkit-v1 (platform: https://github.com/Jason2866/platform-espressif32.git#Arduino/IDF5; board: esp32doit-devkit-v1; framework: arduino, espidf)
--------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
NameError: name 'config' is not defined:
  File "/home/maxg/.platformio/penv/lib/python3.10/site-packages/platformio/builder/main.py", line 173:
    env.SConscript("$BUILD_SCRIPT")
  File "/home/maxg/.platformio/packages/tool-scons/scons-local-4.8.1/SCons/Script/SConscript.py", line 620:
    return _SConscript(self.fs, *files, **subst_kw)
  File "/home/maxg/.platformio/packages/tool-scons/scons-local-4.8.1/SCons/Script/SConscript.py", line 280:
    exec(compile(scriptdata, scriptname, 'exec'), call_stack[-1].globals)
  File "/home/maxg/.platformio/platforms/espressif32@src-6702293b941d3896da49241577f9b2cc/builder/main.py", line 313:
    if not check_lib_archive_exists():
  File "/home/maxg/.platformio/platforms/espressif32@src-6702293b941d3896da49241577f9b2cc/builder/main.py", line 306:
    for section in config.sections():
========================== [FAILED] Took 0.34 seconds ==========================

This is complaining about code that doesn’t exist (anymore)? Line 306 does not have for section in config.sections.

https://github.com/pioarduino/platform-espressif32/blob/main/builder/main.py#L306

Can you

rm -rf ~/.platformio/platforms/espressif32@src-6702293b941d3896da49241577f9b2cc

and retry.

If you don’t have any special modfications to your espressif32 platforms, you can also just

rm -rf ~/.platformio/platforms/espressif32*

to get to a clean state.

Thanks… done that (with VScode closed)…

After VScode start:

Resolving esp32doit-devkit-v1 dependencies...
Platform Manager: Installing git+https://github.com/Jason2866/platform-espressif32.git#Arduino/IDF5
git version 2.34.1
Cloning into '/home/maxg/.platformio/.cache/tmp/pkg-installing-tfvsgw49'...

Platform Manager: espressif32@2025.3.10+sha.ba3a7b4 has been installed!
Updating metadata for the vscode IDE...
UserSideException: Processing esp32doit-devkit-v1 (platform: https://github.com/Jason2866/platform-espressif32.git#Arduino/IDF5; board: esp32doit-devkit-v1; framework: arduino, espidf)
--------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
NameError: name 'config' is not defined:
  File "/home/maxg/.platformio/penv/lib/python3.10/site-packages/platformio/builder/main.py", line 173:
    env.SConscript("$BUILD_SCRIPT")
  File "/home/maxg/.platformio/packages/tool-scons/scons-local-4.8.1/SCons/Script/SConscript.py", line 620:
    return _SConscript(self.fs, *files, **subst_kw)
  File "/home/maxg/.platformio/packages/tool-scons/scons-local-4.8.1/SCons/Script/SConscript.py", line 280:
    exec(compile(scriptdata, scriptname, 'exec'), call_stack[-1].globals)
  File "/home/maxg/.platformio/platforms/espressif32/builder/main.py", line 313:
    if not check_lib_archive_exists():
  File "/home/maxg/.platformio/platforms/espressif32/builder/main.py", line 306:
    for section in config.sections():
========================== [FAILED] Took 0.45 seconds ==========================

… after hitting compile:

Processing esp32doit-devkit-v1 (platform: https://github.com/Jason2866/platform-espressif32.git#Arduino/IDF5; board: esp32doit-devkit-v1; framework: arduino, espidf)
-----------------------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
NameError: name 'config' is not defined:
  File "/home/maxg/.platformio/penv/lib/python3.10/site-packages/platformio/builder/main.py", line 173:
    env.SConscript("$BUILD_SCRIPT")
  File "/home/maxg/.platformio/packages/tool-scons/scons-local-4.8.1/SCons/Script/SConscript.py", line 620:
    return _SConscript(self.fs, *files, **subst_kw)
  File "/home/maxg/.platformio/packages/tool-scons/scons-local-4.8.1/SCons/Script/SConscript.py", line 280:
    exec(compile(scriptdata, scriptname, 'exec'), call_stack[-1].globals)
  File "/home/maxg/.platformio/platforms/espressif32/builder/main.py", line 313:
    if not check_lib_archive_exists():
  File "/home/maxg/.platformio/platforms/espressif32/builder/main.py", line 306:
    for section in config.sections():
====================================================== [FAILED] Took 0.34 seconds ======================================================

 *  The terminal process "platformio 'run'" terminated with exit code: 1. 
 *  Terminal will be reused by tasks, press any key to close it. 

Out of the three includes, uart_reg.h no longer red-squiggles, only Arduino.h is missing.

… but overall errors are far less; only what is shown here.

But that’s still the old URL. Did you not change to

platform = https://github.com/pioarduino/platform-espressif32.git

?

My apologies… I hit discard changes in VScode, after it showed some 2000 of them related to ESP lib files etc. Little did I know that it also killed my program modifications and new files created since last commit. I have been able to retrieve my latest program version, but didn’t realise platformio.ini was in a very old state.

I have now done the following:

  1. retrieved my accidentally deleted files
  2. changed platform.ini to use the right platform
[env:esp32doit-devkit-v1]
platform = https://github.com/pioarduino/platform-espressif32.git
board = esp32doit-devkit-v1
framework = arduino, espidf

monitor_speed = 115200
  1. rm -rf ~/.platformio/platforms/espressif32* (again, and as I never made mods)
  2. Started VScode. and get this:
Resolving esp32doit-devkit-v1 dependencies...
Platform Manager: Installing git+https://github.com/pioarduino/platform-espressif32.git
git version 2.34.1
Cloning into '/home/maxg/.platformio/.cache/tmp/pkg-installing-zsdw1jwm'...

Platform Manager: espressif32@54.3.20+sha.7650157 has been installed!
Updating metadata for the vscode IDE...
UserSideException: Processing esp32doit-devkit-v1 (platform: https://github.com/pioarduino/platform-espressif32.git; board: esp32doit-devkit-v1; framework: arduino, espidf)
--------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/esp32doit-devkit-v1.html
PLATFORM: Espressif 32 (54.3.20+sha.7650157) > DOIT ESP32 DEVKIT V1
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
DEBUG: Current (cmsis-dap) External (cmsis-dap, esp-bridge, esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)
PACKAGES: 
 - framework-arduinoespressif32 @ 3.2.0 
 - framework-arduinoespressif32-libs @ 5.4.0+sha.2f7dcd862a 
 - framework-espidf @ 3.50401.0 (5.4.1) 
 - tool-cmake @ 3.30.2 
 - tool-esptoolpy @ 4.8.9 
 - tool-mklittlefs @ 3.2.0 
 - tool-ninja @ 1.7.1 
 - tool-riscv32-esp-elf-gdb @ 14.2.0+20240403 
 - tool-xtensa-esp-elf-gdb @ 14.2.0+20240403 
 - toolchain-esp32ulp @ 1.23800.240113 (2.38.0) 
 - toolchain-xtensa-esp-elf @ 14.2.0+20241119
Warning! Arduino framework as an ESP-IDF component doesn't handle the `variant` field! The default `esp32` variant will be used.
Reading CMake configuration...
-- git rev-parse returned 'fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).'
-- Building ESP-IDF components for target esp32
NOTICE: Skipping optional dependency: espressif/esp-sr
NOTICE: Skipping optional dependency: espressif/esp_hosted
NOTICE: Skipping optional dependency: espressif/esp_wifi_remote
NOTICE: Skipping optional dependency: espressif/esp-sr
NOTICE: Skipping optional dependency: espressif/esp_hosted
NOTICE: Skipping optional dependency: espressif/esp_wifi_remote
NOTICE: Skipping optional dependency: espressif/esp-sr
NOTICE: Skipping optional dependency: espressif/esp_hosted
NOTICE: Skipping optional dependency: espressif/esp_wifi_remote
NOTICE: 
Following dependencies have new versions available:
Dependency "espressif/esp-dsp": "1.4.12" -> "1.6.4"
Dependency "espressif/esp_modem": "1.1.0" -> "1.4.0"
Dependency "joltwallet/littlefs": "1.14.5" -> "1.20.0"
Consider running "idf.py update-dependencies" to update your lock file.
Processing 25 dependencies:
[1/25] chmorgan/esp-libhelix-mp3 (1.0.3)
[2/25] espressif/cbor (0.6.0~1)
[3/25] espressif/esp-dsp (1.4.12)
[4/25] espressif/esp-modbus (1.0.18)
[5/25] espressif/esp-serial-flasher (0.0.11)
[6/25] espressif/esp-zboss-lib (1.6.3)
[7/25] espressif/esp-zigbee-lib (1.6.3)
[8/25] espressif/esp_diag_data_store (1.0.2)
[9/25] espressif/esp_diagnostics (1.2.1)
[10/25] espressif/esp_insights (1.2.2)
[11/25] espressif/esp_modem (1.1.0)
[12/25] espressif/esp_rainmaker (1.5.2)
[13/25] espressif/esp_rcp_update (1.2.0)
[14/25] espressif/esp_schedule (1.2.0)
[15/25] espressif/esp_secure_cert_mgr (2.5.0)
[16/25] espressif/jsmn (1.1.0)
[17/25] espressif/json_generator (1.1.2)
[18/25] espressif/json_parser (1.0.3)
[19/25] espressif/libsodium (1.0.20~2)
[20/25] espressif/mdns (1.8.2)
[21/25] espressif/network_provisioning (1.0.2)
[22/25] espressif/qrcode (0.1.0~2)
[23/25] espressif/rmaker_common (1.4.6)
[24/25] joltwallet/littlefs (1.14.5)
[25/25] idf (5.4.1)
-- DEBUG: Use esp-modbus component folder: /home/maxg/Workspaces/PlatformIO/Projects/EGO_Automation/managed_components/espressif__esp-modbus.
NOTICE: Skipping optional dependency: espressif/esp-sr
NOTICE: Skipping optional dependency: espressif/esp_hosted
NOTICE: Skipping optional dependency: espressif/esp_wifi_remote
-- Project sdkconfig file /home/maxg/Workspaces/PlatformIO/Projects/EGO_Automation/sdkconfig.esp32doit-devkit-v1
-- Configuring incomplete, errors occurred!

fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
Traceback (most recent call last):
  File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/home/maxg/.platformio/penv/.espidf-5.4.1/lib/python3.10/site-packages/kconfgen/__main__.py", line 5, in <module>
    from .core import main
  File "/home/maxg/.platformio/penv/.espidf-5.4.1/lib/python3.10/site-packages/kconfgen/core.py", line 29, in <module>
    import esp_idf_kconfig.gen_kconfig_doc as gen_kconfig_doc
  File "/home/maxg/.platformio/penv/.espidf-5.4.1/lib/python3.10/site-packages/esp_idf_kconfig/gen_kconfig_doc.py", line 14, in <module>
    import kconfiglib.core as kconfiglib
  File "/home/maxg/.platformio/penv/.espidf-5.4.1/lib/python3.10/site-packages/kconfiglib/__init__.py", line 3, in <module>
    from .core import Kconfig  # noqa F401
  File "/home/maxg/.platformio/penv/.espidf-5.4.1/lib/python3.10/site-packages/kconfiglib/core.py", line 27, in <module>
    from kconfiglib.report import PRAGMA_PREFIX
  File "/home/maxg/.platformio/penv/.espidf-5.4.1/lib/python3.10/site-packages/kconfiglib/report.py", line 29, in <module>
    from rich import print as rprint
ModuleNotFoundError: No module named 'rich'
CMake Error at /home/maxg/.platformio/packages/framework-espidf/tools/cmake/kconfig.cmake:209 (message):
  Failed to run kconfgen
  (/home/maxg/.platformio/penv/.espidf-5.4.1/bin/python;-m;kconfgen;--list-separator=semicolon;--kconfig;/home/maxg/.platformio/packages/framework-espidf/Kconfig;--sdkconfig-rename;/home/maxg/.platformio/packages/framework-espidf/sdkconfig.rename;--config;/home/maxg/Workspaces/PlatformIO/Projects/EGO_Automation/sdkconfig.esp32doit-devkit-v1;--defaults;/home/maxg/Workspaces/PlatformIO/Projects/EGO_Automation/sdkconfig.defaults;--env-file;/home/maxg/Workspaces/PlatformIO/Projects/EGO_Automation/.pio/build/esp32doit-devkit-v1/config.env).
  Error 1
Call Stack (most recent call first):
  /home/maxg/.platformio/packages/framework-espidf/tools/cmake/build.cmake:681 (__kconfig_generate_config)
  /home/maxg/.platformio/packages/framework-espidf/tools/cmake/project.cmake:717 (idf_build_process)
  CMakeLists.txt:3 (project)



========================= [FAILED] Took 53.91 seconds =========================

Two includes are not found
image

Can you run in a terminal

/home/maxg/.platformio/penv/.espidf-5.4.1/bin/activate
/home/maxg/.platformio/penv/.espidf-5.4.1/bin/python -m pip install rich

and hit the build button.

1 Like
# [2025-06-08 18:10] maxg@x570 ~/Workspaces/PlatformIO/Projects $ 
/home/maxg/.platformio/penv/.espidf-5.4.1/bin/activate
/home/maxg/.platformio/penv/.espidf-5.4.1/bin/python -m pip install rich
bash: /home/maxg/.platformio/penv/.espidf-5.4.1/bin/activate: Permission denied
Collecting rich
  Downloading rich-14.0.0-py3-none-any.whl (243 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 243.2/243.2 KB 397.0 kB/s eta 0:00:00
Requirement already satisfied: typing-extensions<5.0,>=4.0.0 in /home/maxg/.platformio/penv/.espidf-5.4.1/lib/python3.10/site-packages (from rich) (4.14.0)
Collecting markdown-it-py>=2.2.0
  Downloading markdown_it_py-3.0.0-py3-none-any.whl (87 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 87.5/87.5 KB 602.1 kB/s eta 0:00:00
Collecting pygments<3.0.0,>=2.13.0
  Downloading pygments-2.19.1-py3-none-any.whl (1.2 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.2/1.2 MB 446.5 kB/s eta 0:00:00
Collecting mdurl~=0.1
  Downloading mdurl-0.1.2-py3-none-any.whl (10.0 kB)
Installing collected packages: pygments, mdurl, markdown-it-py, rich
Successfully installed markdown-it-py-3.0.0 mdurl-0.1.2 pygments-2.19.1 rich-14.0.0
# [2025-06-08 18:20] maxg@x570 ~/Workspaces/PlatformIO/Projects $ 

Hitting build seems to work.

Executing task in folder EGO_Automation: platformio run 

Processing esp32doit-devkit-v1 (platform: https://github.com/pioarduino/platform-espressif32.git; board: esp32doit-devkit-v1; framework: arduino, espidf)
------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/esp32doit-devkit-v1.html
PLATFORM: Espressif 32 (54.3.20+sha.7650157) > DOIT ESP32 DEVKIT V1
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
DEBUG: Current (cmsis-dap) External (cmsis-dap, esp-bridge, esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)
PACKAGES: 
 - framework-arduinoespressif32 @ 3.2.0 
 - framework-arduinoespressif32-libs @ 5.4.0+sha.2f7dcd862a 
 - framework-espidf @ 3.50401.0 (5.4.1) 
 - tool-cmake @ 3.30.2 
 - tool-esptoolpy @ 4.8.9 
 - tool-mklittlefs @ 3.2.0 
 - tool-ninja @ 1.7.1 
 - tool-riscv32-esp-elf-gdb @ 14.2.0+20240403 
 - tool-xtensa-esp-elf-gdb @ 14.2.0+20240403 
 - toolchain-esp32ulp @ 1.23800.240113 (2.38.0) 
 - toolchain-xtensa-esp-elf @ 14.2.0+20241119
Warning! Arduino framework as an ESP-IDF component doesn't handle the `variant` field! The default `esp32` variant will be used.
Reading CMake configuration...
Warning! Flash memory size mismatch detected. Expected 4MB, found 2MB!
Please select a proper value in your `sdkconfig.defaults` or via the `menuconfig` target!
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 41 compatible libraries
Scanning dependencies...
No dependencies
Building in release mode
Compiling .pio/build/esp32doit-devkit-v1/src/config.cpp.o
Compiling .pio/build/esp32doit-devkit-v1/src/main.cpp.o
Generating LD script .pio/build/esp32doit-devkit-v1/esp-idf/esp_system/ld/memory.ld.in
Generating LD script .pio/build/esp32doit-devkit-v1/esp-idf/esp_system/ld/sections.ld.in
Compiling .pio/build/esp32doit-devkit-v1/app_trace/app_trace.c.o
Generating LD script .pio/build/esp32doit-devkit-v1/memory.ld
Compiling .pio/build/esp32doit-devkit-v1/app_trace/app_trace_util.c.o
Compiling .pio/build/esp32doit-devkit-v1/app_trace/host_file_io.c.o
Compiling .pio/build/esp32doit-devkit-v1/app_trace/port/port_uart.c.o
Compiling .pio/build/esp32doit-devkit-v1/app_update/esp_ota_ops.c.o
Compiling .pio/build/esp32doit-devkit-v1/app_update/esp_ota_app_desc.c.o
Compiling .pio/build/esp32doit-devkit-v1/bootloader_support/src/bootloader_common.c.o
Archiving .pio/build/esp32doit-devkit-v1/esp-idf/app_trace/libapp_trace.a
Indexing .pio/build/esp32doit-devkit-v1/esp-idf/app_trace/libapp_trace.a
Compiling .pio/build/esp32doit-devkit-v1/bootloader_support/src/bootloader_common_loader.c.o
Compiling .pio/build/esp32doit-devkit-v1/bootloader_support/src/bootloader_clock_init.c.o
Compiling .pio/build/esp32doit-devkit-v1/bootloader_support/src/bootloader_mem.c.o
Compiling .pio/build/esp32doit-devkit-v1/bootloader_support/src/bootloader_random.c.o
Compiling .pio/build/esp32doit-devkit-v1/bootloader_support/src/bootloader_efuse.c.o
Compiling .pio/build/esp32doit-devkit-v1/bootloader_support/src/flash_encrypt.c.o
Compiling .pio/build/esp32doit-devkit-v1/bootloader_support/src/secure_boot.c.o
Archiving .pio/build/esp32doit-devkit-v1/esp-idf/app_update/libapp_update.a
Indexing .pio/build/esp32doit-devkit-v1/esp-idf/app_update/libapp_update.a
Compiling .pio/build/esp32doit-devkit-v1/bootloader_support/src/bootloader_random_esp32.c.o
Compiling .pio/build/esp32doit-devkit-v1/bootloader_support/bootloader_flash/src/bootloader_flash.c.o
Compiling .pio/build/esp32doit-devkit-v1/bootloader_support/bootloader_flash/src/flash_qio_mode.c.o
Compiling .pio/build/esp32doit-devkit-v1/bootloader_support/bootloader_flash/src/bootloader_flash_config_esp32.c.o
Compiling .pio/build/esp32doit-devkit-v1/bootloader_support/src/bootloader_utility.c.o
Compiling .pio/build/esp32doit-devkit-v1/bootloader_support/src/flash_partitions.c.o
Compiling .pio/build/esp32doit-devkit-v1/bootloader_support/src/esp_image_format.c.o
Compiling .pio/build/esp32doit-devkit-v1/bootloader_support/src/idf/bootloader_sha.c.o
Compiling .pio/build/esp32doit-devkit-v1/bootloader_support/src/esp32/secure_boot_secure_features.c.o
Compiling .pio/build/esp32doit-devkit-v1/managed_components/chmorgan__esp-libhelix-mp3/libhelix-mp3/mp3dec.c.o
Compiling .pio/build/esp32doit-devkit-v1/managed_components/chmorgan__esp-libhelix-mp3/libhelix-mp3/mp3tabs.c.o
Compiling .pio/build/esp32doit-devkit-v1/managed_components/chmorgan__esp-libhelix-mp3/libhelix-mp3/real/bitstream.c.o
Compiling .pio/build/esp32doit-devkit-v1/managed_components/chmorgan__esp-libhelix-mp3/libhelix-mp3/real/buffers.c.o
Compiling .pio/build/esp32doit-devkit-v1/managed_components/chmorgan__esp-libhelix-mp3/libhelix-mp3/real/dct32.c.o
Compiling .pio/build/esp32doit-devkit-v1/managed_components/chmorgan__esp-libhelix-mp3/libhelix-mp3/real/dequant.c.o
Compiling .pio/build/esp32doit-devkit-v1/managed_components/chmorgan__esp-libhelix-mp3/libhelix-mp3/real/dqchan.c.o
Compiling .pio/build/esp32doit-devkit-v1/managed_components/chmorgan__esp-libhelix-mp3/libhelix-mp3/real/huffman.c.o
Compiling .pio/build/esp32doit-devkit-v1/managed_components/chmorgan__esp-libhelix-mp3/libhelix-mp3/real/hufftabs.c.o
Compiling .pio/build/esp32doit-devkit-v1/managed_components/chmorgan__esp-libhelix-mp3/libhelix-mp3/real/imdct.c.o
Compiling .pio/build/esp32doit-devkit-v1/managed_components/chmorgan__esp-libhelix-mp3/libhelix-mp3/real/polyphase.c.o
Compiling .pio/build/esp32doit-devkit-v1/managed_components/chmorgan__esp-libhelix-mp3/libhelix-mp3/real/scalfact.c.o
Compiling .pio/build/esp32doit-devkit-v1/managed_components/chmorgan__esp-libhelix-mp3/libhelix-mp3/real/stproc.c.o
Compiling .pio/build/esp32doit-devkit-v1/managed_components/chmorgan__esp-libhelix-mp3/libhelix-mp3/real/subband.c.o
Archiving .pio/build/esp32doit-devkit-v1/esp-idf/bootloader_support/libbootloader_support.a
Compiling .pio/build/esp32doit-devkit-v1/managed_components/chmorgan__esp-libhelix-mp3/libhelix-mp3/real/trigtabs.c.o
Indexing .pio/build/esp32doit-devkit-v1/esp-idf/bootloader_support/libbootloader_support.a
Compiling .pio/build/esp32doit-devkit-v1/cmock/CMock/src/cmock.c.o
src/config.cpp:38:10: error: 'SBUS_IDLE' was not declared in this scope
   38 |          SBUS_IDLE - SBUS_DEAD_BAND,
      |          ^~~~~~~~~
src/config.cpp:38:22: error: 'SBUS_DEAD_BAND' was not declared in this scope
   38 |          SBUS_IDLE - SBUS_DEAD_BAND,
      |                      ^~~~~~~~~~~~~~
Compiling .pio/build/esp32doit-devkit-v1/console/commands.c.o
src/config.cpp:39:10: error: 'SBUS_IDLE' was not declared in this scope
   39 |          SBUS_IDLE + SBUS_DEAD_BAND,
      |          ^~~~~~~~~
src/config.cpp:39:22: error: 'SBUS_DEAD_BAND' was not declared in this scope
   39 |          SBUS_IDLE + SBUS_DEAD_BAND,
      |                      ^~~~~~~~~~~~~~
Compiling .pio/build/esp32doit-devkit-v1/console/esp_console_common.c.o
Archiving .pio/build/esp32doit-devkit-v1/esp-idf/cmock/libcmock.a
Compiling .pio/build/esp32doit-devkit-v1/console/split_argv.c.o
src/main.cpp:128:36: error: 'SBUS_IDLE' was not declared in this scope
  128 | int16_t g_radio_ctrl_left_signal  {SBUS_IDLE};
      |                                    ^~~~~~~~~
Indexing .pio/build/esp32doit-devkit-v1/esp-idf/cmock/libcmock.a
Compiling .pio/build/esp32doit-devkit-v1/console/linenoise/linenoise.c.o
src/main.cpp:129:36: error: 'SBUS_IDLE' was not declared in this scope
  129 | int16_t g_radio_ctrl_right_signal {SBUS_IDLE};
      |                                    ^~~~~~~~~
Compiling .pio/build/esp32doit-devkit-v1/console/esp_console_repl_chip.c.o
src/main.cpp: In function 'void setup()':
src/main.cpp:185:19: error: 'SBUS_BAUD_RATE' was not declared in this scope; did you mean 'EGO_BAUD_RATE'?
  185 |     Serial2.begin(SBUS_BAUD_RATE, SERIAL_8E2, SBUS_RX_PIN, SBUS_TX_PIN, true);
      |                   ^~~~~~~~~~~~~~
      |                   EGO_BAUD_RATE
Compiling .pio/build/esp32doit-devkit-v1/console/argtable3/arg_cmd.c.o
src/main.cpp:185:47: error: 'SBUS_RX_PIN' was not declared in this scope
  185 |     Serial2.begin(SBUS_BAUD_RATE, SERIAL_8E2, SBUS_RX_PIN, SBUS_TX_PIN, true);
      |                                               ^~~~~~~~~~~
*** [.pio/build/esp32doit-devkit-v1/src/config.cpp.o] Error 1
Compiling .pio/build/esp32doit-devkit-v1/console/argtable3/arg_date.c.o
src/main.cpp:185:60: error: 'SBUS_TX_PIN' was not declared in this scope
  185 |     Serial2.begin(SBUS_BAUD_RATE, SERIAL_8E2, SBUS_RX_PIN, SBUS_TX_PIN, true);
      |                                                            ^~~~~~~~~~~
src/main.cpp: In function 'void loop()':
src/main.cpp:304:25: error: 'SBUS_IDLE' was not declared in this scope
  304 |                     ) > SBUS_IDLE;
      |                         ^~~~~~~~~
src/main.cpp: In function 'void determine_lever_positions()':
src/main.cpp:362:38: error: 'SBUS_REVERSE' was not declared in this scope
  362 |     if (g_radio_ctrl_right_signal <= SBUS_REVERSE)
      |                                      ^~~~~~~~~~~~
src/main.cpp:365:13: error: 'SBUS_MIN' was not declared in this scope
  365 |             SBUS_MIN, SBUS_REVERSE, right_hall_sensor_set.H1_RANGE - 1, right_hall_sensor_set.H1_START_REVERSE);
      |             ^~~~~~~~
src/main.cpp:367:43: error: 'SBUS_FORWARD' was not declared in this scope; did you mean 'IP_FORWARD'?
  367 |     else if (g_radio_ctrl_right_signal >= SBUS_FORWARD)
      |                                           ^~~~~~~~~~~~
      |                                           IP_FORWARD
src/main.cpp:370:27: error: 'SBUS_MAX' was not declared in this scope; did you mean 'SBT_MAX'?
  370 |             SBUS_FORWARD, SBUS_MAX, right_hall_sensor_set.H1_START_FORWARD, 0);
      |                           ^~~~~~~~
      |                           SBT_MAX
src/main.cpp:375:14: error: 'SBUS_MAX' was not declared in this scope; did you mean 'SBT_MAX'?
  375 |             (SBUS_MAX - SBUS_MIN - (SBUS_IDLE - SBUS_MIN))
      |              ^~~~~~~~
      |              SBT_MAX
src/main.cpp:375:25: error: 'SBUS_MIN' was not declared in this scope
  375 |             (SBUS_MAX - SBUS_MIN - (SBUS_IDLE - SBUS_MIN))
      |                         ^~~~~~~~
src/main.cpp:375:37: error: 'SBUS_IDLE' was not declared in this scope
  375 |             (SBUS_MAX - SBUS_MIN - (SBUS_IDLE - SBUS_MIN))
      |                                     ^~~~~~~~~
src/main.cpp:385:37: error: 'SBUS_REVERSE' was not declared in this scope
  385 |     if (g_radio_ctrl_left_signal <= SBUS_REVERSE)
      |                                     ^~~~~~~~~~~~
src/main.cpp:388:13: error: 'SBUS_MIN' was not declared in this scope
  388 |             SBUS_MIN, SBUS_REVERSE, 0, left_hall_sensor_set.H1_START_REVERSE);
      |             ^~~~~~~~
src/main.cpp:390:42: error: 'SBUS_FORWARD' was not declared in this scope; did you mean 'IP_FORWARD'?
  390 |     else if (g_radio_ctrl_left_signal >= SBUS_FORWARD)
      |                                          ^~~~~~~~~~~~
      |                                          IP_FORWARD
src/main.cpp:393:27: error: 'SBUS_MAX' was not declared in this scope; did you mean 'SBT_MAX'?
  393 |             SBUS_FORWARD, SBUS_MAX, left_hall_sensor_set.H1_START_FORWARD,
      |                           ^~~~~~~~
      |                           SBT_MAX
src/main.cpp:399:15: error: 'SBUS_IDLE' was not declared in this scope
  399 |             ((SBUS_IDLE - SBUS_MIN) * left_hall_sensor_set.H1_RANGE)
      |               ^~~~~~~~~
src/main.cpp:399:27: error: 'SBUS_MIN' was not declared in this scope
  399 |             ((SBUS_IDLE - SBUS_MIN) * left_hall_sensor_set.H1_RANGE)
      |                           ^~~~~~~~
src/main.cpp:400:16: error: 'SBUS_MAX' was not declared in this scope; did you mean 'SBT_MAX'?
  400 |             / (SBUS_MAX - SBUS_MIN));
      |                ^~~~~~~~
      |                SBT_MAX
*** [.pio/build/esp32doit-devkit-v1/src/main.cpp.o] Error 1
===================================== [FAILED] Took 4.69 seconds =====================================

 *  The terminal process "platformio 'run'" terminated with exit code: 1. 
 *  Terminal will be reused by tasks, press any key to close it. 

All these compile errors are mine, as I created config.* files and removed variables out of main.

Thank you kindly for sorting this out!!