Skip to content

Commit

Permalink
Merge branch 'code/controller_on_esp32_s3_box_3' into 'master'
Browse files Browse the repository at this point in the history
matter_support: Controller demo on esp32_s3_box_3

See merge request app-frameworks/esp-rainmaker!410
  • Loading branch information
shahpiyushv committed Dec 8, 2023
2 parents 752d91e + 41ef0be commit 18882f7
Show file tree
Hide file tree
Showing 8 changed files with 142 additions and 173 deletions.
3 changes: 2 additions & 1 deletion examples/matter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ $ idf.py set-target esp32c3
$ idf.py build
$ idf.py flash monitor
```
> Note: for 'matter_controller_on_esp32_s3_box' example, input `idf.py menuconfig`, select `HMI Board Config`->`Selece BSP board`->`BSP board ESP32-S3-BOX` before `idf.py build`
> Note: for 'matter_controller_on_esp32_s3_box' example, before `idf.py build`, input `idf.py menuconfig` and select `HMI Board Config`->`Selece BSP board` to choose the development board (esp32-s3-box or esp32-s3-box-3, default is esp32-s3-box-3).
> If the platform is esp32-s3-box-3, IDF should be on github/master branch, and commit should be later than [this](https://github.com/espressif/esp-idf/commit/0df6afadef44eeb454457c379283db41cd6e47aa)
### Commissioning
The QR Code required for commissioning your device can be found at `${ESP_MATTER_PATH}/tools/mfg_tool/out/<vendor-id>_<product-id>/<node-id>/<node-id>-qrcode.png`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## What to expect in this example?

- This demonstrates a Matter + RainMaker Controller which running on [ESP32-S3-BOX](https://github.com/espressif/esp-box). Matter is used for commissioning (also known as Wi-Fi provisioning) and local control, whereas RainMaker is used for remote control.
- Please check the board (ESP32-S3-BOX / ESP32-S3-BOX-3) by `idf.py menuconfig`, default is ESP32-S3-BOX-3.
- To commission the Controller on ESP32-S3-BOX, scan the QR Code shown on the screen using ESP RainMaker app.
- After commissioning successfully, the Controller could control the other devices (supporting On/Off cluster server) in the same fabric locally by clicking the button on the screen.
- Besides the [Matter + Rainmaker light](../matter_light/), a Matter-only light at '$ESP_MATTER_PATH/examples/light' can also be commissioned by using a similar method. The QR code for Matter-only light is in the [website](https://docs.espressif.com/projects/esp-matter/en/latest/esp32/developing.html#commissioning-and-control).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ void on_device_list_update(void)

if (!s_device_ptr) {
ESP_LOGE(TAG, "No device list");
device_get_flag = true;
esp_matter::controller::device_mgr::free_device_list(s_device_ptr);
/* After removing the only one device, invoking matter_ctrl_get_device to update */
matter_ctrl_get_device((void *)s_device_ptr);
Expand All @@ -82,7 +83,6 @@ void on_device_list_update(void)
} else {
/* device list has changed, reestablishing the device-list */
matter_ctrl_get_device((void *)s_device_ptr);
matter_ctrl_read_device_state();
matter_ctrl_subscribe_device_state(SUBSCRIBE_LOCAL_DEVICE);
if (xRefresh_Ui_Handle) {
xTaskNotifyGive(xRefresh_Ui_Handle);
Expand All @@ -92,12 +92,11 @@ void on_device_list_update(void)
} else {
/* don't refresh at the first time */
matter_ctrl_get_device((void *)s_device_ptr);
matter_ctrl_read_device_state();
matter_ctrl_subscribe_device_state(SUBSCRIBE_LOCAL_DEVICE);
device_get_flag = true;
if (xRefresh_Ui_Handle) {
xTaskNotifyGive(xRefresh_Ui_Handle);
}
device_get_flag = true;
}
device_node_id = node_id;
esp_matter::controller::device_mgr::free_device_list(s_device_ptr);
Expand All @@ -119,12 +118,8 @@ static void refresh_ui_task(void *pvParameters)
while (true) {
if (ulTaskNotifyTake(pdTRUE, portMAX_DELAY) == true) {
/* refresh ui */
if (device_get_flag) {
clean_screen_with_button();
ui_matter_config_update_cb(UI_MATTER_EVT_REFRESH);
} else {
ui_matter_config_update_cb(UI_MATTER_EVT_COMMISSIONCOMPLETE);
}
clean_screen_with_button();
ui_matter_config_update_cb(UI_MATTER_EVT_REFRESH);
}
}
}
Expand Down
Loading

0 comments on commit 18882f7

Please sign in to comment.