mirror of
https://github.com/espressif/esp-matter.git
synced 2026-04-27 19:13:13 +00:00
Merge branch 'example/managed_component_light' into 'main'
add light example with managed component See merge request app-frameworks/esp-matter!669
This commit is contained in:
+126
-80
@@ -4,11 +4,10 @@
|
||||
Please refer the :project_file:`Release Notes <RELEASE_NOTES.md>` to know more about
|
||||
the releases
|
||||
|
||||
2.1 Development Setup
|
||||
2.1 ESP-IDF Setup
|
||||
---------------------
|
||||
|
||||
This section talks about setting up your development host, fetching the
|
||||
Git repositories, and instructions to build and flash.
|
||||
This section talks about setting up ESP-IDF.
|
||||
|
||||
2.1.1 Host Setup
|
||||
~~~~~~~~~~~~~~~~
|
||||
@@ -46,20 +45,17 @@ For using VSCode for development, please check `Developing in WSL <https://code.
|
||||
|
||||
Using CHIP-tool in WSL <using_chip_tool>
|
||||
|
||||
2.1.2 Getting the Repositories
|
||||
2.1.2 Getting the Repository
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Before cloning the repositories please confirm that the following Prerequisites are fulfilled.
|
||||
|
||||
The Prerequisites for ESP-IDF and Matter:
|
||||
The Prerequisites for ESP-IDF:
|
||||
|
||||
- Please get the `Prerequisites for ESP-IDF`_. For beginners, please check `step by step installation guide`_ for esp-idf.
|
||||
- Please get the `Prerequisites for Matter`_.
|
||||
|
||||
.. note::
|
||||
|
||||
``git clone`` command accepts the optional argument ``--jobs N``, which can significantly speed up the
|
||||
process by parallelizing submodule cloning. Consider using this option when cloning repositories.
|
||||
It is also applicable when using ``./scripts/checkout_submodules.py`` to clone Matter submodules.
|
||||
|
||||
Cloning esp-idf:
|
||||
|
||||
@@ -70,6 +66,35 @@ Cloning esp-idf:
|
||||
./install.sh
|
||||
cd ..
|
||||
|
||||
|
||||
2.1.3 Configuring the Environment
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
This should be done each time a new terminal is opened
|
||||
|
||||
::
|
||||
|
||||
cd esp-idf; source ./export.sh; cd ..
|
||||
|
||||
|
||||
2.2 ESP Matter Setup
|
||||
--------------------
|
||||
|
||||
There are two options to setup esp-matter, you can select one according to demand:
|
||||
|
||||
- ESP matter repository, including esp-matter SDK and tools (e.g., CHIP-tool, CHIP-cert, ZAP, ...).
|
||||
- ESP matter component, including esp-matter SDK.
|
||||
|
||||
2.2.1 ESP-Matter Repository
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
2.2.1.1 Getting the Repository
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
The Prerequisites for Matter:
|
||||
|
||||
- Please get the `Prerequisites for Matter`_.
|
||||
|
||||
Cloning the esp-matter repository takes a while due to a lot of submodules in the upstream connectedhomeip,
|
||||
so if you want to do a shallow clone use the following command:
|
||||
|
||||
@@ -139,8 +164,8 @@ To clone the esp-matter repository with all the submodules, use the following co
|
||||
It's probably caused by some network connectivity issue, a VPN is required for most of the cases.
|
||||
|
||||
|
||||
2.1.3 Configuring the Environment
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
2.2.1.2 Configuring the Environment
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
This should be done each time a new terminal is opened
|
||||
|
||||
@@ -162,7 +187,27 @@ Ccache caches the previous compilations and speeds up recompilation in subsequen
|
||||
Above can also be added to your shell’s profile file (.profile, .bashrc, .zprofile, etc.)
|
||||
to enable ccache every time you open a new terminal.
|
||||
|
||||
2.1.4 Building Applications
|
||||
2.2.2 ESP Matter Component (experimental)
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
You can check the component in `Espressif Component Registry <https://components.espressif.com/components/espressif/esp_matter>`__.
|
||||
|
||||
To add the esp_matter component to your project, run:
|
||||
|
||||
::
|
||||
|
||||
idf.py add-dependency "espressif/esp_matter^0.0.2"
|
||||
|
||||
An example with esp_matter component is offered:
|
||||
|
||||
- :project_file:`Managed Component Light <examples/managed_component_light/README.md>`
|
||||
|
||||
.. note::
|
||||
|
||||
To use this component, the version of IDF component management should be 1.4.*.
|
||||
Use ``compote version`` to show the version. Use ``pip install 'idf-component-manager~=1.4.0'`` to install.
|
||||
|
||||
2.2.3 Building Applications
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
- :project_file:`Light <examples/light/README.md>`
|
||||
@@ -171,7 +216,7 @@ to enable ccache every time you open a new terminal.
|
||||
- :project_file:`Zigbee Bridge <examples/zigbee_bridge/README.md>`
|
||||
- :project_file:`BLE Mesh Bridge <examples/blemesh_bridge/README.md>`
|
||||
|
||||
2.1.5 Flashing the Firmware
|
||||
2.2.4 Flashing the Firmware
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Choose IDF target.
|
||||
@@ -254,7 +299,8 @@ Choose IDF target.
|
||||
|
||||
pip install -r $IDF_PATH/requirements.txt
|
||||
|
||||
2.2 Commissioning and Control
|
||||
|
||||
2.3 Commissioning and Control
|
||||
-----------------------------
|
||||
|
||||
There are a few implementations of Matter commissioners present in the `connectedhomeip <https://github.com/espressif/connectedhomeip/tree/v1.0.0.2/src/controller#implementations>`__ repository.
|
||||
@@ -263,7 +309,7 @@ CHIP Tool is an example implementation of Matter commissioner and used for devel
|
||||
|
||||
Espressif also has an iOS application, `Espressif-Matter <https://apps.apple.com/in/app/espressif-matter/id1604739172>`__, to commission and control the Matter devices. Please follow `profile installation instructions <https://github.com/espressif/connectedhomeip/blob/v1.0.0.2/docs/guides/darwin.md#profile-installation>`__ in order to use the application. Also, make sure to enable Developer Mode on the iOS.
|
||||
|
||||
2.2.1 Test Setup (CHIP Tool)
|
||||
2.3.1 Test Setup (CHIP Tool)
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
A host-based chip-tool can be used as a commissioner to commission and control a Matter device. During the previous ``install.sh`` step, the ``chip-tool`` is generated under the folder:
|
||||
@@ -272,7 +318,7 @@ A host-based chip-tool can be used as a commissioner to commission and control a
|
||||
|
||||
${ESP_MATTER_PATH}/connectedhomeip/connectedhomeip/out/host
|
||||
|
||||
2.2.1.1 Commissioning
|
||||
2.3.1.1 Commissioning
|
||||
^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Use ``chip-tool`` in interactive mode to commission the device:
|
||||
@@ -381,7 +427,7 @@ If you want to use different values for commissioning the device, please use the
|
||||
to generate the factory partition which has to be flashed on the device.
|
||||
It also generates the new pairing code and QR code image using which you can commission the device.
|
||||
|
||||
2.2.1.2 Post Commissioning Setup
|
||||
2.3.1.2 Post Commissioning Setup
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
The device would need additional configuration depending on the example,
|
||||
@@ -393,7 +439,7 @@ for it to work. Check the "Post Commissioning Setup" section in examples for mor
|
||||
- :project_file:`Zigbee Bridge <examples/zigbee_bridge/README.md>`
|
||||
- :project_file:`BLE Mesh Bridge <examples/blemesh_bridge/README.md>`
|
||||
|
||||
2.2.1.3 Cluster Control
|
||||
2.3.1.3 Cluster Control
|
||||
^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Use the cluster commands to control the attributes.
|
||||
@@ -426,7 +472,7 @@ chip-tool when used in interactive mode uses CASE resumption as against establis
|
||||
|
||||
For more details on chip-tool usage, check https://github.com/espressif/connectedhomeip/tree/v1.0.0.2/examples/chip-tool
|
||||
|
||||
2.3 Device console
|
||||
2.4 Device console
|
||||
------------------
|
||||
|
||||
The console on the device can be used to run commands for testing. It is configurable through menuconfig and enabled by default in the firmware. Here are some useful commands:
|
||||
@@ -499,13 +545,13 @@ Additional Matter specific commands:
|
||||
|
||||
matter esp wifi connect <ssid> <password>
|
||||
|
||||
2.4 Developing your Product
|
||||
2.5 Developing your Product
|
||||
---------------------------
|
||||
|
||||
Understanding the structure before actually modifying and customising
|
||||
the device is helpful.
|
||||
|
||||
2.4.1 Building a Color Temperature Lightbulb
|
||||
2.5.1 Building a Color Temperature Lightbulb
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
A device is represented in Matter in terms of its data model. As a first
|
||||
@@ -515,7 +561,7 @@ can use. Please refer to the
|
||||
`Espressif Matter Blog <https://blog.espressif.com/matter-clusters-attributes-commands-82b8ec1640a0>`__
|
||||
for clarity on the terms like endpoints, clusters, etc. that are used in this section.
|
||||
|
||||
2.4.1.1 Data Model
|
||||
2.5.1.1 Data Model
|
||||
^^^^^^^^^^^^^^^^^^
|
||||
|
||||
- Typically, the data model is defined in the example's *app_main.cpp*.
|
||||
@@ -543,7 +589,7 @@ for clarity on the terms like endpoints, clusters, etc. that are used in this se
|
||||
endpoints can be created on the same node. Check the following
|
||||
sections for more info.
|
||||
|
||||
2.4.1.2 Attribute Callback
|
||||
2.5.1.2 Attribute Callback
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
- Whenever a Matter client makes changes to the device, they end up
|
||||
@@ -571,7 +617,7 @@ for clarity on the terms like endpoints, clusters, etc. that are used in this se
|
||||
return err;
|
||||
}
|
||||
|
||||
2.4.1.3 Device Drivers
|
||||
2.5.1.3 Device Drivers
|
||||
^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
- The drivers, depending on the device, are typically initialized and
|
||||
@@ -631,13 +677,13 @@ for clarity on the terms like endpoints, clusters, etc. that are used in this se
|
||||
}
|
||||
|
||||
|
||||
2.4.2 Defining your own data model
|
||||
2.5.2 Defining your own data model
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
This section demonstrates creating standard endpoints, clusters, attributes,
|
||||
and commands that are defined in the Matter specification
|
||||
|
||||
2.4.2.1 Endpoints
|
||||
2.5.2.1 Endpoints
|
||||
^^^^^^^^^^^^^^^^^
|
||||
|
||||
The device can be customized by editing the endpoint/device_type
|
||||
@@ -688,7 +734,7 @@ creating in the *app_main.cpp* of the example. Examples:
|
||||
Once a ``config_t`` instance has been instantiated, these three values cannot be modified.
|
||||
|
||||
|
||||
2.4.2.2 Clusters
|
||||
2.5.2.2 Clusters
|
||||
^^^^^^^^^^^^^^^^
|
||||
|
||||
Additional clusters can also be added to an endpoint. Examples:
|
||||
@@ -729,7 +775,7 @@ Additional clusters can also be added to an endpoint. Examples:
|
||||
maximum pressure, maximum speed and maximum flow values. If they aren't set, they will be set to null by default.
|
||||
Once a ``config_t`` instance has been instantiated, these three values cannot be modified.
|
||||
|
||||
2.4.2.3 Attributes and Commands
|
||||
2.5.2.3 Attributes and Commands
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Additional attributes and commands can also be added to a cluster.
|
||||
@@ -761,7 +807,7 @@ Examples:
|
||||
|
||||
command_t *command = level_control::command::create_move_to_level(cluster);
|
||||
|
||||
2.4.2.4 Features
|
||||
2.5.2.4 Features
|
||||
^^^^^^^^^^^^^^^^^^
|
||||
Optional features which are applicable to a cluster can also be added.
|
||||
|
||||
@@ -772,14 +818,14 @@ Optional features which are applicable to a cluster can also be added.
|
||||
cluster_t* cluster = cluster::get(endpoint, Descriptor::Id);
|
||||
descriptor::feature::taglist::add(cluster);
|
||||
|
||||
2.4.3 Adding custom data model fields
|
||||
2.5.3 Adding custom data model fields
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
This section demonstrates creating custom endpoints, clusters, attributes,
|
||||
and commands that are not defined in the Matter specification and can be
|
||||
specific to the vendor.
|
||||
|
||||
2.4.3.1 Endpoints
|
||||
2.5.3.1 Endpoints
|
||||
^^^^^^^^^^^^^^^^^
|
||||
|
||||
Non-Standard endpoint can be created, without any clusters.
|
||||
@@ -790,7 +836,7 @@ Non-Standard endpoint can be created, without any clusters.
|
||||
|
||||
endpoint_t *endpoint = endpoint::create(node, ENDPOINT_FLAG_NONE);
|
||||
|
||||
2.4.3.2 Clusters
|
||||
2.5.3.2 Clusters
|
||||
^^^^^^^^^^^^^^^^
|
||||
|
||||
Non-Standard/Custom clusters can also be created:
|
||||
@@ -802,7 +848,7 @@ Non-Standard/Custom clusters can also be created:
|
||||
uint32_t custom_cluster_id = 0x131bfc00;
|
||||
cluster_t *cluster = cluster::create(endpoint, custom_cluster_id, CLUSTER_FLAG_SERVER);
|
||||
|
||||
2.4.3.3 Attributes and Commands
|
||||
2.5.3.3 Attributes and Commands
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Non-Standard/Custom attributes can also be created on any cluster:
|
||||
@@ -829,11 +875,11 @@ Non-Standard/Custom attributes can also be created on any cluster:
|
||||
uint32_t custom_command_id = 0x0;
|
||||
command_t *command = command::create(cluster, custom_command_id, COMMAND_FLAG_ACCEPTED, command_callback);
|
||||
|
||||
2.4.4 Advanced Setup
|
||||
2.5.4 Advanced Setup
|
||||
~~~~~~~~~~~~~~~~~~~~
|
||||
This section explains adding external platforms for Matter. This step is **optional** for most devices. Espressif's SDK for Matter provides support for overriding the default platform layer, so the BLE and Wi-Fi implementations can be customized. Here are the required steps for adding an external platform layer.
|
||||
|
||||
2.4.4.1 Creating the external platform directory
|
||||
2.5.4.1 Creating the external platform directory
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Create a directory ``platform/${NEW_PLATFORM_NAME}`` in your codebase.
|
||||
@@ -844,7 +890,7 @@ as a start. Note that the new platform name should be something other than
|
||||
directory must be under ``platform`` folder to meet the Matter include
|
||||
path conventions.
|
||||
|
||||
2.4.4.2 Modifying the BUILD.gn target
|
||||
2.5.4.2 Modifying the BUILD.gn target
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
There is an example :project_file:`BUILD.gn <examples/common/external_platform/BUILD.gn>` file for
|
||||
@@ -856,7 +902,7 @@ platform in Matter without any modifications.
|
||||
- Multiple build configs must be exported to the build system. See the
|
||||
``buildconfig_header`` section in the file for the required definitions.
|
||||
|
||||
2.4.4.3 Editing Kconfigs
|
||||
2.5.4.3 Editing Kconfigs
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
- Enable ``CONFIG_CHIP_ENABLE_EXTERNAL_PLATFORM``.
|
||||
@@ -877,7 +923,7 @@ platform in Matter without any modifications.
|
||||
- If your external platform does not support the *connectedhomeip/connectedhomeip/src/lib/shell/*
|
||||
provided in the Matter shell library, then disable ``CONFIG_ENABLE_CHIP_SHELL``.
|
||||
|
||||
2.4.4.4 Example Usage
|
||||
2.5.4.4 Example Usage
|
||||
^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
As an example, you can build *light* example on ``ESP32_custom`` platform with following steps:
|
||||
@@ -891,10 +937,10 @@ As an example, you can build *light* example on ``ESP32_custom`` platform with f
|
||||
cp sdkconfig.defaults.ext_plat_ci sdkconfig.defaults
|
||||
idf.py build
|
||||
|
||||
2.5 Factory Data Providers
|
||||
2.6 Factory Data Providers
|
||||
--------------------------
|
||||
|
||||
2.5.1 Providers Introduction
|
||||
2.6.1 Providers Introduction
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
There are four factory data providers, each with its own implementation, that need to be configured. These providers supply the device with necessary factory data, which is then read by the device according to their respective implementations.
|
||||
|
||||
@@ -914,7 +960,7 @@ There are four factory data providers, each with its own implementation, that ne
|
||||
|
||||
This particular provider is responsible for retrieving device information, which includes fixed-labels, user-labels, supported-locales, and supported-calendar-types.
|
||||
|
||||
2.5.2 Configuration Options
|
||||
2.6.2 Configuration Options
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Different implementations of the four providers can be chosen in meuconfig:
|
||||
@@ -956,15 +1002,15 @@ Different implementations of the four providers can be chosen in meuconfig:
|
||||
|
||||
When selecting ``Device Info - Custom``, the device will use custom defined Device Info Provider to obtain the Device Information. ``esp_matter::set_custom_device_info_provider`` should be called before ``esp_matter::start()`` to set the custom provider.
|
||||
|
||||
2.5.3 Custom Providers
|
||||
2.6.3 Custom Providers
|
||||
~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
In order to use custom providers, you need to define implementations of the four base classes of the providers and override the functions within them. And the custom providers should be set before ``esp_matter::start()`` is called.
|
||||
|
||||
2.6 Using esp_secure_cert partition
|
||||
2.7 Using esp_secure_cert partition
|
||||
-----------------------------------
|
||||
|
||||
2.6.1 Configuration Options
|
||||
2.7.1 Configuration Options
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Build the firmware with below configuration options
|
||||
@@ -984,7 +1030,7 @@ Build the firmware with below configuration options
|
||||
CONFIG_FACTORY_DEVICE_INSTANCE_INFO_PROVIDER=y
|
||||
|
||||
|
||||
2.6.2 Certification Declaration
|
||||
2.7.2 Certification Declaration
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
If you do not have an certification declaration file then you can generate the test CD with the help of below mentioned steps.
|
||||
@@ -1010,7 +1056,7 @@ For more info about the arguments, please check `here <https://github.com/espres
|
||||
-O TEST_CD_FFF1_8001.der
|
||||
|
||||
|
||||
2.6.3 Factory Partition
|
||||
2.7.3 Factory Partition
|
||||
~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Factory partition contains basic information like VID, PID, etc, and CD.
|
||||
@@ -1049,7 +1095,7 @@ Factory partition binary will be generated at the below path. Please check for <
|
||||
[2022-12-02 11:18:12,381] [ INFO] - Generated output files at: out/fff1_8001/e17c95e1-521e-4979-b90b-04da648e21bb
|
||||
|
||||
|
||||
2.6.4 Flashing firmware, secure cert and factory partition
|
||||
2.7.4 Flashing firmware, secure cert and factory partition
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Flashing secure cert partition. Please check partition table for ``esp_secure_cert`` partition address.
|
||||
@@ -1077,7 +1123,7 @@ Flash application
|
||||
idf.py flash
|
||||
|
||||
|
||||
2.6.5 Test commissioning using chip-tool
|
||||
2.7.5 Test commissioning using chip-tool
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
If using the DACs signed by custom PAA that is not present in connectedhomeip repository,
|
||||
@@ -1090,7 +1136,7 @@ Run the following command from host to commission the device.
|
||||
./chip-tool pairing ble-wifi 1234 my_SSID my_PASSPHRASE my_PASSCODE my_DISCRIMINATOR --paa-trust-store-path /path/to/PAA-Certificates/
|
||||
|
||||
|
||||
2.7 Matter OTA
|
||||
2.8 Matter OTA
|
||||
--------------
|
||||
|
||||
- Enable the ``CONFIG_ENABLE_OTA_REQUESTOR`` option to enable Matter OTA Requestor functionality.
|
||||
@@ -1098,7 +1144,7 @@ Run the following command from host to commission the device.
|
||||
Please follow the `guide <https://github.com/project-chip/connectedhomeip/blob/master/docs/guides/esp32/ota.md>`__
|
||||
in the connectedhomeip repository for generating a Matter OTA image and performing OTA.
|
||||
|
||||
2.7.1 Encrypted Matter OTA
|
||||
2.8.1 Encrypted Matter OTA
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
The esp-matter SDK supports using a pre-encrypted application image for OTA upgrades.
|
||||
@@ -1129,23 +1175,23 @@ Please follow the steps below to enable and use encrypted application images for
|
||||
file, or reading it from the NVS. We have demonstrated the use of the private key by embedding it as a text file in the
|
||||
light example.
|
||||
|
||||
2.8 Mode Select
|
||||
2.9 Mode Select
|
||||
---------------
|
||||
|
||||
This cluster provides an interface for controlling a characteristic of a device that can be set to one of several predefined values. For example, the light pattern of a disco ball, the mode of a massage chair, or the wash cycle of a laundry machine.
|
||||
|
||||
2.8.1 Attribute Supported Modes
|
||||
2.9.1 Attribute Supported Modes
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
This attribute is the list of supported modes that may be selected for the CurrentMode attribute. Each item in this list represents a unique mode as indicated by the Mode field of the ModeOptionStruct. Each entry in this list SHALL have a unique value for the Mode field.
|
||||
ESP_MATTER uses factory partition to set the values of Supported Modes attribute.
|
||||
|
||||
2.8.2 Generate Factory Partition Using mfg_tool
|
||||
2.9.2 Generate Factory Partition Using mfg_tool
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Use `mfg_tool <https://github.com/espressif/esp-matter/blob/main/tools/mfg_tool/README.md>`__ to generate factory partition of the supported modes attribute.
|
||||
|
||||
2.8.2.1 Usage
|
||||
2.9.2.1 Usage
|
||||
^^^^^^^^^^^^^
|
||||
|
||||
::
|
||||
@@ -1163,7 +1209,7 @@ Use `mfg_tool <https://github.com/espressif/esp-matter/blob/main/tools/mfg_tool/
|
||||
|
||||
--supported-modes mode1/label1/endpointId mode2/label2/endpointId
|
||||
|
||||
2.8.3 Build example
|
||||
2.9.3 Build example
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
For example we want to use mode_select cluster in light example.
|
||||
@@ -1187,8 +1233,8 @@ For example we want to use mode_select cluster in light example.
|
||||
ModeSelect::StaticSupportedModesManager::getStaticSupportedModesManagerInstance().InitEndpointArray(get_count(node));
|
||||
}
|
||||
|
||||
2.9 Matter Controller
|
||||
---------------------
|
||||
2.10 Matter Controller
|
||||
----------------------
|
||||
This section introduces the Matter controller example. Now this example supports the following features of the standard Matter controller:
|
||||
|
||||
- BLE-WiFi pairing
|
||||
@@ -1202,12 +1248,12 @@ This section introduces the Matter controller example. Now this example supports
|
||||
- Subscribe events commands
|
||||
- Group settings command.
|
||||
|
||||
2.9.1 Device console
|
||||
~~~~~~~~~~~~~~~~~~~~
|
||||
2.10.1 Device console
|
||||
~~~~~~~~~~~~~~~~~~~~~
|
||||
Once you have flashed the controller example onto the device, you can use the `device console <./developing.html#device-console>`__ to commission the device and send commands to the end-device. All of the controller commands begin with the prefix ``matter esp controller``.
|
||||
|
||||
2.9.2 Pairing commands
|
||||
~~~~~~~~~~~~~~~~~~~~~~
|
||||
2.10.2 Pairing commands
|
||||
~~~~~~~~~~~~~~~~~~~~~~~
|
||||
The ``pairing`` commands are used for commissioning end-devices and are available when the ``Enable matter commissioner`` option is enabled. Here are three standard pairing methods:
|
||||
|
||||
- Onnetwork pairing. Prior to executing this commissioning method, it is necessary to connect both the controller and the end-device to the same network and ensure that the commissioning window of the end-device is open. To complete this process, you can use the command ``matter esp wifi connect``. After the devices are connected, the pairing process can be initiated.
|
||||
@@ -1231,8 +1277,8 @@ The ``pairing`` commands are used for commissioning end-devices and are availabl
|
||||
matter esp wifi connect <ssid> <password>
|
||||
matter esp controller pairing ble-thread <node_id> <dataset_tlvs> <pincode> <discriminator>
|
||||
|
||||
2.9.3 Cluster commands
|
||||
~~~~~~~~~~~~~~~~~~~~~~
|
||||
2.10.3 Cluster commands
|
||||
~~~~~~~~~~~~~~~~~~~~~~~
|
||||
The ``invoke-cmd`` command is used for sending cluster commands to the end-devices. It utilizes a ``cluster_command`` class to establish the sessions and send the command packets. The class constructor function could accept two callback inputs:
|
||||
|
||||
- **Success callback**:
|
||||
@@ -1276,8 +1322,8 @@ Here are some examples of the ``command-data`` format.
|
||||
|
||||
matter esp controller invoke-cmd <node-id> <endpoint-id> 0x4 0 "{\"0:U16\": 1, \"1:STR\": \"grp1\"}"
|
||||
|
||||
2.9.4 Read commands
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
2.10.4 Read commands
|
||||
~~~~~~~~~~~~~~~~~~~~
|
||||
The ``read_command`` class is used for sending read commands to other end-devices. Its constructor function could accept two callback inputs:
|
||||
|
||||
- **Attribute report callback**:
|
||||
@@ -1286,8 +1332,8 @@ The ``read_command`` class is used for sending read commands to other end-device
|
||||
- **Event report callback**:
|
||||
This callback will be called upon the reception of the event report for read-event commands.
|
||||
|
||||
2.9.4.1 Read attribute commands
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
2.10.4.1 Read attribute commands
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
The ``read-attr`` commands are used for sending the commands of reading attributes on end-devices.
|
||||
|
||||
- Send the read-attribute command:
|
||||
@@ -1296,8 +1342,8 @@ The ``read-attr`` commands are used for sending the commands of reading attribut
|
||||
|
||||
matter esp controller read-attr <node-id> <endpoint-id> <cluster-id> <attribute-id>
|
||||
|
||||
2.9.4.2 Read event commands
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
2.10.4.2 Read event commands
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
The ``read-event`` commands are used for sending the commands of reading events on end-devices.
|
||||
|
||||
- Send the read-event command:
|
||||
@@ -1306,8 +1352,8 @@ The ``read-event`` commands are used for sending the commands of reading events
|
||||
|
||||
matter esp controller read-event <node-id> <endpoint-id> <cluster-id> <event-id>
|
||||
|
||||
2.9.5 Write attribute commands
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
2.10.5 Write attribute commands
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
The ``write-attr`` command is used for sending the commands of writing attributes on the end-device.
|
||||
|
||||
- Send the write-attribute command:
|
||||
@@ -1342,8 +1388,8 @@ For ACL attribute of AccessControl cluster, you should use the following JSON st
|
||||
|
||||
matter esp controller write-attr <node_id> <endpoint_id> 31 0 "{\"0:ARR-OBJ\":[{\"1:U8\": 5, \"2:U8\": 2, \"3:ARR-U64\": [112233], \"4:NULL\": null}, {\"1:U8\": 4, \"2:U8\": 3, \"3:ARR-U64\": [1], \"4:NULL\": null}]}"
|
||||
|
||||
2.9.6 Subscribe commands
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
2.10.6 Subscribe commands
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
The ``subscribe_command`` class is used for sending subscribe commands to other end-devices. Its constructor function could accept four callback inputs:
|
||||
|
||||
- **Attribute report callback**:
|
||||
@@ -1358,8 +1404,8 @@ The ``subscribe_command`` class is used for sending subscribe commands to other
|
||||
- **Subscribe failure callback**:
|
||||
This callback will be invoked upon the failure of establishing CASE session.
|
||||
|
||||
2.9.6.1 Subscribe attribute commands
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
2.10.6.1 Subscribe attribute commands
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
The ``subs-attr`` commands are used for sending the commands of subscribing attributes on end-devices.
|
||||
|
||||
- Send the subscribe-attribute command:
|
||||
@@ -1368,8 +1414,8 @@ The ``subs-attr`` commands are used for sending the commands of subscribing attr
|
||||
|
||||
matter esp controller subs-attr <node-id> <endpoint-id> <cluster-id> <attribute-id> <min-interval> <max-interval>
|
||||
|
||||
2.9.6.2 Subscribe event commands
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
2.10.6.2 Subscribe event commands
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
The ``subs-event`` commands are used for sending the commands of subscribing events on end-devices.
|
||||
|
||||
- Send the subscribe-event command:
|
||||
@@ -1378,8 +1424,8 @@ The ``subs-event`` commands are used for sending the commands of subscribing eve
|
||||
|
||||
matter esp controller subs-event <node-id> <endpoint-id> <cluster-id> <event-id> <min-interval> <max-interval>
|
||||
|
||||
2.9.7 Group settings commands
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
2.10.7 Group settings commands
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
The ``group-settings`` commands are used to set group information of the controller. They are available when the ``Enable matter commissioner`` option is enabled in menuconfig. If the controller wants to send multicast commands to end-devices, it should be in the same group as the end-devices.
|
||||
|
||||
- Set group information of the controller:
|
||||
@@ -1395,8 +1441,8 @@ The ``group-settings`` commands are used to set group information of the control
|
||||
matter esp controller group-settings bind-keyset <group-id> <ketset-id>
|
||||
matter esp controller group-settings unbind-keyset <group-id> <ketset-id>
|
||||
|
||||
2.9.8 Attestation Trust Storage
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
2.10.8 Attestation Trust Storage
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
The controller example offers two options for the Attestation Trust Storage which is used to store and utilize the PAA certificates for the Device Attestation verification. This feature is available when the ``Enable matter commissioner`` option is enabled in menuconfig. You can modify this setting in menuconfig ``Components`` -> ``ESP Matter Controller`` -> ``Attestation Trust Store``
|
||||
|
||||
- ``Attestation Trust Store - Test``
|
||||
|
||||
Reference in New Issue
Block a user