ESP-IDF Matter in PlatformIO


I’ve working on a ESP32 project that will use Matter as the communication protocol based on this project. I’ve been implementing in ESP-IDF but would like to implement in PlatformIO. Is there the ability to transfer over an organic ESP-IDF project into PlatformIO? Is there some steps I can read/follow which can help?


The official espressif32 examples have a lot of ESP-IDF examples that are organic ESP-IDF projects. Also see docs and docs.

Thanks for the information. I spent yesterday working through the CMakeLists and linking all of the different core connecthomeip directories. Most of the transferred build now seems to be working, but I keep running into the following error.

CMake Error at third_party/connectedhomeip/config/esp32/components/chip/CMakeLists.txt:204 (message):
  The 'gn' command was not found.  Make sure you have GN installed.Or have
  followed necessary build preparations stated in

The associated lines of that error are:

# CHIP build as an external project.
find_program(GN_EXECUTABLE gn)
    message(FATAL_ERROR "The 'gn' command was not found. Make sure you have GN installed."
                        "Or have followed necessary build preparations stated in")

Do you know if the GN build system is an option with PlatformIO? Or maybe a way I could point to the installation that I completed in the Build Matter

Do you have the program installed globally? Then it should also be available to PIO.

I think so, I tried installing globally as well as right at the PlatformIO project structure. Both times the same error came up.

Is gn available in the PIO CLI? And in regular Windows+R → cmd.exe?

No it isn’t, but I’m running on MAC. GN returns $ gn -bash: gn: command not found In PIO CLI it isn’t either as far as I can tell. `Usage: pio [OPTIONS] COMMAND [ARGS]…

–version Show the version and exit.
-c, --caller TEXT Caller ID (service)
–no-ansi Do not print ANSI control characters
-h, --help Show this message and exit.

access Manage resource access
account Manage PlatformIO account
boards Board Explorer
check Static Code Analysis
ci Continuous Integration
debug Unified Debugger
device Device manager & Serial/Socket monitor
home GUI to manage PlatformIO
org Manage organizations
pkg Unified Package Manager
project Project Manager
remote Remote Development
run Run project targets (build, upload, clean, etc.)
settings Manage system settings
system Miscellaneous system commands
team Manage organization teams
test Unit Testing
upgrade Upgrade PlatformIO Core to the latest version`

I’m pretty new at PlatformIO, so I could easily be missing something simple.