feature/esp-insights: Integrate esp-insights with esp-matter

This commit is contained in:
Shripad Deshpande
2024-05-16 14:50:15 +08:00
committed by Hrishikesh Dhayagude
parent bf568327d4
commit e8deadf1db
6 changed files with 103 additions and 4 deletions
+6
View File
@@ -48,6 +48,12 @@ if(CONFIG_IDF_TARGET_ESP32C2)
endif()
idf_build_set_property(CXX_COMPILE_OPTIONS "-std=gnu++17;-Os;-DCHIP_HAVE_CONFIG_H;-Wno-overloaded-virtual" APPEND)
if (CONFIG_ENABLE_ESP_INSIGHTS_TRACE)
target_add_binary_data(generic_switch.elf "insights_auth_key.txt" TEXT)
endif()
idf_build_set_property(CXX_COMPILE_OPTIONS "-std=gnu++17;-Os;-DCHIP_HAVE_CONFIG_H" APPEND)
idf_build_set_property(C_COMPILE_OPTIONS "-Os" APPEND)
# For RISCV chips, project_include.cmake sets -Wno-format, but does not clear various
# flags that depend on -Wformat
+14 -4
View File
@@ -17,6 +17,12 @@ See the [docs](https://docs.espressif.com/projects/esp-matter/en/latest/esp32/de
## 1. Additional Environment Setup
### 1.1 Enabling insights (Optional)
Follow the steps mentioned [here](https://docs.espressif.com/projects/esp-matter/en/latest/esp32/insights.html)
### 1.2 Flash the factory partition
The steps below should be followed in order to access the fixed-labels.
- If monitoring the device using ``idf.py monitor``,press `` Ctrl + ]`` to stop the process.
- The following command must be executed to flash the mfg partition:
@@ -26,6 +32,8 @@ esptool.py -p [port-name] write_flash 0x10000 mfg_binaries/20202020_3841.bin
```
- Execute the command ``idf.py monitor``
## 2.Commissioning and Control
- Commission the device with ``discriminator: 3841``and `` passcode: 20202020``
```
@@ -37,25 +45,27 @@ esptool.py -p [port-name] write_flash 0x10000 mfg_binaries/20202020_3841.bin
- QRCode :
- ![QRCode](mfg_binaries/matter_qrcode_20202020_3841.png)
- To read the fixed-labels, use chip-tool.
### 2.1 Fixed-Labels
- To read the fixed-labels, use chip-tool.
```
chip-tool fixedlabel read label-list 0x7283 1
```
The example command given below should be executed to write to the label-list of User Label Cluster.
### 2.2 User-Labels
- The example command given below should be executed to write to the label-list of User Label Cluster.
```
chip-tool userlabel write label-list '[{"label":"room", "value":"bedroom 1"}, {"label":"orientation", "value":"east"}]' 0x7283 1
```
To read label-list of User Label Cluster execute the command given below.
- To read label-list of User Label Cluster execute the command given below.
```
chip-tool userlabel read label-list 0x7283 1
```
### Using the TagList Feature
### 2.3 Using the TagList Feature
To read the taglist of the Descriptor cluster execute the command given below.
+10
View File
@@ -15,6 +15,7 @@
#include <esp_matter_ota.h>
#include <common_macros.h>
#include <enable_esp_insights.h>
#include <app_priv.h>
#include <app_reset.h>
#include <app/util/attribute-storage.h>
@@ -34,6 +35,11 @@ using namespace esp_matter::endpoint;
using namespace esp_matter::cluster;
using namespace chip::app::Clusters;
#if CONFIG_ENABLE_ESP_INSIGHTS_TRACE
extern const char insights_auth_key_start[] asm("_binary_insights_auth_key_txt_start");
extern const char insights_auth_key_end[] asm("_binary_insights_auth_key_txt_end");
#endif
namespace {
// Please refer to https://github.com/CHIP-Specifications/connectedhomeip-spec/blob/master/src/namespaces
constexpr const uint8_t kNamespaceSwitches = 43;
@@ -231,6 +237,10 @@ extern "C" void app_main()
err = esp_matter::start(app_event_cb);
ABORT_APP_ON_FAILURE(err == ESP_OK, ESP_LOGE(TAG, "Failed to start Matter, err:%d", err));
#if CONFIG_ENABLE_ESP_INSIGHTS_TRACE
enable_insights(insights_auth_key_start);
#endif
SetTagList(0, chip::Span<const Descriptor::Structs::SemanticTagStruct::Type>(gEp0TagList));
SetTagList(1, chip::Span<const Descriptor::Structs::SemanticTagStruct::Type>(gEp1TagList));