pioarduino/platform-espressif32

Installation Issues on macOS Persist

Closed this issue · 25 comments

PROBLEM DESCRIPTION

Installation issues on macOS persist.

TO REPRODUCE

Am trying to remove completely use of the PlatformIO extension, in favour of solely using pioarduino.

Before starting, performed all the steps in my comment here: #235 (comment)

Then installed the pioarduino extension from within VSCode.

Then opened the sketch below, and selected as the environment: [env:piostable]

EXPECTED BEHAVIOUR

Expected the extension to install the ESP32 toolchain. Instead the pioarduino extension threw the following errors:

%23 Description of problem
  Leave a comment...

  BEFORE SUBMITTING, PLEASE SEARCH FOR DUPLICATES IN
  - https://github.com/pioarduino/pioarduino-vscode-ide/issues%3Fq=is%3Aissue 

  %23 Configuration

  VSCode: 1.104.3
  PIO IDE: v1.1.0
  System: Darwin, 24.6.0, x64

  %23 Exception

  Error: PlatformioException: Invalid path to PIO Home Contrib

    at /Users/xylo/.vscode/extensions/pioarduino.pioarduino-ide-1.1.0/node_modules/pioarduino-node-helpers/dist/index.js:1:10765
    at ChildProcess.f (/Users/xylo/.vscode/extensions/pioarduino.pioarduino-ide-1.1.0/node_modules/pioarduino-node-helpers/dist/index.js:1:4399)
    at ChildProcess.emit (node:events:518:28)
    at ChildProcess.emit (node:domain:489:12)
    at maybeClose (node:internal/child_process:1101:16)
    at Socket.<anonymous> (node:internal/child_process:456:11)
    at Socket.emit (node:events:518:28)
    at Socket.emit (node:domain:489:12)
    at Pipe.<anonymous> (node:net:346:12)

Message returned after selecting the environment in VSCode:

Verbose mode can be enabled via `-v, --verbose` option
Error: 'tool-esptoolpy' package directory not found: ''
========================== [FAILED] Took 2.04 seconds ==========================

Environment    Status    Duration
-------------  --------  ------------
piostable      FAILED    00:00:02.045
==================== 1 failed, 0 succeeded in 00:00:02.045 ====================

Error returned after selecting the pio321 environment:

