IMPORTANT: You must be part of the Matter Private Beta Program to start developing Matter devices and apps in the Google Home Developer Console. Apply now

Espressif

ESP32

This Matter-compliant example functions as a light bulb device type, with on/off capabilities.

Initial setup

  1. Clone the Espressif ESP-IDF and checkout the v4.4.1 tag:
    mkdir ${HOME}/tools
    cd ${HOME}/tools
    git clone https://github.com/espressif/esp-idf.git
    cd esp-idf
    git checkout v4.4.1
    git submodule update --init
    export IDF_PATH=${HOME}/tools/esp-idf
    ./install.sh
  2. Clone and initialize the connectedhomeip repo and example:
    git clone https://github.com/project-chip/connectedhomeip.git
    cd connectedhomeip
    git fetch origin interop_testing_te9
    git checkout FETCH_HEAD
    git submodule update --init --recursive
    source ./scripts/activate.sh
    cd examples/all-clusters-app/esp32
    source ${IDF_PATH}/export.sh
    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: chsh -s /bin/zsh.
  3. To set IDF target, run set-target based on your board:
    idf.py set-target esp32
  4. Update the example settings:
    idf.py menuconfig
    1. Set Demo -> Device Type to your board

Build the image and flash the board

  1. Build the Matter example:
    idf.py build
  2. Connect your device via USB. Then run the following command to flash the demo application onto the device:
    idf.py -p /dev/ttyUSB0 flash
    If necessary, replace /dev/ttyUSB0 (Linux) with the correct USB device name for your system (such as /dev/tty.SLAB_USBtoUART or /dev/tty.usbserial on MacOS).
  3. 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

  4. 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.