Skip to main content

Announcing Matter (previously ‘CHIP’) on ESP32

·3 mins·
release v4.3 Esp32 IoT Matter
Table of Contents

Introduction
#

Matter, previously project CHIP, is the new foundation for connected things. Guided by the Connectivity Standards Alliance, and developed through collaboration amongst all the leaders of the IoT industry, Matter focuses on building connected devices that are secure, reliable, and importantly, seamless to use.

Espressif has been a part of the Matter initiative since early days, and we have been focusing on making it easy to develop and use Matter with Espressif’s line of SoCs. In this article, we will discuss the steps to get your first Matter application up and running on an ESP32. In upcoming articles, we will discuss various technical details of Matter and explore ways to quickly build Matter certified devices on Espressif platforms.

Architecture
#

As illustrated above, Matter defines the application layer that will be deployed on devices and controllers as well as supported IPv6-based networks to help achieve the interoperability goals. Matter will initially support Wi-Fi and Thread for core communications and Bluetooth Low Energy (BLE) to simplify device commissioning and setup.

Matter on ESP32
#

Matter SDK
#

The Matter SDK is an open source repository for the implementation of the specification and continues to be under active development. ESP32 has been a supported platform in the Matter SDK since the very beginning. At present, it is the only platform that offers support of both Wi-Fi as well as BLE. ESP32 supports commissioning (initial device configuration) over BLE as well as Wi-Fi SoftAP; and supports operational communication over Wi-Fi.

Sample Examples
#

You could try either of the following examples:

Either of these examples can be tested against a Matter controller. The Matter SDK provides reference implementation of controllers:

Getting Started
#

Let’s look at the steps to try the above examples on ESP32.

We use Espressif IoT Development Framework (ESP-IDF) release v4.3 to try this out.

Build the Python Controller
#

$ cd /path/to/connectedhomeip$ ./scripts/build_python.sh -m platform
  • Execute the controller and establish a secure session over BLE. BLE is the default mode in the application and is configurable through menuconfig.
$ source ./out/python_env/bin/activate$ chip-device-ctrlchip-device-ctrl > ble-scanchip-device-ctrl > connect -ble 3840 20202021 135246

Parameters:

  • Add credentials of the Wi-Fi network you want the ESP32 to connect to, using the AddWiFiNetwork command and then enable the ESP32 to connect to it using EnableWiFiNetwork command. In this example, we have used TESTSSID and TESTPASSWD as the SSID and passphrase respectively.
chip-device-ctrl > zcl NetworkCommissioning __AddWiFiNetwork__  135246 0 0 ssid=str:__TESTSSID__  credentials=str:__TESTPASSWD__  breadcrumb=0 timeoutMs=1000chip-device-ctrl > zcl NetworkCommissioning __EnableNetwork__  135246 0 0 networkID=str:__TESTSSID__  breadcrumb=0 timeoutMs=1000
  • Close the BLE connection to ESP32, as it is not required hereafter.
chip-device-ctrl > close-ble
  • Resolve DNS-SD name and update address of the node in the device controller.
chip-device-ctrl > resolve 135246
  • 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.
chip-device-ctrl > zcl OnOff Off 135246 1 0

Note: All the above commands have help associated with them that can assist with the parameters.

The above commands help you try the common functionality that is exposed by Matter on the ESP32.

ESP32-C3 Support
#

ESP32-C3 support is integrated in Matter. Please follow the READMEs to run the examples on ESP32-C3

Stay tuned for more updates on Matter and ESP32. Happy hacking!

Related

How to use custom partition tables on ESP32
·14 mins
Espressif Esp32 IoT ESP-IDF
Introduction # When we create a new project using ESP32 , sometimes we need to store data in the flash to persist even after a restart or power down.
Preview Release: NimBLE support in ESP-IDF
·1 min
Bluetooth Esp32 IoT
ESP-IDF now supports Apache Mynewt NimBLE host stack which is ported for the ESP32 platform and FreeRTOS.
Embedding Voice into Devices with ESP32
·1 min
Esp32 Dialogflow IoT
ESP32 already supported being a fully functional Alexa client, a voice assistant. ESP32 now also supports Dialogflow, a voice-enabled conversational interface from Google.