Resolving pio321 dependencies...
Platform Manager: Installing https://github.com/pioarduino/platform-espressif32/releases/download/54.03.21-2/platform-espressif32.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%
Platform Manager: platform@54.3.21 has been installed!
AttributeError: Traceback (most recent call last):
  File "/Users/xylo/.platformio/penv/lib/python3.13/site-packages/platformio/__main__.py", line 103, in main
    cli()  # pylint: disable=no-value-for-parameter
    ~~~^^
  File "/Users/xylo/.platformio/penv/lib/python3.13/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
           ~~~~~~~~~^^^^^^^^^^^^^^^^^
  File "/Users/xylo/.platformio/penv/lib/python3.13/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
  File "/Users/xylo/.platformio/penv/lib/python3.13/site-packages/platformio/cli.py", line 85, in invoke
    return super().invoke(ctx)
           ~~~~~~~~~~~~~~^^^^^
  File "/Users/xylo/.platformio/penv/lib/python3.13/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^
  File "/Users/xylo/.platformio/penv/lib/python3.13/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^
  File "/Users/xylo/.platformio/penv/lib/python3.13/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/xylo/.platformio/penv/lib/python3.13/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
  File "/Users/xylo/.platformio/penv/lib/python3.13/site-packages/platformio/project/commands/init.py", line 106, in project_init_cmd
    install_project_dependencies(
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
        options=dict(
        ^^^^^^^^^^^^^
    ...<3 lines>...
        )
        ^
    )
    ^
  File "/Users/xylo/.platformio/penv/lib/python3.13/site-packages/platformio/package/commands/install.py", line 107, in install_project_dependencies
    already_up_to_date = not install_project_env_dependencies(env, options)
                             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^
  File "/Users/xylo/.platformio/penv/lib/python3.13/site-packages/platformio/package/commands/install.py", line 132, in install_project_env_dependencies
    _install_project_env_platform(project_env, options),
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/xylo/.platformio/penv/lib/python3.13/site-packages/platformio/package/commands/install.py", line 149, in _install_project_env_platform
    PlatformPackageManager().install(
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
        spec,
        ^^^^^
    ...<3 lines>...
        force=options.get("force"),
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/Users/xylo/.platformio/penv/lib/python3.13/site-packages/platformio/package/manager/platform.py", line 52, in install
    p = PlatformFactory.new(pkg)
  File "/Users/xylo/.platformio/penv/lib/python3.13/site-packages/platformio/platform/factory.py", line 79, in new
    platform_cls = getattr(
        cls.load_platform_module(
    ...<2 lines>...
        cls.get_clsname(platform_name),
    )
AttributeError: module 'platformio.platform.platform' has no attribute 'PlatformPlatform'

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

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

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

SCREENSHOTS

If applicable, add screenshots to help explain your problem.

ADDITIONAL CONTEXT

System info:
Device: iMac, Retina 5K, 27-inch, 2020
Processor: 3.8 GHz 8-Core Intel Core i7
Memory: 128 GB 2400 MHz DDR4
macOS: 15.7.1 (24G231)

VSCode:
Version: 1.104.3
Commit: 385651c938df8a906869babee516bffd0ddb9829
Date: 2025-10-02T12:30:51.747Z
Electron: 37.3.1
ElectronBuildId: 12404162
Chromium: 138.0.7204.235
Node.js: 22.18.0
V8: 13.8.258.31-electron.0
OS: Darwin x64 24.6.0

main.cpp file:

// Testing fresh install of pioarduino with a mix of Arduino and esp32 boards.

#include <Arduino.h>

// put function declarations here:
int myFunction( int, int );

void setup() {
    // put your setup code here, to run once:
    Serial.println( " Here we go..." );
    delay ( 2000 );
}

void loop() {
    // put your main code here, to run repeatedly:
    for ( int i = 0; i < 100; i++ ) {
        for ( int j = 0; j < 100; j++ ) {
            Serial.println( myFunction( i, j ) );
            delay( 750 );
        }
        Serial.println( "End of the \"j\" loop. Incrementing \"i\" and repeating..." );
    }
    Serial.println( "End of the loops - restarting..." );
}

// put function definitions here:
int myFunction( int x, int y ) {
    return ( x + y );
}

platformio.ini file:

; PlatformIO Project Configuration File

[env:arduinoNano]
platform = atmelavr
board = nanoatmega328new
framework = arduino
monitor_speed = 9600

[env:esp32base]
board = esp32dev
framework = arduino
monitor_speed = 115200

[env:piostable]
extends = esp32base
platform = https://github.com/pioarduino/platform-espressif32/releases/download/stable/platform-espressif32.zip

[env:pio307]
extends = esp32base
platform = https://github.com/pioarduino/platform-espressif32/releases/download/51.03.07/platform-espressif32.zip

[env:pio321]
extends = esp32base
platform = https://github.com/pioarduino/platform-espressif32/releases/download/54.03.21-2/platform-espressif32.zip

Python installation:

~ % which python 
python: aliased to python3

~ % which python3
/usr/local/bin/python3

~ % python --version
Python 3.13.7

FWIW, selecting env:arduinoNano works fine.

Be glad to provide any other info.

With release Arduino core 3.2.1 it is not possible. Try with latest stable. The release 3.3.2 (probably next week) will have more changes to improve install.
The next release will fix the issue Error: PlatformioException: Invalid path to PIO Home Contrib

@Jason2866 : Are you meaning that the current (v1.1.0) and future versions of the pioarduino extension will only be compatible with arduino-esp32 core versions 3.3.0 and greater?

No, pioarduino Platform espressif32 has been optimized to cover more cases for install without issues. There are no changes in pioarduino VSC extension which makes is incompatible to any release before.
Clearly speaking v1.1.0 should be as compatible as the version(s) before.
The contrib-piohome error is a edge case caused from the Platform NOT from pioarduino

Trying then to understand your comment?:

With release Arduino core 3.2.1 it is not possible

To install from scratch. Platform release 3.2.1 does not install by default PIO Home Contrib, so it errors when trying to open Pio Home.

@Jason2866 At this point, it seems there is no way to get the pioarduino extension installed.

Many hours spent trying to do so.

There is a gob of stuff below, but question is: What's left to try? Be glad to help figure this out in any way with you.

Starting with:

  1. Complete removal of everything related to PlatformIO. Then:
  2. Install pioarduino extension.
  3. Quit VSC
  4. Launch VSC
  5. Click pioarduino extension
  6. Let it Install
  7. Click the Reload Window button
  8. Quit VSC
  9. Launch VSC
  10. Click pioarduino extension
  11. Select New project
  12. pioarduino (VSC) throws error:
Error: PlatformioException: Invalid path to PIO Home Contrib at /Users/xylo/.vscode/extensions/pioarduino.pioarduino-ide-1.1.0/node_modules/pioarduino-node-helpers/dist/index.js:1:10765 at ChildProcess.f (/Users/xylo/.vscode/extensions/pioarduino.pioarduino-ide-1.1.0/node_modules/pioarduino-node-helpers/dist/index.js:1:4399) at ChildProcess.emit (node:events:518:28) at ChildProcess.emit (node:domain:489:12) at maybeClose (node:internal/child_process:1101:16) at Socket.<anonymous> (node:internal/child_process:456:11) at Socket.emit (node:events:518:28) at Socket.emit (node:domain:489:12) at Pipe.<anonymous> (node:net:346:12)...

    Source: pioarduino
  1. Click Report a problem button.

New GitHub issue opens in pioarduimo/pioarduino-vscode-ide repository,
Title: Start PIO Home Server
Description:
%23 Description of problem
Leave a comment...

  BEFORE SUBMITTING, PLEASE SEARCH FOR DUPLICATES IN
  - https://github.com/pioarduino/pioarduino-vscode-ide/issues%3Fq=is%3Aissue 

  %23 Configuration

  VSCode: 1.104.3
  PIO IDE: v1.1.0
  System: Darwin, 24.6.0, x64

  %23 Exception
  ```
  Error: PlatformioException: Invalid path to PIO Home Contrib

    at /Users/xylo/.vscode/extensions/pioarduino.pioarduino-ide-1.1.0/node_modules/pioarduino-node-helpers/dist/index.js:1:10765
    at ChildProcess.f (/Users/xylo/.vscode/extensions/pioarduino.pioarduino-ide-1.1.0/node_modules/pioarduino-node-helpers/dist/index.js:1:4399)
    at ChildProcess.emit (node:events:518:28)
    at ChildProcess.emit (node:domain:489:12)
    at maybeClose (node:internal/child_process:1101:16)
    at Socket.<anonymous> (node:internal/child_process:456:11)
    at Socket.emit (node:events:518:28)
    at Socket.emit (node:domain:489:12)
    at Pipe.<anonymous> (node:net:346:12)
  ```
  1. Note, did not try to load an existing project. Tried to let pioarduino come at things cleanly. No go.

  2. Eventually, if you quit and go at it again, creating a new project via the PIO Home tab, it will create the project, but the Exception error noted above pops up again.

  3. Dismissing that and hitting the Build button then throws:

 *  Executing task: platformio run 

Processing esp32dev (platform: espressif32; board: esp32dev; framework: arduino)
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
idf_tools.py installation failed
idf_tools.py installation failed
Verbose mode can be enabled via `-v, --verbose` option
idf_tools.py installation failed
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/esp32dev.html
PLATFORM: Espressif 32 (55.3.31) > Espressif ESP32 Dev Module
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: 
 - contrib-piohome @ 3.4.4 
 - framework-arduinoespressif32 @ 3.3.0 
 - framework-arduinoespressif32-libs @ 5.5.0+sha.129cd0d247 
 - tool-esptoolpy @ 5.1.0 
 - tool-mklittlefs @ 3.2.0 
 - toolchain-xtensa-esp-elf @ 14.2.0+20241119
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 42 compatible libraries
Scanning dependencies...
No dependencies
Building in release mode
Compiling .pio/build/esp32dev/src/main.cpp.o
Building .pio/build/esp32dev/bootloader.bin
Generating partitions .pio/build/esp32dev/partitions.bin
sh: xtensa-esp32-elf-g++: command not found
*** [.pio/build/esp32dev/src/main.cpp.o] Error 127
esptool v5.1.0
Creating ESP32 image...
Merged 2 ELF sections.
Successfully created ESP32 image.
========================================================================= [FAILED] Took 30.98 seconds =========================================================================

 *  The terminal process "platformio 'run'" terminated with exit code: 1. 
  1. For reference, the platformio.ini file created via New Project is:
[env:esp32dev]
platform = espressif32
board = esp32dev
framework = arduino

(Shouldn't "New Project" create an .ini file with the platform = entry set to the pioarduino repository?)

And the sketch is:

#include <Arduino.h>

// put function declarations here:
int myFunction(int, int);

void setup() {
  // put your setup code here, to run once:
  int result = myFunction(2, 3);
}

void loop() {
  // put your main code here, to run repeatedly:
}

// put function definitions here:
int myFunction(int x, int y) {
  return x + y;
}
  1. If I modify the .ini file to be:
[env:esp32dev]
platform = https://github.com/pioarduino/platform-espressif32/releases/download/stable/platform-espressif32.zip
board = esp32dev
framework = arduino
  1. After saving the file, OUTPUT throws:
Resolving esp32dev dependencies...
idf_tools.py installation failed

Already up-to-date.
Updating metadata for the vscode IDE...
  1. Hitting the Build button again gets:
 *  Executing task: platformio run 

Processing esp32dev (platform: https://github.com/pioarduino/platform-espressif32/releases/download/stable/platform-espressif32.zip; board: esp32dev; framework: arduino)
------------------------------------------------------------------------------------------------------------------------------------------------------
idf_tools.py installation failed
idf_tools.py installation failed
Verbose mode can be enabled via `-v, --verbose` option
idf_tools.py installation failed
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/esp32dev.html
PLATFORM: Espressif 32 (55.3.31) > Espressif ESP32 Dev Module
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: 
 - contrib-piohome @ 3.4.4 
 - framework-arduinoespressif32 @ 3.3.0 
 - framework-arduinoespressif32-libs @ 5.5.0+sha.129cd0d247 
 - tool-esptoolpy @ 5.1.0 
 - tool-mklittlefs @ 3.2.0 
 - toolchain-xtensa-esp-elf @ 14.2.0+20241119
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 42 compatible libraries
Scanning dependencies...
No dependencies
Building in release mode
Compiling .pio/build/esp32dev/src/main.cpp.o
Building .pio/build/esp32dev/bootloader.bin
sh: xtensa-esp32-elf-g++: command not found
Generating partitions .pio/build/esp32dev/partitions.bin
*** [.pio/build/esp32dev/src/main.cpp.o] Error 127
esptool v5.1.0
Creating ESP32 image...
Merged 2 ELF sections.
Successfully created ESP32 image.
============================================================ [FAILED] Took 31.27 seconds ============================================================

 *  The terminal process "platformio 'run'" terminated with exit code: 1. 

  1. At this point, the only way to get things working again is to completely remove all references to pioarduino, then install the original PlatformIO extension and go from there. There is an issue with esp-idf-size as it picks up the new 2.0.0 version which has breaking changes, but editing the python build scripts to remove use of the ng option cleans that up.

I've more detail if needed.

Do not try to generate a new project in this state. Open an existing one. As i wrote before the version you try has not installed piohome. This will always fail with this version. If an existing project is opened and piohome installed. After this a new project can be done via piohom new project. As i wrote before the new release will have this fixed and new project will work immediately

try latest release core 3.3.2

TLDR; version:

OK. With core 3.3.2 we get there. Kinda.

The install process is quite rocky.

The PlatformioException: Invalid path to PIO Home Contrib... error still appears, but seems to (eventually) not be a problem.

There are issues with cores earlier than 3.3.0. For example...

Errors and warnings when building with core 3.2.1 are:

 *  Executing task: platformio run --environment core321 

Processing core321 (platform: https://github.com/pioarduino/platform-espressif32/releases/download/54.03.21-2/platform-espressif32.zip; board: esp32dev; framework: arduino)
-----------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/esp32dev.html
PLATFORM: Espressif 32 (54.3.21) > Espressif ESP32 Dev Module
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.1 
 - framework-arduinoespressif32-libs @ 5.4.0+sha.858a988d6e 
 - tool-esptoolpy @ 5.0.2 
 - tool-mklittlefs @ 3.2.0 
 - toolchain-xtensa-esp-elf @ 14.2.0+20241119

/Users/robl/.platformio/penv/bin/python: No module named pip
Warning! Couldn't extract the list of installed Python packages.
Installing Arduino Python dependencies
/Users/robl/.platformio/penv/bin/python: No module named pip
*** Error 1
.
.
.
Warning: DEPRECATED: 'esptool.py' is deprecated. Please use 'esptool' instead. The '.py' suffix will be removed in a future major release.
esptool v5.0.2
.
.
.
usage: esp_idf_size [-h] [--format {table,text,tree,csv,json2,raw,dot}]
                    [--archives] [--archive-dependencies] [--dep-symbols]
                    [--dep-reverse] [--archive-details ARCHIVE_NAME] [--files]
                    [--diff MAP_FILE] [--no-abbrev] [--unify] [--show-unused]
                    [--show-unchanged] [--use-flash-size] [--lto] [-d]
                    [-o OUTPUT_FILE] [-s COLUMN] [-F PATTERN] [--sort-diff]
                    [--sort-reverse] [-q] [--no-color] [--force-terminal]
                    [--doc]
                    MAP_FILE
esp_idf_size: error: unrecognized arguments: --ng
Warning: esp-idf-size exited with code 2
.
.
.
Building .pio/build/core321/firmware.bin
Warning: DEPRECATED: 'esptool.py' is deprecated. Please use 'esptool' instead. The '.py' suffix will be removed in a future major release.
esptool v5.0.2

While this did compile, it won't in the future unless corrections are made to the build script for pip, esp_idf_size and esptool.py.

Be glad to provide more info as required.

Very long gory details below:


To start, outside of VSC, create a new project folder consisting of:

/Users/robl/Documents/PlatformIO
└── Projects
    └── piotest
        ├── include
        │   └── README
        ├── lib
        │   └── README
        ├── platformio.ini
        ├── src
        │   └── main.cpp
        └── test
            └── README

The platformio.ini file is:

; PlatformIO Project Configuration File

[env:esp32dev]
platform = https://github.com/pioarduino/platform-espressif32/releases/download/stable/platform-espressif32.zip
board = esp32dev
framework = arduino

The main.cpp file is:

#include <Arduino.h>

// put function declarations here:
int myFunction(int, int);

void setup() {
  // put your setup code here, to run once:
  int result = myFunction(2, 3);
}

void loop() {
  // put your main code here, to run repeatedly:
}

// put function definitions here:
int myFunction(int x, int y) {
  return x + y;
}
  1. Completely remove all instances and references of pioarduino from VSC and delete the ~/.platformio folder.
  2. Launch VSC
  3. Install the pioarduino extension
  4. Quit VSC
  5. Launch VSC
  6. Click the pioarduino icon
  7. Let pioarduino install
  8. Click "Reload window" button
  9. Click Open folder
  10. Navigate to the piotest folder
  11. Click "Open", error message pops up:
Error: PlatformioException: Invalid path to PIO Home Contrib at /Users/robl/.vscode/extensions/pioarduino.pioarduino-ide-1.1.0/node_modules/pioarduino-node-helpers/dist/index.js:1:10765 at ChildProcess.f (/Users/robl/.vscode/extensions/pioarduino.pioarduino-ide-1.1.0/node_modules/pioarduino-node-helpers/dist/index.js:1:4399) at ChildProcess.emit (node:events:518:28) at ChildProcess.emit (node:domain:489:12) at maybeClose (node:internal/child_process:1101:16) at Socket.<anonymous> (node:internal/child_process:456:11) at Socket.emit (node:events:518:28) at Socket.emit (node:domain:489:12) at Pipe.<anonymous> (node:net:346:12)...
  1. Click "Report a Problem", new Github issue opens (pioarduino is still "doing things" in the background in VSC)
%23 Description of problem
  Leave a comment...

  BEFORE SUBMITTING, PLEASE SEARCH FOR DUPLICATES IN
  - https://github.com/pioarduino/pioarduino-vscode-ide/issues%3Fq=is%3Aissue 

  %23 Configuration

  VSCode: 1.104.3
  PIO IDE: v1.1.0
  System: Darwin, 24.6.0, x64

  %23 Exception
  
  Error: PlatformioException: Invalid path to PIO Home Contrib

    at /Users/robl/.vscode/extensions/pioarduino.pioarduino-ide-1.1.0/node_modules/pioarduino-node-helpers/dist/index.js:1:10765
    at ChildProcess.f (/Users/robl/.vscode/extensions/pioarduino.pioarduino-ide-1.1.0/node_modules/pioarduino-node-helpers/dist/index.js:1:4399)
    at ChildProcess.emit (node:events:518:28)
    at ChildProcess.emit (node:domain:489:12)
    at maybeClose (node:internal/child_process:1101:16)
    at Socket.<anonymous> (node:internal/child_process:456:11)
    at Socket.emit (node:events:518:28)
    at Socket.emit (node:domain:489:12)
    at Pipe.<anonymous> (node:net:346:12)

In VSC, the PIO Home tab window is frozen, displaying "Loading..."

  1. Close PIO Home tab.
  2. Close the workspace (cmd-K f)
  3. Quit VSC
  4. Launch VSC
  5. In VSC, click the Explorer icon
  6. Click Open Folder
  7. Navigate to the piotest folder, click "Open"
  8. PIO Home window opens, the PROBLEMS window shows (if there is a way to copy this in non-json format, that'd be good to know...):
[{
	"resource": "/Users/robl/Documents/PlatformIO/Projects/piotest/.vscode/c_cpp_properties.json",
	"owner": "/Users/robl/Documents/PlatformIO/Projects/piotest",
	"severity": 4,
	"message": "Cannot find: \"/Users/robl/.platformio/packages/framework-arduinoespressif32-libs/esp32/include/esp_system/port/soc\"",
	"startLineNumber": 48,
	"startColumn": 17,
	"endLineNumber": 48,
	"endColumn": 119,
	"origin": "extHost1"
},{
	"resource": "/Users/robl/Documents/PlatformIO/Projects/piotest/.vscode/c_cpp_properties.json",
	"owner": "/Users/robl/Documents/PlatformIO/Projects/piotest",
	"severity": 4,
	"message": "Cannot find: \"/Users/robl/.platformio/packages/framework-arduinoespressif32-libs/esp32/include/espressif__esp_matter/connectedhomeip/connectedhomeip/src/platform/ESP32/bluedroid\"",
	"startLineNumber": 118,
	"startColumn": 17,
	"endLineNumber": 118,
	"endColumn": 182,
	"origin": "extHost1"
},{
	"resource": "/Users/robl/Documents/PlatformIO/Projects/piotest/.vscode/c_cpp_properties.json",
	"owner": "/Users/robl/Documents/PlatformIO/Projects/piotest",
	"severity": 4,
	"message": "Cannot find: \"/Users/robl/.platformio/packages/framework-arduinoespressif32-libs/esp32/include/esp_system/port/soc\"",
	"startLineNumber": 392,
	"startColumn": 21,
	"endLineNumber": 392,
	"endColumn": 123,
	"origin": "extHost1"
},{
	"resource": "/Users/robl/Documents/PlatformIO/Projects/piotest/.vscode/c_cpp_properties.json",
	"owner": "/Users/robl/Documents/PlatformIO/Projects/piotest",
	"severity": 4,
	"message": "Cannot find: \"/Users/robl/.platformio/packages/framework-arduinoespressif32-libs/esp32/include/espressif__esp_matter/connectedhomeip/connectedhomeip/src/platform/ESP32/bluedroid\"",
	"startLineNumber": 462,
	"startColumn": 21,
	"endLineNumber": 462,
	"endColumn": 186,
	"origin": "extHost1"
}]
  1. Wait a while (5 minutes??)...
  2. Messages in the PROBLEMS and OUTPUT tabs clear
  3. Click the Build icon
  4. Hold breath
  5. Project builds 👍
  6. Modify the platformio.ini file to include core 3.2.1 (-2):
; PlatformIO Project Configuration File

[env:esp32dev]
platform = https://github.com/pioarduino/platform-espressif32/releases/download/stable/platform-espressif32.zip
board = esp32dev
framework = arduino

[env:core321]
platform = https://github.com/pioarduino/platform-espressif32/releases/download/54.03.21-2/platform-espressif32.zip
board = esp32dev
framework = arduino

Project updates successfully.
27. Select the core321 environment
28. Build Project
29. Project builds but with warnings and errors (see TLDR; section above).

It's actually worse.

After this, I quit VSC and relaunched.

pioarduino threw a bunch of errors related to the two versions of the core referenced in the platform.ini file.

Quit everything again, edit the platform.ini to remove the core321 environment.

Launched VSC and now see the install is corrupted.

Initial errors are (in the PROBLEMS tab):

Cannot find: "/Users/robl/.platformio/packages/framework-arduinoespressif32-libs/esp32/include/esp_system/port/soc"
Cannot find: "/Users/robl/.platformio/packages/framework-arduinoespressif32-libs/esp32/include/espressif__esp_matter/connectedhomeip/connectedhomeip/src/platform/ESP32/bluedroid"
Cannot find: "/Users/robl/.platformio/packages/framework-arduinoespressif32-libs/esp32/include/esp_system/port/soc"
Cannot find: "/Users/robl/.platformio/packages/framework-arduinoespressif32-libs/esp32/include/espressif__esp_matter/connectedhomeip/connectedhomeip/src/platform/ESP32/bluedroid"
Cannot find: xtensa-esp32-elf-gcc

but after some time these go away.

But then these pop up:

#include errors detected. Please update your includePath. Squiggles are disabled for this translation unit (/Users/robl/Documents/PlatformIO/Projects/piotest/src/main.cpp).
cannot open source file "sys/reent.h" (dependency of "Arduino.h")

So, very much seems trying to use cores older than 3.3.2 is a no go still.

FWIW, the OUTPUT tabs shows:

Resolving esp32dev dependencies...
idf_tools.py installation failed (rc=1). Tail:
atformio/packages/tool-esp_install/tools/idf_tools.py", line 3902, in <module>
    main(sys.argv[1:])
    ~~~~^^^^^^^^^^^^^^
  File "/Users/robl/.platformio/packages/tool-esp_install/tools/idf_tools.py", line 3892, in main
    action_func(args)
    ~~~~~~~~~~~^^^^^^
  File "/Users/robl/.platformio/packages/tool-esp_install/tools/idf_tools.py", line 2927, in action_install
    tool_obj.install(tool_version)
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^
  File "/Users/robl/.platformio/packages/tool-esp_install/tools/idf_tools.py", line 1556, in install
    do_strip_container_dirs(dest_dir, self._current_options.strip_container_dirs)  # type: ignore
    ~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/robl/.platformio/packages/tool-esp_install/tools/idf_tools.py", line 1000, in do_strip_container_dirs
    raise RuntimeError(f'at level {level}, expected 1 entry, got {contents}')
RuntimeError: at level 0, expected 1 entry, got ['.DS_Store', 'xtensa-esp-elf']

Already up-to-date.
Updating metadata for the vscode IDE...
Project has been successfully updated!

Going for a beer now.

Cant reproduce when installing with latest release 55.03.32 and let it finish the complete install and open an existing project, i can use piohome. After this switching to older releases works without any issues.

Looking at the logs it seems for older versions you have issue to download the needed tools and toolchains (the are different for previous releases). So it is still the certificate problem. With latest release it installs Python certifi and calls the installer from this venv. So it ensures the certificates are found and used when the installer is running.
This is the major difference of the new release.

Probably your issues can be solved when you install certifi in the Python / Python venv which is used when calling the installer tool.

In general when VSC / pioarduino has crashed it should be looked for zombie processes in task manger.
Most of the time there are dead python tasks running. Without killing them, everything is unpredictable.

@UnexpectedMaker, @45gfg9, @Migsi, @TD-er, @rac146, @lovelytwo, @doudar

Wondering if you've managed to get pioarduino working with the 3.3.x versions of the core?

Especially if you've also managed to get it to co-exist with 3.3.x and earlier 3.y.z versions of the core?

If so, are any of you using an Intel Mac, and if so could you share your solution?

I'm kinda at my wits end here.

My machine details:

Device: iMac, Retina 5K, 27-inch, 2020
Processor: 3.8 GHz 8-Core Intel Core i7
Memory: 128 GB 2400 MHz DDR4
macOS: 15.7.1 (24G231)

Would truly appreciate any insight you can offer.

@Jason2866 Starting with a clean slate, and ensuring no python processes are running, the install still throws errors.

Any debugging suggestions?

Something specific in the $PATH to look for?

Should the PIO Home bug still be there with the newest core release?

Any chance you've tested this on an Intel based Mac?

I'm kinda throwing anything at the wall to see what sticks to resolve.

Thanks.

@Xylopyrographer Honestly i have no idea left. Nothing needs to be in $PATH and if something set regarding IDF, the latest release does set all IDF env var as needed for pioarduino in the Platform. If Python is installed or not, does not care, actual VSC pioarduino extension checks for a compability Python version and if not useable a Python version will be installed (in folder .platformio/penv via Python package manager uv. uv itself is bootstrapped itself in pioarduino extension when not found on the system.
All test are done on a Mac M1 and M3. I dont have a Intel Mac. Looked through the code. Dont see anything which should not work with Intel Mac too.

@Xylopyrographer Your platformio.ini is problematic. What happens with this one?

; PlatformIO Project Configuration File

[env:arduinoNano]
platform = atmelavr
board = nanoatmega328new
framework = arduino
monitor_speed = 9600

[env:piostable]
board = esp32dev
framework = arduino
monitor_speed = 115200
platform = https://github.com/pioarduino/platform-espressif32/releases/download/stable/platform-espressif32.zip

[env:pio307]
board = esp32dev
framework = arduino
monitor_speed = 115200
platform = https://github.com/pioarduino/platform-espressif32/releases/download/51.03.07/platform-espressif32.zip

[env:pio321]
board = esp32dev
framework = arduino
monitor_speed = 115200
platform = https://github.com/pioarduino/platform-espressif32/releases/download/54.03.21-2/platform-espressif32.zip
Image

@Jason2866 Thanks. I'll run that in a bit.

Earlier today, while attempting to isolate further the issue, I created a new User admin account.

The install of the pioarduino extension ran into a glitch which I resolved and there were a few other findings as well which I'll file here in a bit.

One of the things I did was poke around the ~/.platformio/penv folder. In there, the contents of ~/.platformio/penv/pyvenv.cfg is:

home = /usr/local/opt/python@3.13/bin
implementation = CPython
uv = 0.9.1
version_info = 3.13.7
include-system-site-packages = false

Shouldn't this point to the python environment inside the ~/.platformio/penv folder?

Looking back at my normal User account, the contents of ~/.platformio/penv/pyvenv.cfg is the same.

No, a pyvenv.cfg is pointing always to a full Python version. Since the Python binary in the venv is always called with full path the pyvenv.cfg entrys are not needed at all. Furthermore the venv never gets activated.

Btw. do you know why your posted platformio.ini is not working? No? Well you are trying to use and extend between different Platforms.

@Xylopyrographer Found a bug in pioarduino core. Now it does work for me to install pioarduino VSC extension and directly open PIO Home and generate a new project. No other steps needed anymore. New project takes a while since downloading framework, tools and toolchains needs to be done.

Image

I found where to change to have the platform entry pointing to pioarduino

There are no hickups left it installs smooth and a new pioarduino project can be directly generated via Pio Home
Feature Complete :-)

For completness. My pyvenv.cfg

home = /opt/homebrew/opt/python@3.13/bin
implementation = CPython
uv = 0.8.17
version_info = 3.13.7
include-system-site-packages = false

@Jason2866 Did a swack of testing from the new User account and using the fresh platformio.ini file you provided above. Thanks so much for that.

Can report all is working (excepting the New Project issue you found 👍) 🎉🥳!

There are a couple of issues with release 54.03.21-2

  1. It's looking for pip in penv
Processing pio321 (board: esp32dev; framework: arduino; platform: https://github.com/pioarduino/platform-espressif32/releases/download/54.03.21-2/platform-espressif32.zip)
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/esp32dev.html
PLATFORM: Espressif 32 (54.3.21) > Espressif ESP32 Dev Module
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.1 
 - framework-arduinoespressif32-libs @ 5.4.0+sha.858a988d6e 
 - tool-esptoolpy @ 5.0.2 
 - tool-mklittlefs @ 3.2.0 
 - toolchain-xtensa-esp-elf @ 14.2.0+20241119
/Users/xylo/.platformio/penv/bin/python: No module named pip
Warning! Couldn't extract the list of installed Python packages.
Installing Arduino Python dependencies
/Users/xylo/.platformio/penv/bin/python: No module named pip
*** Error 1

I tried adding a symlink to pip3 but that didn't work.

  1. It's using esptool.py instead of esptool
Warning: DEPRECATED: 'esptool.py' is deprecated. Please use 'esptool' instead. The '.py' suffix will be removed in a future major release.
  1. It's using the deprecated -ng v1.7.x syntax for esp-idf-size and/or the Tools Manager should install v1.7.x?
usage: esp_idf_size [-h] [--format {table,text,tree,csv,json2,raw,dot}]
                    [--archives] [--archive-dependencies] [--dep-symbols]
                    [--dep-reverse] [--archive-details ARCHIVE_NAME] [--files]
                    [--diff MAP_FILE] [--no-abbrev] [--unify] [--show-unused]
                    [--show-unchanged] [--use-flash-size] [--lto] [-d]
                    [-o OUTPUT_FILE] [-s COLUMN] [-F PATTERN] [--sort-diff]
                    [--sort-reverse] [-q] [--no-color] [--force-terminal]
                    [--doc]
                    MAP_FILE
esp_idf_size: error: unrecognized arguments: --ng
Warning: esp-idf-size exited with code 2

Did you want me to open a new Issue for those?

Will now try to get it working from my normal User account.

Many thanks again!

@Jason2866 Couple of other observations

  1. Noted that whenever the [env...] changes to a different release of the platform = , a good portion of the toolchain is downloaded and installed again every time.

Meaning, if you do a Default build where the platform.ini file has a coule of releases like:

[env:piostable]
platform = https://github.com/pioarduino/platform-espressif32/releases/download/stable/platform-espressif32.zip

[env:pio321]
platform = https://github.com/pioarduino/platform-espressif32/releases/download/54.03.21-2/platform-espressif32.zip

The system will download and install what it needs for [env:piostable] and then download and install what it needs for [env:pio321].

If you then repeat the same Build, it will download & install again everything it just did for [env:piostable] and then once more download and install what it just did for [env:pio321].

Likewise adding a new platform = to the platform.ini will cause a bunch of background downloads upon saving the file.

Long way of asking, shouldn't things be cached in the appropriate platforms folder, i.e.: ~/.platformio/platforms/espressif32@src-88f34194123b4b05ff6ef6b8e68c7f60 or somewhere to speed things up and prevent reinstalling?

  1. Ah, I think this is what you found and fixed today, but here it is anyway...
    When creating a New Project, the platform defaults to platform = espressif32. Possible to change that to platform = https://github.com/pioarduino/platform-espressif32/releases/download/stable/platform-espressif32.zip? I didn't try it this time round but earlier in the week, using espressif32 really messed up the install. Not sure what would happen if you opened an old project with that in the environment. I wasn't feeling brave enough to try today.

Release 54.03.21 is out of support. It compiles successfully. The errors are from not needed tools / checks. Use latest release to have a compile without warnings. I do no backports.
using extends across different Platforms is not possible. Every release is a new Platform!
It is like you extend from atmel Platform to espressif Platform. A Platform is a closed system (island)

Long way of asking, shouldn't things be cached in the appropriate platforms folder, i.e.: ~/.platformio/platforms/espressif32@src-88f34194123b4b05ff6ef6b8e68c7f60 or somewhere to speed things up and prevent reinstalling?

No, pioarduino stores all tools, toolchains in folder dist.
pioarduino =! Platformio
pioarduino does not use anything from Platformio registry (if this happens for something, it is a bug) So the registry rename packages way is not there. Glad i could remove this. It was buggy as hell and the reason for the need to delete the .platformio folder when often changing Platform versions.
pioarduino takes care to have a clean setup.

Your point 2) is fixed. Please post only if you tested. I wrote before it is changed.

@Jason2866 Leaving a footnote here for posterity and should someone else need to see it...

I took another step back to try and understand causes of the issues I've was having. Long story short, over the years, turns out the system $PATH was in a state of complete disarray. One of the consequences was a very detrimental effect it was having as well on the system Python environment. Since setting those two things right, there have been no issues with pioarduino.

Thanks agin for your efforts and patience Jason.