This project is an ESP-IDF 5.5.2 + ESP-Matter template for Seeed Studio XIAO ESP32C6 that:
- boots as a Matter accessory,
- advertises for commissioning over BLE,
- can be commissioned by a phone,
- joins an existing Thread network as an FTD (Full Thread Device),
- is intended to run from normal USB power.
Follow Seeed's setup flow first (toolchain + ESP-IDF + Matter environment): https://wiki.seeedstudio.com/xiao_esp32_matter_env/
Then ensure:
- ESP-IDF checked out at
v5.5.2 idf.py --versionreports 5.5.2- Python environment has
esp-matterdependencies via component manager
- Install the Espressif IDF extension in VS Code.
File -> Open Folderon this repo.- Set target:
ESP32-C6. - Ensure the extension uses your ESP-IDF 5.5.2 environment.
idf.py set-target esp32c6
idf.py menuconfigOptional rename before first commissioning:
Component config -> Matter device options -> Default Matter Node Label- default is
XIAO-ESP32C6
This NodeLabel is the friendly device name commissioners usually show. You can also rename later from most Matter controller apps.
idf.py build
idf.py -p /dev/ttyACM0 flash monitor(Use the correct serial port for your machine.)
The ESP32-C6 does not invent a Thread network by itself in this app. A commissioner (phone app or chip-tool) must provide Thread credentials from an existing Thread Border Router network.
Use Apple Home / Google Home / SmartThings (or another Matter commissioner) on a phone that is already in the same home/fabric with a Thread Border Router.
- Flash and reboot the device.
- In monitor logs, find the Matter onboarding payload (QR/manual pairing code).
- In your phone app, choose Add Matter Device and scan/enter that code.
- Keep phone BLE enabled and near the board during setup.
- The app commissions over BLE, sends operational credentials + Thread dataset.
- Device attaches to Thread and appears in the app.
If this succeeds, your code is fine; the network join is driven by the commissioner.
If you want explicit CLI control, use chip-tool from a machine that has access to your Matter fabric.
- Put device in commissioning mode (fresh flash usually does this automatically).
- Use the setup payload code from serial logs.
- Commission to your fabric using BLE rendezvous:
chip-tool pairing ble-thread <node-id> hex:<THREAD_ACTIVE_DATASET_HEX> <setup-pin-code> <discriminator>Where:
<THREAD_ACTIVE_DATASET_HEX>comes from your border router network,<setup-pin-code>and<discriminator>come from the device onboarding payload/logs.
After successful pairing, verify with:
chip-tool descriptor read device-type-list <node-id> 0
chip-tool onoff read on-off <node-id> 1- Uses an On/Off Light endpoint as a simple Matter device type for bring-up.
- Thread is configured as FTD in
sdkconfig.defaults. - USB power only: no battery-centric power management enabled.
- If pairing repeatedly fails, erase and retry:
idf.py erase-flash flash monitor
- Ensure your phone commissioner can access both BLE and the target Matter fabric.
- Ensure your Thread Border Router is online and already part of that same home ecosystem.
- If using
chip-tool, make sure the active dataset is valid and from the exact Thread network you expect. - If discovery works but join fails, monitor logs for commissioning timeout/invalid setup code errors.
If VS Code fails during idf.py set-target esp32c6 with a path like:
...\Espressif\ComponentManager\Cache\...\connectedhomeip...\BooleanStateConfigurationTestEventTriggerHandler.cpp
this is almost always a Windows long-path limitation during Component Manager unzip.
-
Enable Win32 long paths (required):
gpedit.msc->Computer Configuration -> Administrative Templates -> System -> Filesystem -> Enable Win32 long paths = Enabled- or registry (
Run as Administrator):
reg add HKLM\SYSTEM\CurrentControlSet\Control\FileSystem /v LongPathsEnabled /t REG_DWORD /d 1 /f
-
Reboot Windows.
-
Use short working paths (recommended):
- move project to something short like
C:\ws\thread - keep ESP-IDF at short path like
C:\esp\v5.5.2\esp-idf
- move project to something short like
-
Clear partially-downloaded component cache and retry:
rmdir /s /q %LOCALAPPDATA%\Espressif\ComponentManager\Cache
-
Reopen VS Code from ESP-IDF PowerShell and run again:
idf.py fullclean idf.py set-target esp32c6 idf.py build
esp_matter contains nested connectedhomeip paths with long filenames. If Windows long paths are disabled (or not yet applied after enabling), Python unzip fails with exactly the FileNotFoundError you posted.
If your build fails in managed_components/espressif__esp_matter/connectedhomeip/... with errors like:
to_underlying was not declared in this scopechip::to_underlying is not a member of chipNullable.h ... no match for operator==inclosure-control-cluster-logic.cpp
this is typically a toolchain language-mode mismatch between ESP GCC 14 and the pulled CHIP revision.
- Pins
esp_matterto==1.4.2~1. - Forces global C++ standard to GNU++20 (
CMAKE_CXX_STANDARD 20) to avoid problematic C++23 behavior while preserving modern CHIP requirements.
Run in ESP-IDF shell:
idf.py fullclean
rm -rf managed_components build dependencies.lock
idf.py reconfigure
idf.py set-target esp32c6
idf.py buildOn Windows PowerShell:
idf.py fullclean
Remove-Item -Recurse -Force managed_components,build,dependencies.lock
idf.py reconfigure
idf.py set-target esp32c6
idf.py build- Make sure VS Code is using the ESP-IDF 5.5.2 managed toolchain profile (not a newer preview/custom toolchain).
- Delete
%LOCALAPPDATA%\Espressif\ComponentManager\Cacheand rebuild once. - Keep project path short (for example
C:\ws\thread).