How to Connect ESP32-C6 to the Matter Network

0 4384 Medium


Matter is an open, cross-platform Internet of Things (IoT) connectivity standard and protocol designed to address interoperability and compatibility issues among smart home devices. It has garnered support from leading tech companies such as Google, Apple, Amazon, Microsoft, and more.ESP32-C6 is a chip developed by Espressif Systems that supports WiFi 6, Bluetooth 5 (LE), Zigbee, and Thread protocols. With its low power consumption and cost-effectiveness, it is well suited for use in Matter devices. In this guide, we will use the FireBeetle ESP32-C6 to create a smart light bulb and integrate it into a Matter network.

By following this guide, you will learn the following:
● The advantages and network framework of Matter
● How to set up ESP-IDF and ESP-Matter environment on Ubuntu 20
● How to flash the code onto ESP32-C6
● How to add ESP32-C6 to the Matter network
● How to test and control ESP32-C6


Part 1: Advantages and Network Architecture of Matter

External Gateway

Currently, some smart device manufacturers adopt cloud-based solutions requiring all devices to communicate with a cloud server. The information transmission path is as follows: pressing a switch - router forwards the information to the cloud server - cloud server processes and distributes the information - router forwards the information to the light bulb - light bulb illuminates. This approach has some drawbacks, such as long data transmission times and high dependency on the external network. Without an external network, all smart controls become ineffective.


Local Gateway

To address the issues with external gateways, smart device manufacturers have developed local gateways that allow control information to reach the corresponding devices without passing through an external network. This improves stability and enhances privacy and security. The information transmission path is as follows: pressing a switch - local gateway processes and distributes the information - light bulb illuminates. However, due to differences in protocols among major manufacturers, it results in fragmentation of smart home devices, limiting the compatibility to devices within the same ecosystem.


Matter Gateway

Matter's network architecture is similar to local gateways but solves the problem of device fragmentation. Any device supporting the Matter protocol can be connected, eliminating the distinction between device manufacturers.



Part 2: Environment Setup

Use Hardware

● FireBeetle ESP32-C6 *1
● WS2812 LED *1

Connect the WS2812 LED to IO8 of the FireBeetle ESP32-C6.


FireBeetle ESP32-C6 Hardware Resources:

Environment Setup

● The operating system used is Ubuntu 20 (used as the Matter gateway responsible for receiving and distributing Matter data).
● Set up the ESP-IDF development environment, using version 5.1.1.


git clone --recursive

cd esp-idf

git checkout v5.1.1

git submodule update --init --recursive


cd ..


● Set up the ESP-Matter development environment.


git clone --depth 1

cd esp-matter

git submodule update --init --depth 1

cd ./connectedhomeip/connectedhomeip

./scripts/ --platform esp32 linux --shallow

cd ../..


cd ..


● During the installation process, you will see the following print messages.



● After successful installation, you will see the following information.



● Configure the environment variables for IDF by navigating to the IDF directory.


cd esp-idf

source ./


● Configure the environment variables for Matter by navigating to the Matter directory.


cd esp-matter

source ./


● Enable IDF build with Ccache to increase build speed.




Part 3: Flashing the Sample Code


● Navigate to the light example in esp-matter, compile, and flash the program.


cd esp-matter/example/light/ set-target esp32c6 flash


● If you encounter permission issues that prevent accessing the serial port and flashing, modify its permissions  first, and then continue with the flashing process.


sudo chmod 666 /dev/ttyACM0 flash


● Once flashing is complete, open the serial port of ESP32-C6, and you will see the following print messages.



● Use the serial port to send Matter commands to configure ESP32-C6 and connect it to Wi-Fi (fill in the Wi-Fi SSID and password).


matter esp wifi connet your-ssid your-password



Part 4: Connecting to the Matter Network


● Switch back to the Linux environment and use chip-tool to pair with ESP32-C6, ensuring that both the Linux environment and ESP32-C6 are on the same local network.


chip-tool pairing onnetwork-long 0x12 20202021 3840

#Here, "0x12" is a custom ID for the C6 node.


● After running the above command in Linux, you will see successful pairing debug information on the C6 serial port.



Part 5: Demonstrating the Results


● Use chip-tool on Linux to control ESP32-C6. After executing the commands, you will see corresponding debug information and the WS2812 LED's state changes on the C6 serial port.


chip-tool onoff on 0x12 0x1

chip-tool onoff off 0x12 0x1

#These two commands complete the control of the light






For those who are not familiar with Linux, you may encounter some issues during the construction process. However, problem-solving is part of the learning process.It is recommended to utilize search engines to find the causes of any issues. Feel free to interact and share your questions and ideas in the comments section.

All Rights