Matter ESP32 Lighting Example#

This example demonstrates the Matter Lighting application on ESP platforms.

Please setup ESP-IDF and CHIP Environment and refer building and commissioning guides to get started.

Building example for Target ESP32-C6#

ESP32-C6 supports both Wi-Fi and Thread transport protocols.

  • To build for Matter Over Wi-Fi

    idf.py set-target esp32c6 build
    
  • To build for Matter Over Thread, use custom configuration file

    idf.py -DSDKCONFIG_DEFAULTS="sdkconfig.defaults;sdkconfig.defaults.esp32c6_thread" set-target esp32c6 build
    

Memory-optimized build#

sdkconfig.optimized is an optional overlay that increases heap headroom by trading WiFi throughput and the debug shell. Use it on RAM-constrained SoCs (e.g. ESP32-C3), where concurrent BLE + WiFi + CASE crypto during commissioning can otherwise run out of internal RAM:

idf.py -D SDKCONFIG_DEFAULTS="sdkconfig.defaults;sdkconfig.optimized" set-target esp32c3 build

On ESP32-C3 this frees roughly 30 kB of static RAM (mostly code moved from IRAM to flash) plus runtime savings from smaller WiFi buffer pools.

Enabling ESP-Insights:#

  • Before building the app, enable the options: ESP_INSIGHTS_ENABLED and CHIP_ENABLE_ESP_DIAGNOSTICS through menuconfig.

  • Create a file named insights_auth_key.txt in the main directory of the example.

  • Follow the steps present here to set up an insights_account and the auth key created while setting it up will be used in the example.

  • Download the auth key and copy Auth Key to the example

cp /path/to/auth/key.txt path/to/connectedhomeip/examples/lighting-app/esp32/main/insights_auth_key.txt

Cluster Control#

  • After successful commissioning, use the OnOff cluster command to control the OnOff attribute. This allows you to toggle a parameter implemented by the device to be On or Off.

    $ ./out/debug/chip-tool onoff on <NODE ID> 1
    
  • On ESP32C3-DevKitM or ESP32S3-DevKitM board, there is an on-board RGB-LED. Use ColorControl cluster command to control the color attributes:

    $ ./out/debug/chip-tool colorcontrol move-to-hue-and-saturation 240 100 0 0 0 <NODE ID> 1
    

Matter OTA#

For Matter OTA please take a look at Matter OTA guide.