ESP-Matter SDK

repository·main·Indexed 21 days ago

https://github.com/espressif/esp-matter

A specialized framework for developing Matter-compliant applications on ESP32 series SoCs. Built on the open-source Matter SDK, it provides high-level APIs and production-ready tools, including an OTA Provider for firmware updates, diagnostic tracing via BDX protocol, and support for OpenThread Border Router (OTBR) and BLE Mesh bridging.

Tokens
66.6K
Snippets
177
Records
277
Agent score
77%

What's inside esp-matter

  1. Overview of Espressif's SDK for Matter

    main

    Espressif's SDK for Matter is the official development framework for building Matter-enabled products on ESP32 series SoCs. It is built on top of the open-source Matter SDK (connectedhomeip) and provides:

    • Simplified APIs for Matter development.
    • Support for commonly used peripherals.
    • Tools and utilities for security, manufacturing, and production.
    • Rich production references to accelerate time-to-market.

    For a list of supported device types, see SUPPORTED_DEVICE_TYPES.md in the repository.

  2. Overview of the Optional Attributes Test Application

    main

    The Optional Attributes Test Application creates a Matter node on endpoint 0 that demonstrates the use of optional attributes across various clusters. It is designed to act as the device-side companion for the optional attributes test framework.

    Key Features:

    • Root Node: Creates a Matter Root Node on endpoint 0.
    • Attribute Enhancement: Adds optional attributes to existing clusters like Basic Information and General Diagnostics.
    • Additional Clusters: Implements several clusters with optional attributes enabled, including:
      • Boolean State Configuration
      • Electrical Energy Measurement
      • Electrical Power Measurement
      • Ethernet Network Diagnostics
      • Occupancy Sensing
      • HEPA Filter Monitoring
      • Software Diagnostics
      • Time Synchronization
      • WiFi Network Diagnostics
    • Diagnostics: Enables the Matter console shell for attribute inspection and diagnostics.
  3. Overview of ESP-NOW Matter Bridge Light

    main

    The ESP-NOW Matter Bridge Light example demonstrates how to bridge an ESP-NOW switch device to a Matter fabric. It functions as a responder in the ESP-NOW protocol (where the switch is the initiator) and acts as a Matter device.

    Matter Data Model Behavior:

    • Creates a Color Temperature Light device.
    • Creates an Aggregator device.
    • Dynamic Behavior: When bound to an ESP-NOW switch, it dynamically creates an OnOff Switch device (acting like a normal Matter switch). When unbound, this dynamic switch device is removed.

    Developer Tip: You can use the create_bridge_devices callback to add custom data model elements, such as specific attributes or commands, to the bridge endpoint.

  4. Overview of the Espressif Digital Badge

    main

    The Espressif Digital Badge is an intelligent e-ink display name badge designed for ESP32-based targets. It integrates a vCard QR code for contact information sharing and uses a custom Matter cluster to allow users to personalize attributes like Name, Company, and Email via any Matter-enabled application.

    Key Hardware Requirements:

    Core Functionality:

    • vCard QR Code: Generates and displays a QR code containing user attributes.
    • Commissioning Mode: Displays a commissioning QR code and manual pairing code if uncommissioned.
    • Fallback Mode: If no custom attributes are configured, the badge functions as a standard Matter on/off light.
    • NodeLabel Trick: Setting the NodeLabel in the format "{Name}/{Company Name}" allows setting these specific attributes.
  5. Overview of Espressif Matter Solutions

    main

    Espressif's Matter ecosystem is composed of hardware platforms, a production-ready SDK, and cloud integration.

    Hardware Platforms

    • Matter Wi-Fi devices: Built using Wi-Fi-enabled SoCs/modules like the ESP32, ESP32-C, and ESP32-S series.
    • Matter Thread devices: Built using SoCs/modules with 802.15.4 support, such as the ESP32-H series, ESP32-C5, and ESP32-C6.
    • Thread Border Router: Combines ESP32-H and Wi-Fi SoCs to connect Thread networks to Wi-Fi networks. Supports Thread 1.3 features.
    • Matter-Zigbee Bridge: Uses an ESP32-H and a Wi-Fi SoC to bridge Zigbee devices to Matter.
    • Matter-BLE Mesh Bridge: Uses a single SoC with both Wi-Fi and Bluetooth LE interfaces to bridge BLE Mesh devices to Matter.

    Software and Cloud

    • SDK: Built on top of the connectedhomeip (Matter) open-source SDK. It provides simplified APIs, peripheral support, and tools for security and manufacturing.
    • Cloud Integration: Integrates with ESP RainMaker for remote control and cloud-based device management, and ESP Insights for remote diagnostics.
  6. Use the esp_matter_controller component

    main
    The esp_matter_controller component allows you to build Matter controllers and commissioners on Espressif SoCs. This component enables a device to manage a Matter Fabric, including commissioning new devices (commissionees) and interacting with them.
  7. Use the BLE Mesh Bridge to bridge BLE Mesh devices to Matter

    main

    The BLE Mesh Bridge example allows you to bridge BLE Mesh devices into a Matter fabric. This enables Matter controllers (like chip-tool) to interact with BLE Mesh nodes as if they were native Matter devices.

    Key Implementation Detail: You can use the create_bridge_devices callback in your code to add custom data model elements, such as specific attributes or commands, to the bridge endpoint.

  8. Choose between Standalone and Split Mode for ESP Matter Camera

    main

    The ESP Matter Camera examples are provided in two distinct architectural modes depending on your deployment needs:

    1. Standalone Mode

    In this mode, a single device handles the complete WebRTC implementation, including signaling, media streaming, and audio/video capture.

    • Use Case: Single device deployment, direct camera streaming, and faster Peer connection setup.
    • Supported Hardware: ESP32-P4 (supports FHD live streaming).

    2. Split Mode

    This mode uses a distributed architecture where responsibilities are divided between two devices connected via SDIO.

    • Architecture: One device handles Signaling (ESP Matter Camera), while a separate MCU handles Media Streaming.
    • Use Case: Distributed architectures, power-optimized deployments, or when manufacturers need to swap streaming implementations quickly.
    • Supported Hardware: ESP32-C6 (Signaling/Matter) and ESP32-P4 (Streaming/Capture).
  9. Define a Matter Data Model

    main

    A Matter device is represented by its data model, which consists of a Node, Endpoints, Clusters, Attributes, and Commands.

    1. Create a Node: The root of the data model. Use node::create().
    2. Create Endpoints: Endpoints represent functional parts of the device (e.g., a lightbulb or a fan). Use device_type::create().
    3. Add Clusters: Clusters group related attributes and commands. Use cluster_type::create() on an endpoint.
    4. Add Attributes/Commands: Further customize clusters with specific attributes or commands.

    Standard device types (like color_temperature_light) are available in the esp_matter_endpoint.h header.

    // 1. Create a Matter node
    node::config_t node_config;
    node_t *node = node::create(&node_config, app_attribute_update_cb, app_identification_cb, NULL);
    
    // 2. Create an endpoint using a standard device type
    color_temperature_light::config_t light_config;
    light_config.on_off.on_off = DEFAULT_POWER;
    light_config.level_control.current_level = DEFAULT_BRIGHTNESS;
    endpoint_t *endpoint = color_temperature_light::create(node, &light_config, ENDPOINT_FLAG_NONE, NULL);
  10. Custom Matter Cluster for the Digital Badge

    main

    The badge implements a custom cluster with cluster_id: 0x131BFC03 within the Root Node. This cluster manages five distinct attributes, each with a maximum size of 32 bytes.

    PropertyAttribute IdMax Length
    Name0x000032 bytes
    Company Name0x000132 bytes
    Email0x000232 bytes
    Contact0x000332 bytes
    Event Name0x000432 bytes

    Additionally, the cluster includes a command at ID 0x0000 designed to update all five attributes simultaneously in a single operation.

  11. Understand Matter Zigbee Light operating modes

    main

    The Matter Zigbee Light example demonstrates a single SoC running both Matter-over-Thread and Zigbee using a single 802.15.4 radio. Because they share the radio, only one stack can be active at a time. The device transitions between three modes:

    1. Dual commissioning: Occurs on first boot or after a factory reset. Both the Matter commissioning window is open and the Zigbee stack is running (network steering is active).
    2. Zigbee mode: Occurs if the device joins a Zigbee network without a Matter commissioning session. The Matter commissioning window closes, and the device reboots into a state where only the Zigbee stack runs.
    3. Matter mode: Occurs if a Matter commissioning session starts. The Zigbee stack stops, the Thread stack starts, and the device reboots into a state where only Matter/Thread is operational.
    ModeWhenMatterZigbee
    Dual commissioningFirst boot; after factory resetCommissioning window openStack running, network steering
    Zigbee modeZigbee joined, no Matter fabricCommissioning window closedStack running
    Matter modeMatter fabric storedOperational over ThreadStack stopped