ESP32
This Matter-enabled example functions as a light bulb device type, with on/off capabilities.
Initial setup
- Clone the Espressif ESP-IDF and check out the v4.4.2 tag:
mkdir ${HOME}/tools
cd ${HOME}/tools
git clone https://github.com/espressif/esp-idf.git
cd esp-idf
git checkout v4.4.2
git submodule update --init
export IDF_PATH=${HOME}/tools/esp-idf
./install.sh
- Clone and initialize the
connectedhomeip
repo:git clone https://github.com/project-chip/connectedhomeip.git
cd connectedhomeip
git fetch origin v1.0-branch
git checkout FETCH_HEAD
git submodule update --init --recursive
source ./scripts/activate.sh
- Initialize the example:
For MacOS users, if you see an error about the Bash version at this step, it might be because the pre-installed Bash is too old. You may resolve this issue by switching to zsh:cd examples/all-clusters-app/esp32
source ${IDF_PATH}/export.sh
chsh -s /bin/zsh
. - To set IDF target, run
set-target
based on your board:idf.py set-target esp32
- Update the example settings:
idf.py menuconfig
- Set Demo -> Device Type to your board
Build the image and flash the board
- Build the Matter example:
idf.py build
- Connect your device via USB. Then run the following command to flash the
demo application onto the device:
If necessary, replaceidf.py -p /dev/ttyUSB0 flash
/dev/ttyUSB0
(Linux) with the correct USB device name for your system (such as/dev/tty.SLAB_USBtoUART
or/dev/tty.usbserial
on MacOS). The serial console for the device is available as a USB tty device on your Linux host. It is typically named
/dev/ttyUSB0
, but may be/dev/ttyUSB1
or higher if you already have other USB serial devices plugged in. The ESP32 WROVER kit exposes two USB tty devices, and it will be the second one that shows device logs.To connect to the serial terminal, use a tool like
screen
,minicom
, or your preferred serial terminal program. For example, if the device is at/dev/ttyUSB0
:screen /dev/ttyUSB0 115200
The network configuration persists on the device once commissioning is completed. To erase it, simply run:
idf.py -p /dev/ttyUSB0 erase-flash
Next steps
When your Matter example has been successfully built, create a developer project.