From f419da8fec2303d91198a653d552d1ed6048e1ae Mon Sep 17 00:00:00 2001 From: Sugar Glider Date: Tue, 4 Nov 2025 05:24:11 -0300 Subject: [PATCH 01/22] feat(matter): esp32-c6 matter over thread example This is a Enhanced Color Light example using Thread over Matter with Arduino Matter Library code. The example shall be built using Arduino as IDF Component. --- .../CMakeLists.txt | 19 ++ .../README.md | 35 ++++ .../main/CMakeLists.txt | 3 + .../main/MatterEnhancedColorLight.cpp | 186 ++++++++++++++++++ .../main/idf_component.yml | 8 + .../partitions.csv | 10 + .../sdkconfig.defaults | 70 +++++++ 7 files changed, 331 insertions(+) create mode 100644 idf_component_examples/Arduino_ESP-Matter-over-Thread_ESP32-C6/CMakeLists.txt create mode 100644 idf_component_examples/Arduino_ESP-Matter-over-Thread_ESP32-C6/README.md create mode 100644 idf_component_examples/Arduino_ESP-Matter-over-Thread_ESP32-C6/main/CMakeLists.txt create mode 100644 idf_component_examples/Arduino_ESP-Matter-over-Thread_ESP32-C6/main/MatterEnhancedColorLight.cpp create mode 100644 idf_component_examples/Arduino_ESP-Matter-over-Thread_ESP32-C6/main/idf_component.yml create mode 100644 idf_component_examples/Arduino_ESP-Matter-over-Thread_ESP32-C6/partitions.csv create mode 100644 idf_component_examples/Arduino_ESP-Matter-over-Thread_ESP32-C6/sdkconfig.defaults diff --git a/idf_component_examples/Arduino_ESP-Matter-over-Thread_ESP32-C6/CMakeLists.txt b/idf_component_examples/Arduino_ESP-Matter-over-Thread_ESP32-C6/CMakeLists.txt new file mode 100644 index 00000000000..805e7096d73 --- /dev/null +++ b/idf_component_examples/Arduino_ESP-Matter-over-Thread_ESP32-C6/CMakeLists.txt @@ -0,0 +1,19 @@ +# The following lines of boilerplate have to be in your project's +# CMakeLists in this exact order for cmake to work correctly +cmake_minimum_required(VERSION 3.5) + +include($ENV{IDF_PATH}/tools/cmake/project.cmake) + +#target_compile_options(espressif__esp_matter PUBLIC +# -DCHIP_ADDRESS_RESOLVE_IMPL_INCLUDE_HEADER= +# -DCHIP_HAVE_CONFIG_H) +#list(APPEND compile_definitions "CHIP_HAVE_CONFIG_H=1") +#list(APPEND compile_definitions "CHIP_ADDRESS_RESOLVE_IMPL_INCLUDE_HEADER=") + +project(Matter_C6_Thread_Light) + +idf_build_set_property(CXX_COMPILE_OPTIONS "-std=gnu++2a;-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 +idf_build_set_property(COMPILE_OPTIONS "-Wno-format-nonliteral;-Wno-format-security" APPEND) diff --git a/idf_component_examples/Arduino_ESP-Matter-over-Thread_ESP32-C6/README.md b/idf_component_examples/Arduino_ESP-Matter-over-Thread_ESP32-C6/README.md new file mode 100644 index 00000000000..1ee102bea3b --- /dev/null +++ b/idf_component_examples/Arduino_ESP-Matter-over-Thread_ESP32-C6/README.md @@ -0,0 +1,35 @@ +# Arduino ESP-Matter over Thread example using ESP32-C6 +This is an Arduino as IDF Project to build an ESP-Matter over Thread RGB Light using ESP32-C6 and ESP-Matter Arduino API \ +This example shall work with Arduino 3.0.5+ and also IDF 5.1.4+\ +It is necessary to make sure that the IDF version matches with the one used to release the Arduino Core version.\ +This can be done looking into release information in https://github.com/espressif/arduino-esp32/releases \ + +Any example from [ESP32 Matter Library examples](https://github.com/espressif/arduino-esp32/tree/master/libraries/Matter/examples) +can be used to build the application.\ +Feel free to create you own Arduino Matter sketch!\ +Do not forget to rename the `sketch_file_name.ino` to `sketch_file_name.cpp` in `main` folder. + +The `main/idf_component.yml` file holds the ESP-Matter component version and Arduino Core version.\ +Edit this file to set the target versions, if necessary. + +# General Instructions: + +1- Install the required IDF version into your computer. It can be done following the guide in +https://docs.espressif.com/projects/esp-idf/en/stable/esp32c6/get-started/index.html + +For Windows: https://docs.espressif.com/projects/esp-idf/en/stable/esp32c6/get-started/index.html \ +For Linux or MacOS: https://docs.espressif.com/projects/esp-idf/en/stable/esp32c6/get-started/linux-macos-setup.html + +2- Test IDF with `idf.py --version` to check if it is installed and configured correctly. + +3- To create a ESP-IDF project from this example with the latest release of Arduino-esp32, you can simply run command: +`idf.py create-project-from-example "espressif/arduino-esp32:Arduino_ESP-Matter-over-Thread_ESP32_C6"` +ESP-IDF will download all dependencies needed from the component registry and setup the project for you. + +4- Open an IDF terminal and execute `idf.py set-target esp32c6` + +5- Execute `idf.py -p flash monitor` + +6- It will build, upload and show the UART0 output in the screen. + +7- Try to add the Matter RGB light to your Matter environment. diff --git a/idf_component_examples/Arduino_ESP-Matter-over-Thread_ESP32-C6/main/CMakeLists.txt b/idf_component_examples/Arduino_ESP-Matter-over-Thread_ESP32-C6/main/CMakeLists.txt new file mode 100644 index 00000000000..80e7d4e0854 --- /dev/null +++ b/idf_component_examples/Arduino_ESP-Matter-over-Thread_ESP32-C6/main/CMakeLists.txt @@ -0,0 +1,3 @@ +idf_component_register(SRC_DIRS "." + INCLUDE_DIRS ".") + diff --git a/idf_component_examples/Arduino_ESP-Matter-over-Thread_ESP32-C6/main/MatterEnhancedColorLight.cpp b/idf_component_examples/Arduino_ESP-Matter-over-Thread_ESP32-C6/main/MatterEnhancedColorLight.cpp new file mode 100644 index 00000000000..2322701ce94 --- /dev/null +++ b/idf_component_examples/Arduino_ESP-Matter-over-Thread_ESP32-C6/main/MatterEnhancedColorLight.cpp @@ -0,0 +1,186 @@ +// Copyright 2025 Espressif Systems (Shanghai) PTE LTD +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at + +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Matter Manager +#include +#include + +// List of Matter Endpoints for this Node +// Color Light Endpoint +MatterEnhancedColorLight EnhancedColorLight; + +// It will use HSV color to control all Matter Attribute Changes +HsvColor_t currentHSVColor = {0, 0, 0}; + +// it will keep last OnOff & HSV Color state stored, using Preferences +Preferences matterPref; +const char *onOffPrefKey = "OnOff"; +const char *hsvColorPrefKey = "HSV"; + +// set your board RGB LED pin here +#ifdef RGB_BUILTIN +const uint8_t ledPin = RGB_BUILTIN; +#else +const uint8_t ledPin = 2; // Set your pin here if your board has not defined LED_BUILTIN +#warning "Do not forget to set the RGB LED pin" +#endif + +// set your board USER BUTTON pin here +const uint8_t buttonPin = BOOT_PIN; // Set your pin here. Using BOOT Button. + +// Button control +uint32_t button_time_stamp = 0; // debouncing control +bool button_state = false; // false = released | true = pressed +const uint32_t debouceTime = 250; // button debouncing time (ms) +const uint32_t decommissioningTimeout = 5000; // keep the button pressed for 5s, or longer, to decommission + +// Set the RGB LED Light based on the current state of the Enhanced Color Light +bool setLightState(bool state, espHsvColor_t colorHSV, uint8_t brighteness, uint16_t temperature_Mireds) { + + if (state) { +#ifdef RGB_BUILTIN + // currentHSVColor keeps final color result + espRgbColor_t rgbColor = espHsvColorToRgbColor(currentHSVColor); + // set the RGB LED + rgbLedWrite(ledPin, rgbColor.r, rgbColor.g, rgbColor.b); +#else + // No Color RGB LED, just use the HSV value (brightness) to control the LED + analogWrite(ledPin, colorHSV.v); +#endif + } else { +#ifndef RGB_BUILTIN + // after analogWrite(), it is necessary to set the GPIO to digital mode first + pinMode(ledPin, OUTPUT); +#endif + digitalWrite(ledPin, LOW); + } + // store last HSV Color and OnOff state for when the Light is restarted / power goes off + matterPref.putBool(onOffPrefKey, state); + matterPref.putUInt(hsvColorPrefKey, currentHSVColor.h << 16 | currentHSVColor.s << 8 | currentHSVColor.v); + // This callback must return the success state to Matter core + return true; +} + +void setup() { + // Initialize the USER BUTTON (Boot button) GPIO that will act as a toggle switch + pinMode(buttonPin, INPUT_PULLUP); + // Initialize the LED (light) GPIO and Matter End Point + pinMode(ledPin, OUTPUT); + + Serial.begin(115200); + + // Initialize Matter EndPoint + matterPref.begin("MatterPrefs", false); + // default OnOff state is ON if not stored before + bool lastOnOffState = matterPref.getBool(onOffPrefKey, true); + // default HSV color is (21, 216, 25) - Warm White Color at 10% intensity + uint32_t prefHsvColor = matterPref.getUInt(hsvColorPrefKey, 21 << 16 | 216 << 8 | 25); + currentHSVColor = {uint8_t(prefHsvColor >> 16), uint8_t(prefHsvColor >> 8), uint8_t(prefHsvColor)}; + EnhancedColorLight.begin(lastOnOffState, currentHSVColor); + // set the callback function to handle the Light state change + EnhancedColorLight.onChange(setLightState); + + // lambda functions are used to set the attribute change callbacks + EnhancedColorLight.onChangeOnOff([](bool state) { + Serial.printf("Light OnOff changed to %s\r\n", state ? "ON" : "OFF"); + return true; + }); + EnhancedColorLight.onChangeColorTemperature([](uint16_t colorTemperature) { + Serial.printf("Light Color Temperature changed to %d\r\n", colorTemperature); + // get correspondent Hue and Saturation of the color temperature + HsvColor_t hsvTemperature = espRgbColorToHsvColor(espCTToRgbColor(colorTemperature)); + // keep previous the brightness and just change the Hue and Saturation + currentHSVColor.h = hsvTemperature.h; + currentHSVColor.s = hsvTemperature.s; + return true; + }); + EnhancedColorLight.onChangeBrightness([](uint8_t brightness) { + Serial.printf("Light brightness changed to %d\r\n", brightness); + // change current brightness (HSV value) + currentHSVColor.v = brightness; + return true; + }); + EnhancedColorLight.onChangeColorHSV([](HsvColor_t hsvColor) { + Serial.printf("Light HSV Color changed to (%d,%d,%d)\r\n", hsvColor.h, hsvColor.s, hsvColor.v); + // keep the current brightness and just change Hue and Saturation + currentHSVColor.h = hsvColor.h; + currentHSVColor.s = hsvColor.s; + return true; + }); + + // Matter beginning - Last step, after all EndPoints are initialized + Matter.begin(); + // This may be a restart of a already commissioned Matter accessory + if (Matter.isDeviceCommissioned()) { + Serial.println("Matter Node is commissioned and connected to the network. Ready for use."); + Serial.printf( + "Initial state: %s | RGB Color: (%d,%d,%d) \r\n", EnhancedColorLight ? "ON" : "OFF", EnhancedColorLight.getColorRGB().r, + EnhancedColorLight.getColorRGB().g, EnhancedColorLight.getColorRGB().b + ); + // configure the Light based on initial on-off state and its color + EnhancedColorLight.updateAccessory(); + } +} + +void loop() { + // Check Matter Light Commissioning state, which may change during execution of loop() + if (!Matter.isDeviceCommissioned()) { + Serial.println(""); + Serial.println("Matter Node is not commissioned yet."); + Serial.println("Initiate the device discovery in your Matter environment."); + Serial.println("Commission it to your Matter hub with the manual pairing code or QR code"); + Serial.printf("Manual pairing code: %s\r\n", Matter.getManualPairingCode().c_str()); + Serial.printf("QR code URL: %s\r\n", Matter.getOnboardingQRCodeUrl().c_str()); + // waits for Matter Light Commissioning. + uint32_t timeCount = 0; + while (!Matter.isDeviceCommissioned()) { + delay(100); + if ((timeCount++ % 50) == 0) { // 50*100ms = 5 sec + Serial.println("Matter Node not commissioned yet. Waiting for commissioning."); + } + } + Serial.printf( + "Initial state: %s | RGB Color: (%d,%d,%d) \r\n", EnhancedColorLight ? "ON" : "OFF", EnhancedColorLight.getColorRGB().r, + EnhancedColorLight.getColorRGB().g, EnhancedColorLight.getColorRGB().b + ); + // configure the Light based on initial on-off state and its color + EnhancedColorLight.updateAccessory(); + Serial.println("Matter Node is commissioned and connected to the network. Ready for use."); + } + + // A button is also used to control the light + // Check if the button has been pressed + if (digitalRead(buttonPin) == LOW && !button_state) { + // deals with button debouncing + button_time_stamp = millis(); // record the time while the button is pressed. + button_state = true; // pressed. + } + + // Onboard User Button is used as a Light toggle switch or to decommission it + uint32_t time_diff = millis() - button_time_stamp; + if (button_state && time_diff > debouceTime && digitalRead(buttonPin) == HIGH) { + button_state = false; // released + // Toggle button is released - toggle the light + Serial.println("User button released. Toggling Light!"); + EnhancedColorLight.toggle(); // Matter Controller also can see the change + } + + // Onboard User Button is kept pressed for longer than 5 seconds in order to decommission matter node + if (button_state && time_diff > decommissioningTimeout) { + Serial.println("Decommissioning the Light Matter Accessory. It shall be commissioned again."); + EnhancedColorLight = false; // turn the light off + Matter.decommission(); + button_time_stamp = millis(); // avoid running decommissining again, reboot takes a second or so + } +} diff --git a/idf_component_examples/Arduino_ESP-Matter-over-Thread_ESP32-C6/main/idf_component.yml b/idf_component_examples/Arduino_ESP-Matter-over-Thread_ESP32-C6/main/idf_component.yml new file mode 100644 index 00000000000..9ef6e9911dc --- /dev/null +++ b/idf_component_examples/Arduino_ESP-Matter-over-Thread_ESP32-C6/main/idf_component.yml @@ -0,0 +1,8 @@ +dependencies: + espressif/esp_matter: + version: ">=1.3.0" + require: public + espressif/arduino-esp32: + version: ">=3.0.5" + override_path: "../../../" + pre_release: true diff --git a/idf_component_examples/Arduino_ESP-Matter-over-Thread_ESP32-C6/partitions.csv b/idf_component_examples/Arduino_ESP-Matter-over-Thread_ESP32-C6/partitions.csv new file mode 100644 index 00000000000..c5b0dcea569 --- /dev/null +++ b/idf_component_examples/Arduino_ESP-Matter-over-Thread_ESP32-C6/partitions.csv @@ -0,0 +1,10 @@ +# Name, Type, SubType, Offset, Size, Flags +# Note: Firmware partition offset needs to be 64K aligned, initial 36K (9 sectors) are reserved for bootloader and partition table +esp_secure_cert, 0x3F, ,0xd000, 0x2000, encrypted +nvs, data, nvs, 0x10000, 0xC000, +nvs_keys, data, nvs_keys,, 0x1000, encrypted +otadata, data, ota, , 0x2000 +phy_init, data, phy, , 0x1000, +ota_0, app, ota_0, 0x20000, 0x1E0000, +ota_1, app, ota_1, 0x200000, 0x1E0000, +fctry, data, nvs, 0x3E0000, 0x6000 \ No newline at end of file diff --git a/idf_component_examples/Arduino_ESP-Matter-over-Thread_ESP32-C6/sdkconfig.defaults b/idf_component_examples/Arduino_ESP-Matter-over-Thread_ESP32-C6/sdkconfig.defaults new file mode 100644 index 00000000000..0e8cd3e45a9 --- /dev/null +++ b/idf_component_examples/Arduino_ESP-Matter-over-Thread_ESP32-C6/sdkconfig.defaults @@ -0,0 +1,70 @@ +CONFIG_IDF_TARGET="esp32c6" + +# Arduino ESP32 settings +CONFIG_BOOTLOADER_LOG_LEVEL_ERROR=y +CONFIG_AUTOSTART_ARDUINO=y +CONFIG_ARDUHAL_LOG_DEFAULT_LEVEL_INFO=y +CONFIG_FREERTOS_HZ=1000 +CONFIG_LOG_DEFAULT_LEVEL_ERROR=y + +# Enables Arduino Selective Library Compilation: Arduino Matter + Preferences Library +CONFIG_ARDUINO_SELECTIVE_COMPILATION=y +CONFIG_ARDUINO_SELECTIVE_Preferences=y +CONFIG_ARDUINO_SELECTIVE_Network=y +CONFIG_ARDUINO_SELECTIVE_ESPmDNS=y +CONFIG_ARDUINO_SELECTIVE_Matter=y + +# Flash Confinguration +CONFIG_ESPTOOLPY_FLASHMODE_QIO=y +CONFIG_ESPTOOLPY_FLASH_SAMPLE_MODE_STR=y +CONFIG_ESPTOOLPY_FLASHMODE="dio" +CONFIG_ESPTOOLPY_FLASHFREQ_80M=y +CONFIG_ESPTOOLPY_FLASHFREQ="80m" +CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y +CONFIG_ESPTOOLPY_FLASHSIZE="4MB" +CONFIG_ESPTOOLPY_HEADER_FLASHSIZE_UPDATE=y +CONFIG_ESPTOOLPY_BEFORE_RESET=y +CONFIG_ESPTOOLPY_BEFORE="default_reset" +CONFIG_ESPTOOLPY_AFTER_RESET=y +CONFIG_ESPTOOLPY_AFTER="hard_reset" +CONFIG_ESPTOOLPY_MONITOR_BAUD=115200 + +# libsodium +CONFIG_LIBSODIUM_USE_MBEDTLS_SHA=y + +# NIMBLE +CONFIG_BT_ENABLED=y +CONFIG_BT_NIMBLE_ENABLED=y +CONFIG_BT_NIMBLE_EXT_ADV=n +CONFIG_BT_NIMBLE_HCI_EVT_BUF_SIZE=70 +CONFIG_USE_BLE_ONLY_FOR_COMMISSIONING=n + +# Enable OpenThread +CONFIG_OPENTHREAD_ENABLED=y +CONFIG_OPENTHREAD_SRP_CLIENT=y +CONFIG_OPENTHREAD_DNS_CLIENT=y +CONFIG_OPENTHREAD_LOG_LEVEL_DYNAMIC=n +CONFIG_OPENTHREAD_LOG_LEVEL_NOTE=y +CONFIG_OPENTHREAD_CLI=n + +# Disable lwip ipv6 autoconfig +CONFIG_LWIP_IPV6_AUTOCONFIG=n + +# Use a custom partition table +CONFIG_PARTITION_TABLE_CUSTOM=y +CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv" + +# LwIP config for OpenThread +CONFIG_LWIP_IPV6_NUM_ADDRESSES=8 +CONFIG_LWIP_MULTICAST_PING=y + +# MDNS platform +CONFIG_USE_MINIMAL_MDNS=n +CONFIG_ENABLE_EXTENDED_DISCOVERY=y + +# Disable STA and AP for ESP32C6 ==> no Wifi, thread only +CONFIG_ENABLE_WIFI_STATION=n +CONFIG_ENABLE_WIFI_AP=n + +# Enable HKDF in mbedtls +CONFIG_MBEDTLS_HKDF_C=y From 2227cabf1567c25988d737efbdac711b4f9673bf Mon Sep 17 00:00:00 2001 From: Sugar Glider Date: Tue, 4 Nov 2025 06:18:59 -0300 Subject: [PATCH 02/22] fix(matter): typo Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .../Arduino_ESP-Matter-over-Thread_ESP32-C6/sdkconfig.defaults | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/idf_component_examples/Arduino_ESP-Matter-over-Thread_ESP32-C6/sdkconfig.defaults b/idf_component_examples/Arduino_ESP-Matter-over-Thread_ESP32-C6/sdkconfig.defaults index 0e8cd3e45a9..43caad55cb0 100644 --- a/idf_component_examples/Arduino_ESP-Matter-over-Thread_ESP32-C6/sdkconfig.defaults +++ b/idf_component_examples/Arduino_ESP-Matter-over-Thread_ESP32-C6/sdkconfig.defaults @@ -14,7 +14,7 @@ CONFIG_ARDUINO_SELECTIVE_Network=y CONFIG_ARDUINO_SELECTIVE_ESPmDNS=y CONFIG_ARDUINO_SELECTIVE_Matter=y -# Flash Confinguration +# Flash Configuration CONFIG_ESPTOOLPY_FLASHMODE_QIO=y CONFIG_ESPTOOLPY_FLASH_SAMPLE_MODE_STR=y CONFIG_ESPTOOLPY_FLASHMODE="dio" From 5a5c93dfc97ec76123c25a8ab39a875748d5ad4c Mon Sep 17 00:00:00 2001 From: Sugar Glider Date: Tue, 4 Nov 2025 06:20:06 -0300 Subject: [PATCH 03/22] fix(matter): typo Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .../Arduino_ESP-Matter-over-Thread_ESP32-C6/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/idf_component_examples/Arduino_ESP-Matter-over-Thread_ESP32-C6/README.md b/idf_component_examples/Arduino_ESP-Matter-over-Thread_ESP32-C6/README.md index 1ee102bea3b..08dc6441254 100644 --- a/idf_component_examples/Arduino_ESP-Matter-over-Thread_ESP32-C6/README.md +++ b/idf_component_examples/Arduino_ESP-Matter-over-Thread_ESP32-C6/README.md @@ -6,7 +6,7 @@ This can be done looking into release information in https://github.com/espressi Any example from [ESP32 Matter Library examples](https://github.com/espressif/arduino-esp32/tree/master/libraries/Matter/examples) can be used to build the application.\ -Feel free to create you own Arduino Matter sketch!\ +Feel free to create your own Arduino Matter sketch!\ Do not forget to rename the `sketch_file_name.ino` to `sketch_file_name.cpp` in `main` folder. The `main/idf_component.yml` file holds the ESP-Matter component version and Arduino Core version.\ From a2ab1e5300c440d0f785195e0a6323dab36a111b Mon Sep 17 00:00:00 2001 From: Sugar Glider Date: Tue, 4 Nov 2025 06:22:22 -0300 Subject: [PATCH 04/22] fix(matter): typos --- .../main/MatterEnhancedColorLight.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/idf_component_examples/Arduino_ESP-Matter-over-Thread_ESP32-C6/main/MatterEnhancedColorLight.cpp b/idf_component_examples/Arduino_ESP-Matter-over-Thread_ESP32-C6/main/MatterEnhancedColorLight.cpp index 2322701ce94..cff418bb164 100644 --- a/idf_component_examples/Arduino_ESP-Matter-over-Thread_ESP32-C6/main/MatterEnhancedColorLight.cpp +++ b/idf_component_examples/Arduino_ESP-Matter-over-Thread_ESP32-C6/main/MatterEnhancedColorLight.cpp @@ -42,11 +42,11 @@ const uint8_t buttonPin = BOOT_PIN; // Set your pin here. Using BOOT Button. // Button control uint32_t button_time_stamp = 0; // debouncing control bool button_state = false; // false = released | true = pressed -const uint32_t debouceTime = 250; // button debouncing time (ms) +const uint32_t debounceTime = 250; // button debouncing time (ms) const uint32_t decommissioningTimeout = 5000; // keep the button pressed for 5s, or longer, to decommission // Set the RGB LED Light based on the current state of the Enhanced Color Light -bool setLightState(bool state, espHsvColor_t colorHSV, uint8_t brighteness, uint16_t temperature_Mireds) { +bool setLightState(bool state, espHsvColor_t colorHSV, uint8_t brightness, uint16_t temperature_Mireds) { if (state) { #ifdef RGB_BUILTIN @@ -169,7 +169,7 @@ void loop() { // Onboard User Button is used as a Light toggle switch or to decommission it uint32_t time_diff = millis() - button_time_stamp; - if (button_state && time_diff > debouceTime && digitalRead(buttonPin) == HIGH) { + if (button_state && time_diff > debounceTime && digitalRead(buttonPin) == HIGH) { button_state = false; // released // Toggle button is released - toggle the light Serial.println("User button released. Toggling Light!"); From 9c4605821e2b1665589f237d3465da544d97c907 Mon Sep 17 00:00:00 2001 From: Sugar Glider Date: Tue, 4 Nov 2025 06:26:30 -0300 Subject: [PATCH 05/22] fix(matter): typo Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .../Arduino_ESP-Matter-over-Thread_ESP32-C6/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/idf_component_examples/Arduino_ESP-Matter-over-Thread_ESP32-C6/README.md b/idf_component_examples/Arduino_ESP-Matter-over-Thread_ESP32-C6/README.md index 08dc6441254..95554021cad 100644 --- a/idf_component_examples/Arduino_ESP-Matter-over-Thread_ESP32-C6/README.md +++ b/idf_component_examples/Arduino_ESP-Matter-over-Thread_ESP32-C6/README.md @@ -6,7 +6,7 @@ This can be done looking into release information in https://github.com/espressi Any example from [ESP32 Matter Library examples](https://github.com/espressif/arduino-esp32/tree/master/libraries/Matter/examples) can be used to build the application.\ -Feel free to create your own Arduino Matter sketch!\ +Feel free to create your own Arduino Matter sketch!\ Do not forget to rename the `sketch_file_name.ino` to `sketch_file_name.cpp` in `main` folder. The `main/idf_component.yml` file holds the ESP-Matter component version and Arduino Core version.\ From 0d359b95ccb505f674102f640da748e2a90eddc9 Mon Sep 17 00:00:00 2001 From: Sugar Glider Date: Tue, 4 Nov 2025 06:59:19 -0300 Subject: [PATCH 06/22] feat(matter): Add CI configuration --- .../Arduino_ESP-Matter-over-Thread_ESP32-C6/ci.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 idf_component_examples/Arduino_ESP-Matter-over-Thread_ESP32-C6/ci.yml diff --git a/idf_component_examples/Arduino_ESP-Matter-over-Thread_ESP32-C6/ci.yml b/idf_component_examples/Arduino_ESP-Matter-over-Thread_ESP32-C6/ci.yml new file mode 100644 index 00000000000..8e294bea918 --- /dev/null +++ b/idf_component_examples/Arduino_ESP-Matter-over-Thread_ESP32-C6/ci.yml @@ -0,0 +1,11 @@ +targets: + esp32s2: false + esp32s3: false + esp32c2: false + esp32c3: false + esp32p4: false + +requires: + - CONFIG_OPENTHREAD_ENABLED=y + - CONFIG_ESP_MATTER_ENABLE_DATA_MODEL=y + - CONFIG_MBEDTLS_HKDF_C=y From bef1e76baf3bb0fa5a3c2a2cc2372f5b243d5ad3 Mon Sep 17 00:00:00 2001 From: Sugar Glider Date: Tue, 4 Nov 2025 23:22:00 -0300 Subject: [PATCH 07/22] feat(matter): Update dependencies in idf_component.yml --- .../main/idf_component.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/idf_component_examples/Arduino_ESP-Matter-over-Thread_ESP32-C6/main/idf_component.yml b/idf_component_examples/Arduino_ESP-Matter-over-Thread_ESP32-C6/main/idf_component.yml index 9ef6e9911dc..023f77a8e43 100644 --- a/idf_component_examples/Arduino_ESP-Matter-over-Thread_ESP32-C6/main/idf_component.yml +++ b/idf_component_examples/Arduino_ESP-Matter-over-Thread_ESP32-C6/main/idf_component.yml @@ -1,8 +1,9 @@ dependencies: espressif/esp_matter: - version: ">=1.3.0" + version: ">=1.4.1" require: public espressif/arduino-esp32: - version: ">=3.0.5" + version: ">=3.3.2" override_path: "../../../" pre_release: true + From 3e0dd06b5b49552713ba71c9c91edc21b48205b7 Mon Sep 17 00:00:00 2001 From: Sugar Glider Date: Tue, 4 Nov 2025 23:23:20 -0300 Subject: [PATCH 08/22] feat(matter): allow C5, C6 and H2 as possible targets --- .../Arduino_ESP-Matter-over-Thread_ESP32-C6/sdkconfig.defaults | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/idf_component_examples/Arduino_ESP-Matter-over-Thread_ESP32-C6/sdkconfig.defaults b/idf_component_examples/Arduino_ESP-Matter-over-Thread_ESP32-C6/sdkconfig.defaults index 43caad55cb0..1dbb203daf4 100644 --- a/idf_component_examples/Arduino_ESP-Matter-over-Thread_ESP32-C6/sdkconfig.defaults +++ b/idf_component_examples/Arduino_ESP-Matter-over-Thread_ESP32-C6/sdkconfig.defaults @@ -1,5 +1,3 @@ -CONFIG_IDF_TARGET="esp32c6" - # Arduino ESP32 settings CONFIG_BOOTLOADER_LOG_LEVEL_ERROR=y CONFIG_AUTOSTART_ARDUINO=y @@ -68,3 +66,4 @@ CONFIG_ENABLE_WIFI_AP=n # Enable HKDF in mbedtls CONFIG_MBEDTLS_HKDF_C=y + From b89c2201af6ae64c54c001653f5d844fe5466a2a Mon Sep 17 00:00:00 2001 From: Sugar Glider Date: Tue, 4 Nov 2025 23:24:38 -0300 Subject: [PATCH 09/22] feat(matter): CI will target any SoC with Thread radio Removed unsupported target configurations for ESP32. --- .../Arduino_ESP-Matter-over-Thread_ESP32-C6/ci.yml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/idf_component_examples/Arduino_ESP-Matter-over-Thread_ESP32-C6/ci.yml b/idf_component_examples/Arduino_ESP-Matter-over-Thread_ESP32-C6/ci.yml index 8e294bea918..a551ae57cc7 100644 --- a/idf_component_examples/Arduino_ESP-Matter-over-Thread_ESP32-C6/ci.yml +++ b/idf_component_examples/Arduino_ESP-Matter-over-Thread_ESP32-C6/ci.yml @@ -1,10 +1,3 @@ -targets: - esp32s2: false - esp32s3: false - esp32c2: false - esp32c3: false - esp32p4: false - requires: - CONFIG_OPENTHREAD_ENABLED=y - CONFIG_ESP_MATTER_ENABLE_DATA_MODEL=y From 127e16071e02e794d1e852caa7daf2b9ca101a05 Mon Sep 17 00:00:00 2001 From: Sugar Glider Date: Tue, 4 Nov 2025 23:25:56 -0300 Subject: [PATCH 10/22] feat(matter): remove C6 from project name --- .../Arduino_ESP-Matter-over-Thread_ESP32-C6/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/idf_component_examples/Arduino_ESP-Matter-over-Thread_ESP32-C6/CMakeLists.txt b/idf_component_examples/Arduino_ESP-Matter-over-Thread_ESP32-C6/CMakeLists.txt index 805e7096d73..282ad5bb137 100644 --- a/idf_component_examples/Arduino_ESP-Matter-over-Thread_ESP32-C6/CMakeLists.txt +++ b/idf_component_examples/Arduino_ESP-Matter-over-Thread_ESP32-C6/CMakeLists.txt @@ -10,7 +10,7 @@ include($ENV{IDF_PATH}/tools/cmake/project.cmake) #list(APPEND compile_definitions "CHIP_HAVE_CONFIG_H=1") #list(APPEND compile_definitions "CHIP_ADDRESS_RESOLVE_IMPL_INCLUDE_HEADER=") -project(Matter_C6_Thread_Light) +project(Matter_Thread_Light) idf_build_set_property(CXX_COMPILE_OPTIONS "-std=gnu++2a;-Os;-DCHIP_HAVE_CONFIG_H" APPEND) idf_build_set_property(C_COMPILE_OPTIONS "-Os" APPEND) From eee1f3aacc70bea28aad9e8097371d058dcb4c3d Mon Sep 17 00:00:00 2001 From: Sugar Glider Date: Tue, 4 Nov 2025 23:30:20 -0300 Subject: [PATCH 11/22] feat(matter): Revise README for ESP32-C5, C6, and H2 support Updated README to reflect support for ESP32-C5, ESP32-C6, and ESP32-H2. Adjusted Arduino and IDF version compatibility information. --- .../Arduino_ESP-Matter-over-Thread_ESP32-C6/README.md | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/idf_component_examples/Arduino_ESP-Matter-over-Thread_ESP32-C6/README.md b/idf_component_examples/Arduino_ESP-Matter-over-Thread_ESP32-C6/README.md index 95554021cad..f77a311a47c 100644 --- a/idf_component_examples/Arduino_ESP-Matter-over-Thread_ESP32-C6/README.md +++ b/idf_component_examples/Arduino_ESP-Matter-over-Thread_ESP32-C6/README.md @@ -1,6 +1,9 @@ -# Arduino ESP-Matter over Thread example using ESP32-C6 -This is an Arduino as IDF Project to build an ESP-Matter over Thread RGB Light using ESP32-C6 and ESP-Matter Arduino API \ -This example shall work with Arduino 3.0.5+ and also IDF 5.1.4+\ +| Supported Targets | ESP32-C5 | ESP32-C6 | ESP32-H2 | +| ----------------- | -------- | -------- | -------- | + +# Arduino ESP-Matter over Thread example using ESP32-C5, ESP32-C6 and ESP32-H2 (any SoC with Thread radio) +This is an Arduino as IDF Project to build an ESP-Matter over Thread RGB Light using ESP32-C5/C6/H2 and ESP-Matter Arduino API \ +This example shall work with Arduino 3.3.2+ and also IDF 5.5.1+\ It is necessary to make sure that the IDF version matches with the one used to release the Arduino Core version.\ This can be done looking into release information in https://github.com/espressif/arduino-esp32/releases \ @@ -26,7 +29,7 @@ For Linux or MacOS: https://docs.espressif.com/projects/esp-idf/en/stable/esp32c `idf.py create-project-from-example "espressif/arduino-esp32:Arduino_ESP-Matter-over-Thread_ESP32_C6"` ESP-IDF will download all dependencies needed from the component registry and setup the project for you. -4- Open an IDF terminal and execute `idf.py set-target esp32c6` +4- Open an IDF terminal and execute `idf.py set-target esp32c6` (esp32c5 and esp32h2 are also possible targets) 5- Execute `idf.py -p flash monitor` From 9cf4a38539554da207d6cf18b5ee376a6027ab59 Mon Sep 17 00:00:00 2001 From: Sugar Glider Date: Tue, 4 Nov 2025 23:37:31 -0300 Subject: [PATCH 12/22] feat(matter): Changes the folder name --- .../CMakeLists.txt | 19 ++ .../README.md | 38 ++++ .../Arduino_ESP_Matter_over_OpenThread/ci.yml | 4 + .../main/CMakeLists.txt | 3 + .../main/MatterEnhancedColorLight.cpp | 186 ++++++++++++++++++ .../main/idf_component.yml | 9 + .../partitions.csv | 10 + .../sdkconfig.defaults | 69 +++++++ 8 files changed, 338 insertions(+) create mode 100644 idf_component_examples/Arduino_ESP_Matter_over_OpenThread/CMakeLists.txt create mode 100644 idf_component_examples/Arduino_ESP_Matter_over_OpenThread/README.md create mode 100644 idf_component_examples/Arduino_ESP_Matter_over_OpenThread/ci.yml create mode 100644 idf_component_examples/Arduino_ESP_Matter_over_OpenThread/main/CMakeLists.txt create mode 100644 idf_component_examples/Arduino_ESP_Matter_over_OpenThread/main/MatterEnhancedColorLight.cpp create mode 100644 idf_component_examples/Arduino_ESP_Matter_over_OpenThread/main/idf_component.yml create mode 100644 idf_component_examples/Arduino_ESP_Matter_over_OpenThread/partitions.csv create mode 100644 idf_component_examples/Arduino_ESP_Matter_over_OpenThread/sdkconfig.defaults diff --git a/idf_component_examples/Arduino_ESP_Matter_over_OpenThread/CMakeLists.txt b/idf_component_examples/Arduino_ESP_Matter_over_OpenThread/CMakeLists.txt new file mode 100644 index 00000000000..282ad5bb137 --- /dev/null +++ b/idf_component_examples/Arduino_ESP_Matter_over_OpenThread/CMakeLists.txt @@ -0,0 +1,19 @@ +# The following lines of boilerplate have to be in your project's +# CMakeLists in this exact order for cmake to work correctly +cmake_minimum_required(VERSION 3.5) + +include($ENV{IDF_PATH}/tools/cmake/project.cmake) + +#target_compile_options(espressif__esp_matter PUBLIC +# -DCHIP_ADDRESS_RESOLVE_IMPL_INCLUDE_HEADER= +# -DCHIP_HAVE_CONFIG_H) +#list(APPEND compile_definitions "CHIP_HAVE_CONFIG_H=1") +#list(APPEND compile_definitions "CHIP_ADDRESS_RESOLVE_IMPL_INCLUDE_HEADER=") + +project(Matter_Thread_Light) + +idf_build_set_property(CXX_COMPILE_OPTIONS "-std=gnu++2a;-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 +idf_build_set_property(COMPILE_OPTIONS "-Wno-format-nonliteral;-Wno-format-security" APPEND) diff --git a/idf_component_examples/Arduino_ESP_Matter_over_OpenThread/README.md b/idf_component_examples/Arduino_ESP_Matter_over_OpenThread/README.md new file mode 100644 index 00000000000..f77a311a47c --- /dev/null +++ b/idf_component_examples/Arduino_ESP_Matter_over_OpenThread/README.md @@ -0,0 +1,38 @@ +| Supported Targets | ESP32-C5 | ESP32-C6 | ESP32-H2 | +| ----------------- | -------- | -------- | -------- | + +# Arduino ESP-Matter over Thread example using ESP32-C5, ESP32-C6 and ESP32-H2 (any SoC with Thread radio) +This is an Arduino as IDF Project to build an ESP-Matter over Thread RGB Light using ESP32-C5/C6/H2 and ESP-Matter Arduino API \ +This example shall work with Arduino 3.3.2+ and also IDF 5.5.1+\ +It is necessary to make sure that the IDF version matches with the one used to release the Arduino Core version.\ +This can be done looking into release information in https://github.com/espressif/arduino-esp32/releases \ + +Any example from [ESP32 Matter Library examples](https://github.com/espressif/arduino-esp32/tree/master/libraries/Matter/examples) +can be used to build the application.\ +Feel free to create your own Arduino Matter sketch!\ +Do not forget to rename the `sketch_file_name.ino` to `sketch_file_name.cpp` in `main` folder. + +The `main/idf_component.yml` file holds the ESP-Matter component version and Arduino Core version.\ +Edit this file to set the target versions, if necessary. + +# General Instructions: + +1- Install the required IDF version into your computer. It can be done following the guide in +https://docs.espressif.com/projects/esp-idf/en/stable/esp32c6/get-started/index.html + +For Windows: https://docs.espressif.com/projects/esp-idf/en/stable/esp32c6/get-started/index.html \ +For Linux or MacOS: https://docs.espressif.com/projects/esp-idf/en/stable/esp32c6/get-started/linux-macos-setup.html + +2- Test IDF with `idf.py --version` to check if it is installed and configured correctly. + +3- To create a ESP-IDF project from this example with the latest release of Arduino-esp32, you can simply run command: +`idf.py create-project-from-example "espressif/arduino-esp32:Arduino_ESP-Matter-over-Thread_ESP32_C6"` +ESP-IDF will download all dependencies needed from the component registry and setup the project for you. + +4- Open an IDF terminal and execute `idf.py set-target esp32c6` (esp32c5 and esp32h2 are also possible targets) + +5- Execute `idf.py -p flash monitor` + +6- It will build, upload and show the UART0 output in the screen. + +7- Try to add the Matter RGB light to your Matter environment. diff --git a/idf_component_examples/Arduino_ESP_Matter_over_OpenThread/ci.yml b/idf_component_examples/Arduino_ESP_Matter_over_OpenThread/ci.yml new file mode 100644 index 00000000000..a551ae57cc7 --- /dev/null +++ b/idf_component_examples/Arduino_ESP_Matter_over_OpenThread/ci.yml @@ -0,0 +1,4 @@ +requires: + - CONFIG_OPENTHREAD_ENABLED=y + - CONFIG_ESP_MATTER_ENABLE_DATA_MODEL=y + - CONFIG_MBEDTLS_HKDF_C=y diff --git a/idf_component_examples/Arduino_ESP_Matter_over_OpenThread/main/CMakeLists.txt b/idf_component_examples/Arduino_ESP_Matter_over_OpenThread/main/CMakeLists.txt new file mode 100644 index 00000000000..80e7d4e0854 --- /dev/null +++ b/idf_component_examples/Arduino_ESP_Matter_over_OpenThread/main/CMakeLists.txt @@ -0,0 +1,3 @@ +idf_component_register(SRC_DIRS "." + INCLUDE_DIRS ".") + diff --git a/idf_component_examples/Arduino_ESP_Matter_over_OpenThread/main/MatterEnhancedColorLight.cpp b/idf_component_examples/Arduino_ESP_Matter_over_OpenThread/main/MatterEnhancedColorLight.cpp new file mode 100644 index 00000000000..cff418bb164 --- /dev/null +++ b/idf_component_examples/Arduino_ESP_Matter_over_OpenThread/main/MatterEnhancedColorLight.cpp @@ -0,0 +1,186 @@ +// Copyright 2025 Espressif Systems (Shanghai) PTE LTD +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at + +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Matter Manager +#include +#include + +// List of Matter Endpoints for this Node +// Color Light Endpoint +MatterEnhancedColorLight EnhancedColorLight; + +// It will use HSV color to control all Matter Attribute Changes +HsvColor_t currentHSVColor = {0, 0, 0}; + +// it will keep last OnOff & HSV Color state stored, using Preferences +Preferences matterPref; +const char *onOffPrefKey = "OnOff"; +const char *hsvColorPrefKey = "HSV"; + +// set your board RGB LED pin here +#ifdef RGB_BUILTIN +const uint8_t ledPin = RGB_BUILTIN; +#else +const uint8_t ledPin = 2; // Set your pin here if your board has not defined LED_BUILTIN +#warning "Do not forget to set the RGB LED pin" +#endif + +// set your board USER BUTTON pin here +const uint8_t buttonPin = BOOT_PIN; // Set your pin here. Using BOOT Button. + +// Button control +uint32_t button_time_stamp = 0; // debouncing control +bool button_state = false; // false = released | true = pressed +const uint32_t debounceTime = 250; // button debouncing time (ms) +const uint32_t decommissioningTimeout = 5000; // keep the button pressed for 5s, or longer, to decommission + +// Set the RGB LED Light based on the current state of the Enhanced Color Light +bool setLightState(bool state, espHsvColor_t colorHSV, uint8_t brightness, uint16_t temperature_Mireds) { + + if (state) { +#ifdef RGB_BUILTIN + // currentHSVColor keeps final color result + espRgbColor_t rgbColor = espHsvColorToRgbColor(currentHSVColor); + // set the RGB LED + rgbLedWrite(ledPin, rgbColor.r, rgbColor.g, rgbColor.b); +#else + // No Color RGB LED, just use the HSV value (brightness) to control the LED + analogWrite(ledPin, colorHSV.v); +#endif + } else { +#ifndef RGB_BUILTIN + // after analogWrite(), it is necessary to set the GPIO to digital mode first + pinMode(ledPin, OUTPUT); +#endif + digitalWrite(ledPin, LOW); + } + // store last HSV Color and OnOff state for when the Light is restarted / power goes off + matterPref.putBool(onOffPrefKey, state); + matterPref.putUInt(hsvColorPrefKey, currentHSVColor.h << 16 | currentHSVColor.s << 8 | currentHSVColor.v); + // This callback must return the success state to Matter core + return true; +} + +void setup() { + // Initialize the USER BUTTON (Boot button) GPIO that will act as a toggle switch + pinMode(buttonPin, INPUT_PULLUP); + // Initialize the LED (light) GPIO and Matter End Point + pinMode(ledPin, OUTPUT); + + Serial.begin(115200); + + // Initialize Matter EndPoint + matterPref.begin("MatterPrefs", false); + // default OnOff state is ON if not stored before + bool lastOnOffState = matterPref.getBool(onOffPrefKey, true); + // default HSV color is (21, 216, 25) - Warm White Color at 10% intensity + uint32_t prefHsvColor = matterPref.getUInt(hsvColorPrefKey, 21 << 16 | 216 << 8 | 25); + currentHSVColor = {uint8_t(prefHsvColor >> 16), uint8_t(prefHsvColor >> 8), uint8_t(prefHsvColor)}; + EnhancedColorLight.begin(lastOnOffState, currentHSVColor); + // set the callback function to handle the Light state change + EnhancedColorLight.onChange(setLightState); + + // lambda functions are used to set the attribute change callbacks + EnhancedColorLight.onChangeOnOff([](bool state) { + Serial.printf("Light OnOff changed to %s\r\n", state ? "ON" : "OFF"); + return true; + }); + EnhancedColorLight.onChangeColorTemperature([](uint16_t colorTemperature) { + Serial.printf("Light Color Temperature changed to %d\r\n", colorTemperature); + // get correspondent Hue and Saturation of the color temperature + HsvColor_t hsvTemperature = espRgbColorToHsvColor(espCTToRgbColor(colorTemperature)); + // keep previous the brightness and just change the Hue and Saturation + currentHSVColor.h = hsvTemperature.h; + currentHSVColor.s = hsvTemperature.s; + return true; + }); + EnhancedColorLight.onChangeBrightness([](uint8_t brightness) { + Serial.printf("Light brightness changed to %d\r\n", brightness); + // change current brightness (HSV value) + currentHSVColor.v = brightness; + return true; + }); + EnhancedColorLight.onChangeColorHSV([](HsvColor_t hsvColor) { + Serial.printf("Light HSV Color changed to (%d,%d,%d)\r\n", hsvColor.h, hsvColor.s, hsvColor.v); + // keep the current brightness and just change Hue and Saturation + currentHSVColor.h = hsvColor.h; + currentHSVColor.s = hsvColor.s; + return true; + }); + + // Matter beginning - Last step, after all EndPoints are initialized + Matter.begin(); + // This may be a restart of a already commissioned Matter accessory + if (Matter.isDeviceCommissioned()) { + Serial.println("Matter Node is commissioned and connected to the network. Ready for use."); + Serial.printf( + "Initial state: %s | RGB Color: (%d,%d,%d) \r\n", EnhancedColorLight ? "ON" : "OFF", EnhancedColorLight.getColorRGB().r, + EnhancedColorLight.getColorRGB().g, EnhancedColorLight.getColorRGB().b + ); + // configure the Light based on initial on-off state and its color + EnhancedColorLight.updateAccessory(); + } +} + +void loop() { + // Check Matter Light Commissioning state, which may change during execution of loop() + if (!Matter.isDeviceCommissioned()) { + Serial.println(""); + Serial.println("Matter Node is not commissioned yet."); + Serial.println("Initiate the device discovery in your Matter environment."); + Serial.println("Commission it to your Matter hub with the manual pairing code or QR code"); + Serial.printf("Manual pairing code: %s\r\n", Matter.getManualPairingCode().c_str()); + Serial.printf("QR code URL: %s\r\n", Matter.getOnboardingQRCodeUrl().c_str()); + // waits for Matter Light Commissioning. + uint32_t timeCount = 0; + while (!Matter.isDeviceCommissioned()) { + delay(100); + if ((timeCount++ % 50) == 0) { // 50*100ms = 5 sec + Serial.println("Matter Node not commissioned yet. Waiting for commissioning."); + } + } + Serial.printf( + "Initial state: %s | RGB Color: (%d,%d,%d) \r\n", EnhancedColorLight ? "ON" : "OFF", EnhancedColorLight.getColorRGB().r, + EnhancedColorLight.getColorRGB().g, EnhancedColorLight.getColorRGB().b + ); + // configure the Light based on initial on-off state and its color + EnhancedColorLight.updateAccessory(); + Serial.println("Matter Node is commissioned and connected to the network. Ready for use."); + } + + // A button is also used to control the light + // Check if the button has been pressed + if (digitalRead(buttonPin) == LOW && !button_state) { + // deals with button debouncing + button_time_stamp = millis(); // record the time while the button is pressed. + button_state = true; // pressed. + } + + // Onboard User Button is used as a Light toggle switch or to decommission it + uint32_t time_diff = millis() - button_time_stamp; + if (button_state && time_diff > debounceTime && digitalRead(buttonPin) == HIGH) { + button_state = false; // released + // Toggle button is released - toggle the light + Serial.println("User button released. Toggling Light!"); + EnhancedColorLight.toggle(); // Matter Controller also can see the change + } + + // Onboard User Button is kept pressed for longer than 5 seconds in order to decommission matter node + if (button_state && time_diff > decommissioningTimeout) { + Serial.println("Decommissioning the Light Matter Accessory. It shall be commissioned again."); + EnhancedColorLight = false; // turn the light off + Matter.decommission(); + button_time_stamp = millis(); // avoid running decommissining again, reboot takes a second or so + } +} diff --git a/idf_component_examples/Arduino_ESP_Matter_over_OpenThread/main/idf_component.yml b/idf_component_examples/Arduino_ESP_Matter_over_OpenThread/main/idf_component.yml new file mode 100644 index 00000000000..023f77a8e43 --- /dev/null +++ b/idf_component_examples/Arduino_ESP_Matter_over_OpenThread/main/idf_component.yml @@ -0,0 +1,9 @@ +dependencies: + espressif/esp_matter: + version: ">=1.4.1" + require: public + espressif/arduino-esp32: + version: ">=3.3.2" + override_path: "../../../" + pre_release: true + diff --git a/idf_component_examples/Arduino_ESP_Matter_over_OpenThread/partitions.csv b/idf_component_examples/Arduino_ESP_Matter_over_OpenThread/partitions.csv new file mode 100644 index 00000000000..c5b0dcea569 --- /dev/null +++ b/idf_component_examples/Arduino_ESP_Matter_over_OpenThread/partitions.csv @@ -0,0 +1,10 @@ +# Name, Type, SubType, Offset, Size, Flags +# Note: Firmware partition offset needs to be 64K aligned, initial 36K (9 sectors) are reserved for bootloader and partition table +esp_secure_cert, 0x3F, ,0xd000, 0x2000, encrypted +nvs, data, nvs, 0x10000, 0xC000, +nvs_keys, data, nvs_keys,, 0x1000, encrypted +otadata, data, ota, , 0x2000 +phy_init, data, phy, , 0x1000, +ota_0, app, ota_0, 0x20000, 0x1E0000, +ota_1, app, ota_1, 0x200000, 0x1E0000, +fctry, data, nvs, 0x3E0000, 0x6000 \ No newline at end of file diff --git a/idf_component_examples/Arduino_ESP_Matter_over_OpenThread/sdkconfig.defaults b/idf_component_examples/Arduino_ESP_Matter_over_OpenThread/sdkconfig.defaults new file mode 100644 index 00000000000..1dbb203daf4 --- /dev/null +++ b/idf_component_examples/Arduino_ESP_Matter_over_OpenThread/sdkconfig.defaults @@ -0,0 +1,69 @@ +# Arduino ESP32 settings +CONFIG_BOOTLOADER_LOG_LEVEL_ERROR=y +CONFIG_AUTOSTART_ARDUINO=y +CONFIG_ARDUHAL_LOG_DEFAULT_LEVEL_INFO=y +CONFIG_FREERTOS_HZ=1000 +CONFIG_LOG_DEFAULT_LEVEL_ERROR=y + +# Enables Arduino Selective Library Compilation: Arduino Matter + Preferences Library +CONFIG_ARDUINO_SELECTIVE_COMPILATION=y +CONFIG_ARDUINO_SELECTIVE_Preferences=y +CONFIG_ARDUINO_SELECTIVE_Network=y +CONFIG_ARDUINO_SELECTIVE_ESPmDNS=y +CONFIG_ARDUINO_SELECTIVE_Matter=y + +# Flash Configuration +CONFIG_ESPTOOLPY_FLASHMODE_QIO=y +CONFIG_ESPTOOLPY_FLASH_SAMPLE_MODE_STR=y +CONFIG_ESPTOOLPY_FLASHMODE="dio" +CONFIG_ESPTOOLPY_FLASHFREQ_80M=y +CONFIG_ESPTOOLPY_FLASHFREQ="80m" +CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y +CONFIG_ESPTOOLPY_FLASHSIZE="4MB" +CONFIG_ESPTOOLPY_HEADER_FLASHSIZE_UPDATE=y +CONFIG_ESPTOOLPY_BEFORE_RESET=y +CONFIG_ESPTOOLPY_BEFORE="default_reset" +CONFIG_ESPTOOLPY_AFTER_RESET=y +CONFIG_ESPTOOLPY_AFTER="hard_reset" +CONFIG_ESPTOOLPY_MONITOR_BAUD=115200 + +# libsodium +CONFIG_LIBSODIUM_USE_MBEDTLS_SHA=y + +# NIMBLE +CONFIG_BT_ENABLED=y +CONFIG_BT_NIMBLE_ENABLED=y +CONFIG_BT_NIMBLE_EXT_ADV=n +CONFIG_BT_NIMBLE_HCI_EVT_BUF_SIZE=70 +CONFIG_USE_BLE_ONLY_FOR_COMMISSIONING=n + +# Enable OpenThread +CONFIG_OPENTHREAD_ENABLED=y +CONFIG_OPENTHREAD_SRP_CLIENT=y +CONFIG_OPENTHREAD_DNS_CLIENT=y +CONFIG_OPENTHREAD_LOG_LEVEL_DYNAMIC=n +CONFIG_OPENTHREAD_LOG_LEVEL_NOTE=y +CONFIG_OPENTHREAD_CLI=n + +# Disable lwip ipv6 autoconfig +CONFIG_LWIP_IPV6_AUTOCONFIG=n + +# Use a custom partition table +CONFIG_PARTITION_TABLE_CUSTOM=y +CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv" + +# LwIP config for OpenThread +CONFIG_LWIP_IPV6_NUM_ADDRESSES=8 +CONFIG_LWIP_MULTICAST_PING=y + +# MDNS platform +CONFIG_USE_MINIMAL_MDNS=n +CONFIG_ENABLE_EXTENDED_DISCOVERY=y + +# Disable STA and AP for ESP32C6 ==> no Wifi, thread only +CONFIG_ENABLE_WIFI_STATION=n +CONFIG_ENABLE_WIFI_AP=n + +# Enable HKDF in mbedtls +CONFIG_MBEDTLS_HKDF_C=y + From 967b39c5048983d615065fd29cceb53722a890a4 Mon Sep 17 00:00:00 2001 From: Sugar Glider Date: Tue, 4 Nov 2025 23:38:07 -0300 Subject: [PATCH 13/22] feat(matter): Changes the folder name --- .../CMakeLists.txt | 19 -- .../README.md | 38 ---- .../ci.yml | 4 - .../main/CMakeLists.txt | 3 - .../main/MatterEnhancedColorLight.cpp | 186 ------------------ .../main/idf_component.yml | 9 - .../partitions.csv | 10 - .../sdkconfig.defaults | 69 ------- 8 files changed, 338 deletions(-) delete mode 100644 idf_component_examples/Arduino_ESP-Matter-over-Thread_ESP32-C6/CMakeLists.txt delete mode 100644 idf_component_examples/Arduino_ESP-Matter-over-Thread_ESP32-C6/README.md delete mode 100644 idf_component_examples/Arduino_ESP-Matter-over-Thread_ESP32-C6/ci.yml delete mode 100644 idf_component_examples/Arduino_ESP-Matter-over-Thread_ESP32-C6/main/CMakeLists.txt delete mode 100644 idf_component_examples/Arduino_ESP-Matter-over-Thread_ESP32-C6/main/MatterEnhancedColorLight.cpp delete mode 100644 idf_component_examples/Arduino_ESP-Matter-over-Thread_ESP32-C6/main/idf_component.yml delete mode 100644 idf_component_examples/Arduino_ESP-Matter-over-Thread_ESP32-C6/partitions.csv delete mode 100644 idf_component_examples/Arduino_ESP-Matter-over-Thread_ESP32-C6/sdkconfig.defaults diff --git a/idf_component_examples/Arduino_ESP-Matter-over-Thread_ESP32-C6/CMakeLists.txt b/idf_component_examples/Arduino_ESP-Matter-over-Thread_ESP32-C6/CMakeLists.txt deleted file mode 100644 index 282ad5bb137..00000000000 --- a/idf_component_examples/Arduino_ESP-Matter-over-Thread_ESP32-C6/CMakeLists.txt +++ /dev/null @@ -1,19 +0,0 @@ -# The following lines of boilerplate have to be in your project's -# CMakeLists in this exact order for cmake to work correctly -cmake_minimum_required(VERSION 3.5) - -include($ENV{IDF_PATH}/tools/cmake/project.cmake) - -#target_compile_options(espressif__esp_matter PUBLIC -# -DCHIP_ADDRESS_RESOLVE_IMPL_INCLUDE_HEADER= -# -DCHIP_HAVE_CONFIG_H) -#list(APPEND compile_definitions "CHIP_HAVE_CONFIG_H=1") -#list(APPEND compile_definitions "CHIP_ADDRESS_RESOLVE_IMPL_INCLUDE_HEADER=") - -project(Matter_Thread_Light) - -idf_build_set_property(CXX_COMPILE_OPTIONS "-std=gnu++2a;-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 -idf_build_set_property(COMPILE_OPTIONS "-Wno-format-nonliteral;-Wno-format-security" APPEND) diff --git a/idf_component_examples/Arduino_ESP-Matter-over-Thread_ESP32-C6/README.md b/idf_component_examples/Arduino_ESP-Matter-over-Thread_ESP32-C6/README.md deleted file mode 100644 index f77a311a47c..00000000000 --- a/idf_component_examples/Arduino_ESP-Matter-over-Thread_ESP32-C6/README.md +++ /dev/null @@ -1,38 +0,0 @@ -| Supported Targets | ESP32-C5 | ESP32-C6 | ESP32-H2 | -| ----------------- | -------- | -------- | -------- | - -# Arduino ESP-Matter over Thread example using ESP32-C5, ESP32-C6 and ESP32-H2 (any SoC with Thread radio) -This is an Arduino as IDF Project to build an ESP-Matter over Thread RGB Light using ESP32-C5/C6/H2 and ESP-Matter Arduino API \ -This example shall work with Arduino 3.3.2+ and also IDF 5.5.1+\ -It is necessary to make sure that the IDF version matches with the one used to release the Arduino Core version.\ -This can be done looking into release information in https://github.com/espressif/arduino-esp32/releases \ - -Any example from [ESP32 Matter Library examples](https://github.com/espressif/arduino-esp32/tree/master/libraries/Matter/examples) -can be used to build the application.\ -Feel free to create your own Arduino Matter sketch!\ -Do not forget to rename the `sketch_file_name.ino` to `sketch_file_name.cpp` in `main` folder. - -The `main/idf_component.yml` file holds the ESP-Matter component version and Arduino Core version.\ -Edit this file to set the target versions, if necessary. - -# General Instructions: - -1- Install the required IDF version into your computer. It can be done following the guide in -https://docs.espressif.com/projects/esp-idf/en/stable/esp32c6/get-started/index.html - -For Windows: https://docs.espressif.com/projects/esp-idf/en/stable/esp32c6/get-started/index.html \ -For Linux or MacOS: https://docs.espressif.com/projects/esp-idf/en/stable/esp32c6/get-started/linux-macos-setup.html - -2- Test IDF with `idf.py --version` to check if it is installed and configured correctly. - -3- To create a ESP-IDF project from this example with the latest release of Arduino-esp32, you can simply run command: -`idf.py create-project-from-example "espressif/arduino-esp32:Arduino_ESP-Matter-over-Thread_ESP32_C6"` -ESP-IDF will download all dependencies needed from the component registry and setup the project for you. - -4- Open an IDF terminal and execute `idf.py set-target esp32c6` (esp32c5 and esp32h2 are also possible targets) - -5- Execute `idf.py -p flash monitor` - -6- It will build, upload and show the UART0 output in the screen. - -7- Try to add the Matter RGB light to your Matter environment. diff --git a/idf_component_examples/Arduino_ESP-Matter-over-Thread_ESP32-C6/ci.yml b/idf_component_examples/Arduino_ESP-Matter-over-Thread_ESP32-C6/ci.yml deleted file mode 100644 index a551ae57cc7..00000000000 --- a/idf_component_examples/Arduino_ESP-Matter-over-Thread_ESP32-C6/ci.yml +++ /dev/null @@ -1,4 +0,0 @@ -requires: - - CONFIG_OPENTHREAD_ENABLED=y - - CONFIG_ESP_MATTER_ENABLE_DATA_MODEL=y - - CONFIG_MBEDTLS_HKDF_C=y diff --git a/idf_component_examples/Arduino_ESP-Matter-over-Thread_ESP32-C6/main/CMakeLists.txt b/idf_component_examples/Arduino_ESP-Matter-over-Thread_ESP32-C6/main/CMakeLists.txt deleted file mode 100644 index 80e7d4e0854..00000000000 --- a/idf_component_examples/Arduino_ESP-Matter-over-Thread_ESP32-C6/main/CMakeLists.txt +++ /dev/null @@ -1,3 +0,0 @@ -idf_component_register(SRC_DIRS "." - INCLUDE_DIRS ".") - diff --git a/idf_component_examples/Arduino_ESP-Matter-over-Thread_ESP32-C6/main/MatterEnhancedColorLight.cpp b/idf_component_examples/Arduino_ESP-Matter-over-Thread_ESP32-C6/main/MatterEnhancedColorLight.cpp deleted file mode 100644 index cff418bb164..00000000000 --- a/idf_component_examples/Arduino_ESP-Matter-over-Thread_ESP32-C6/main/MatterEnhancedColorLight.cpp +++ /dev/null @@ -1,186 +0,0 @@ -// Copyright 2025 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Matter Manager -#include -#include - -// List of Matter Endpoints for this Node -// Color Light Endpoint -MatterEnhancedColorLight EnhancedColorLight; - -// It will use HSV color to control all Matter Attribute Changes -HsvColor_t currentHSVColor = {0, 0, 0}; - -// it will keep last OnOff & HSV Color state stored, using Preferences -Preferences matterPref; -const char *onOffPrefKey = "OnOff"; -const char *hsvColorPrefKey = "HSV"; - -// set your board RGB LED pin here -#ifdef RGB_BUILTIN -const uint8_t ledPin = RGB_BUILTIN; -#else -const uint8_t ledPin = 2; // Set your pin here if your board has not defined LED_BUILTIN -#warning "Do not forget to set the RGB LED pin" -#endif - -// set your board USER BUTTON pin here -const uint8_t buttonPin = BOOT_PIN; // Set your pin here. Using BOOT Button. - -// Button control -uint32_t button_time_stamp = 0; // debouncing control -bool button_state = false; // false = released | true = pressed -const uint32_t debounceTime = 250; // button debouncing time (ms) -const uint32_t decommissioningTimeout = 5000; // keep the button pressed for 5s, or longer, to decommission - -// Set the RGB LED Light based on the current state of the Enhanced Color Light -bool setLightState(bool state, espHsvColor_t colorHSV, uint8_t brightness, uint16_t temperature_Mireds) { - - if (state) { -#ifdef RGB_BUILTIN - // currentHSVColor keeps final color result - espRgbColor_t rgbColor = espHsvColorToRgbColor(currentHSVColor); - // set the RGB LED - rgbLedWrite(ledPin, rgbColor.r, rgbColor.g, rgbColor.b); -#else - // No Color RGB LED, just use the HSV value (brightness) to control the LED - analogWrite(ledPin, colorHSV.v); -#endif - } else { -#ifndef RGB_BUILTIN - // after analogWrite(), it is necessary to set the GPIO to digital mode first - pinMode(ledPin, OUTPUT); -#endif - digitalWrite(ledPin, LOW); - } - // store last HSV Color and OnOff state for when the Light is restarted / power goes off - matterPref.putBool(onOffPrefKey, state); - matterPref.putUInt(hsvColorPrefKey, currentHSVColor.h << 16 | currentHSVColor.s << 8 | currentHSVColor.v); - // This callback must return the success state to Matter core - return true; -} - -void setup() { - // Initialize the USER BUTTON (Boot button) GPIO that will act as a toggle switch - pinMode(buttonPin, INPUT_PULLUP); - // Initialize the LED (light) GPIO and Matter End Point - pinMode(ledPin, OUTPUT); - - Serial.begin(115200); - - // Initialize Matter EndPoint - matterPref.begin("MatterPrefs", false); - // default OnOff state is ON if not stored before - bool lastOnOffState = matterPref.getBool(onOffPrefKey, true); - // default HSV color is (21, 216, 25) - Warm White Color at 10% intensity - uint32_t prefHsvColor = matterPref.getUInt(hsvColorPrefKey, 21 << 16 | 216 << 8 | 25); - currentHSVColor = {uint8_t(prefHsvColor >> 16), uint8_t(prefHsvColor >> 8), uint8_t(prefHsvColor)}; - EnhancedColorLight.begin(lastOnOffState, currentHSVColor); - // set the callback function to handle the Light state change - EnhancedColorLight.onChange(setLightState); - - // lambda functions are used to set the attribute change callbacks - EnhancedColorLight.onChangeOnOff([](bool state) { - Serial.printf("Light OnOff changed to %s\r\n", state ? "ON" : "OFF"); - return true; - }); - EnhancedColorLight.onChangeColorTemperature([](uint16_t colorTemperature) { - Serial.printf("Light Color Temperature changed to %d\r\n", colorTemperature); - // get correspondent Hue and Saturation of the color temperature - HsvColor_t hsvTemperature = espRgbColorToHsvColor(espCTToRgbColor(colorTemperature)); - // keep previous the brightness and just change the Hue and Saturation - currentHSVColor.h = hsvTemperature.h; - currentHSVColor.s = hsvTemperature.s; - return true; - }); - EnhancedColorLight.onChangeBrightness([](uint8_t brightness) { - Serial.printf("Light brightness changed to %d\r\n", brightness); - // change current brightness (HSV value) - currentHSVColor.v = brightness; - return true; - }); - EnhancedColorLight.onChangeColorHSV([](HsvColor_t hsvColor) { - Serial.printf("Light HSV Color changed to (%d,%d,%d)\r\n", hsvColor.h, hsvColor.s, hsvColor.v); - // keep the current brightness and just change Hue and Saturation - currentHSVColor.h = hsvColor.h; - currentHSVColor.s = hsvColor.s; - return true; - }); - - // Matter beginning - Last step, after all EndPoints are initialized - Matter.begin(); - // This may be a restart of a already commissioned Matter accessory - if (Matter.isDeviceCommissioned()) { - Serial.println("Matter Node is commissioned and connected to the network. Ready for use."); - Serial.printf( - "Initial state: %s | RGB Color: (%d,%d,%d) \r\n", EnhancedColorLight ? "ON" : "OFF", EnhancedColorLight.getColorRGB().r, - EnhancedColorLight.getColorRGB().g, EnhancedColorLight.getColorRGB().b - ); - // configure the Light based on initial on-off state and its color - EnhancedColorLight.updateAccessory(); - } -} - -void loop() { - // Check Matter Light Commissioning state, which may change during execution of loop() - if (!Matter.isDeviceCommissioned()) { - Serial.println(""); - Serial.println("Matter Node is not commissioned yet."); - Serial.println("Initiate the device discovery in your Matter environment."); - Serial.println("Commission it to your Matter hub with the manual pairing code or QR code"); - Serial.printf("Manual pairing code: %s\r\n", Matter.getManualPairingCode().c_str()); - Serial.printf("QR code URL: %s\r\n", Matter.getOnboardingQRCodeUrl().c_str()); - // waits for Matter Light Commissioning. - uint32_t timeCount = 0; - while (!Matter.isDeviceCommissioned()) { - delay(100); - if ((timeCount++ % 50) == 0) { // 50*100ms = 5 sec - Serial.println("Matter Node not commissioned yet. Waiting for commissioning."); - } - } - Serial.printf( - "Initial state: %s | RGB Color: (%d,%d,%d) \r\n", EnhancedColorLight ? "ON" : "OFF", EnhancedColorLight.getColorRGB().r, - EnhancedColorLight.getColorRGB().g, EnhancedColorLight.getColorRGB().b - ); - // configure the Light based on initial on-off state and its color - EnhancedColorLight.updateAccessory(); - Serial.println("Matter Node is commissioned and connected to the network. Ready for use."); - } - - // A button is also used to control the light - // Check if the button has been pressed - if (digitalRead(buttonPin) == LOW && !button_state) { - // deals with button debouncing - button_time_stamp = millis(); // record the time while the button is pressed. - button_state = true; // pressed. - } - - // Onboard User Button is used as a Light toggle switch or to decommission it - uint32_t time_diff = millis() - button_time_stamp; - if (button_state && time_diff > debounceTime && digitalRead(buttonPin) == HIGH) { - button_state = false; // released - // Toggle button is released - toggle the light - Serial.println("User button released. Toggling Light!"); - EnhancedColorLight.toggle(); // Matter Controller also can see the change - } - - // Onboard User Button is kept pressed for longer than 5 seconds in order to decommission matter node - if (button_state && time_diff > decommissioningTimeout) { - Serial.println("Decommissioning the Light Matter Accessory. It shall be commissioned again."); - EnhancedColorLight = false; // turn the light off - Matter.decommission(); - button_time_stamp = millis(); // avoid running decommissining again, reboot takes a second or so - } -} diff --git a/idf_component_examples/Arduino_ESP-Matter-over-Thread_ESP32-C6/main/idf_component.yml b/idf_component_examples/Arduino_ESP-Matter-over-Thread_ESP32-C6/main/idf_component.yml deleted file mode 100644 index 023f77a8e43..00000000000 --- a/idf_component_examples/Arduino_ESP-Matter-over-Thread_ESP32-C6/main/idf_component.yml +++ /dev/null @@ -1,9 +0,0 @@ -dependencies: - espressif/esp_matter: - version: ">=1.4.1" - require: public - espressif/arduino-esp32: - version: ">=3.3.2" - override_path: "../../../" - pre_release: true - diff --git a/idf_component_examples/Arduino_ESP-Matter-over-Thread_ESP32-C6/partitions.csv b/idf_component_examples/Arduino_ESP-Matter-over-Thread_ESP32-C6/partitions.csv deleted file mode 100644 index c5b0dcea569..00000000000 --- a/idf_component_examples/Arduino_ESP-Matter-over-Thread_ESP32-C6/partitions.csv +++ /dev/null @@ -1,10 +0,0 @@ -# Name, Type, SubType, Offset, Size, Flags -# Note: Firmware partition offset needs to be 64K aligned, initial 36K (9 sectors) are reserved for bootloader and partition table -esp_secure_cert, 0x3F, ,0xd000, 0x2000, encrypted -nvs, data, nvs, 0x10000, 0xC000, -nvs_keys, data, nvs_keys,, 0x1000, encrypted -otadata, data, ota, , 0x2000 -phy_init, data, phy, , 0x1000, -ota_0, app, ota_0, 0x20000, 0x1E0000, -ota_1, app, ota_1, 0x200000, 0x1E0000, -fctry, data, nvs, 0x3E0000, 0x6000 \ No newline at end of file diff --git a/idf_component_examples/Arduino_ESP-Matter-over-Thread_ESP32-C6/sdkconfig.defaults b/idf_component_examples/Arduino_ESP-Matter-over-Thread_ESP32-C6/sdkconfig.defaults deleted file mode 100644 index 1dbb203daf4..00000000000 --- a/idf_component_examples/Arduino_ESP-Matter-over-Thread_ESP32-C6/sdkconfig.defaults +++ /dev/null @@ -1,69 +0,0 @@ -# Arduino ESP32 settings -CONFIG_BOOTLOADER_LOG_LEVEL_ERROR=y -CONFIG_AUTOSTART_ARDUINO=y -CONFIG_ARDUHAL_LOG_DEFAULT_LEVEL_INFO=y -CONFIG_FREERTOS_HZ=1000 -CONFIG_LOG_DEFAULT_LEVEL_ERROR=y - -# Enables Arduino Selective Library Compilation: Arduino Matter + Preferences Library -CONFIG_ARDUINO_SELECTIVE_COMPILATION=y -CONFIG_ARDUINO_SELECTIVE_Preferences=y -CONFIG_ARDUINO_SELECTIVE_Network=y -CONFIG_ARDUINO_SELECTIVE_ESPmDNS=y -CONFIG_ARDUINO_SELECTIVE_Matter=y - -# Flash Configuration -CONFIG_ESPTOOLPY_FLASHMODE_QIO=y -CONFIG_ESPTOOLPY_FLASH_SAMPLE_MODE_STR=y -CONFIG_ESPTOOLPY_FLASHMODE="dio" -CONFIG_ESPTOOLPY_FLASHFREQ_80M=y -CONFIG_ESPTOOLPY_FLASHFREQ="80m" -CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y -CONFIG_ESPTOOLPY_FLASHSIZE="4MB" -CONFIG_ESPTOOLPY_HEADER_FLASHSIZE_UPDATE=y -CONFIG_ESPTOOLPY_BEFORE_RESET=y -CONFIG_ESPTOOLPY_BEFORE="default_reset" -CONFIG_ESPTOOLPY_AFTER_RESET=y -CONFIG_ESPTOOLPY_AFTER="hard_reset" -CONFIG_ESPTOOLPY_MONITOR_BAUD=115200 - -# libsodium -CONFIG_LIBSODIUM_USE_MBEDTLS_SHA=y - -# NIMBLE -CONFIG_BT_ENABLED=y -CONFIG_BT_NIMBLE_ENABLED=y -CONFIG_BT_NIMBLE_EXT_ADV=n -CONFIG_BT_NIMBLE_HCI_EVT_BUF_SIZE=70 -CONFIG_USE_BLE_ONLY_FOR_COMMISSIONING=n - -# Enable OpenThread -CONFIG_OPENTHREAD_ENABLED=y -CONFIG_OPENTHREAD_SRP_CLIENT=y -CONFIG_OPENTHREAD_DNS_CLIENT=y -CONFIG_OPENTHREAD_LOG_LEVEL_DYNAMIC=n -CONFIG_OPENTHREAD_LOG_LEVEL_NOTE=y -CONFIG_OPENTHREAD_CLI=n - -# Disable lwip ipv6 autoconfig -CONFIG_LWIP_IPV6_AUTOCONFIG=n - -# Use a custom partition table -CONFIG_PARTITION_TABLE_CUSTOM=y -CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv" - -# LwIP config for OpenThread -CONFIG_LWIP_IPV6_NUM_ADDRESSES=8 -CONFIG_LWIP_MULTICAST_PING=y - -# MDNS platform -CONFIG_USE_MINIMAL_MDNS=n -CONFIG_ENABLE_EXTENDED_DISCOVERY=y - -# Disable STA and AP for ESP32C6 ==> no Wifi, thread only -CONFIG_ENABLE_WIFI_STATION=n -CONFIG_ENABLE_WIFI_AP=n - -# Enable HKDF in mbedtls -CONFIG_MBEDTLS_HKDF_C=y - From caf4116497f8912199ac95a472168413576a1499 Mon Sep 17 00:00:00 2001 From: Sugar Glider Date: Tue, 4 Nov 2025 23:43:56 -0300 Subject: [PATCH 14/22] feat(matter): clarify Matter device addition --- .../Arduino_ESP_Matter_over_OpenThread/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/idf_component_examples/Arduino_ESP_Matter_over_OpenThread/README.md b/idf_component_examples/Arduino_ESP_Matter_over_OpenThread/README.md index f77a311a47c..5b8db68920e 100644 --- a/idf_component_examples/Arduino_ESP_Matter_over_OpenThread/README.md +++ b/idf_component_examples/Arduino_ESP_Matter_over_OpenThread/README.md @@ -35,4 +35,4 @@ ESP-IDF will download all dependencies needed from the component registry and se 6- It will build, upload and show the UART0 output in the screen. -7- Try to add the Matter RGB light to your Matter environment. +7- Try to add the new Matter device to your local Matter environment. From c51220bfa352be5ba67d6dfe6874dfa6201ba53d Mon Sep 17 00:00:00 2001 From: Sugar Glider Date: Tue, 4 Nov 2025 23:52:47 -0300 Subject: [PATCH 15/22] feat(matter): limits possible SoC targets --- .../main/idf_component.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/idf_component_examples/Arduino_ESP_Matter_over_OpenThread/main/idf_component.yml b/idf_component_examples/Arduino_ESP_Matter_over_OpenThread/main/idf_component.yml index 023f77a8e43..e10ab32fef9 100644 --- a/idf_component_examples/Arduino_ESP_Matter_over_OpenThread/main/idf_component.yml +++ b/idf_component_examples/Arduino_ESP_Matter_over_OpenThread/main/idf_component.yml @@ -1,9 +1,17 @@ +targets: + - esp32c5 + - esp32c6 + - esp32h2 dependencies: espressif/esp_matter: version: ">=1.4.1" require: public + idf: + version: ">=5.5.1" espressif/arduino-esp32: version: ">=3.3.2" override_path: "../../../" pre_release: true + target: + From 9c234e467ad4af9bc0e3e80f156955c99776243e Mon Sep 17 00:00:00 2001 From: Sugar Glider Date: Wed, 5 Nov 2025 00:01:07 -0300 Subject: [PATCH 16/22] fix(matter): bad dependency declaration --- .../Arduino_ESP_Matter_over_OpenThread/main/idf_component.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/idf_component_examples/Arduino_ESP_Matter_over_OpenThread/main/idf_component.yml b/idf_component_examples/Arduino_ESP_Matter_over_OpenThread/main/idf_component.yml index e10ab32fef9..16fba97c391 100644 --- a/idf_component_examples/Arduino_ESP_Matter_over_OpenThread/main/idf_component.yml +++ b/idf_component_examples/Arduino_ESP_Matter_over_OpenThread/main/idf_component.yml @@ -12,6 +12,3 @@ dependencies: version: ">=3.3.2" override_path: "../../../" pre_release: true - target: - - From c56df48a15000f07678826b6e4b6b204869dff14 Mon Sep 17 00:00:00 2001 From: Sugar Glider Date: Wed, 5 Nov 2025 00:10:30 -0300 Subject: [PATCH 17/22] fix(matter): dependencies over Core 3.1.0, IDF 5.3 and Matter 1.3 --- .../main/idf_component.yml | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/idf_component_examples/Arduino_ESP_Matter_over_OpenThread/main/idf_component.yml b/idf_component_examples/Arduino_ESP_Matter_over_OpenThread/main/idf_component.yml index 16fba97c391..6d07b1eee28 100644 --- a/idf_component_examples/Arduino_ESP_Matter_over_OpenThread/main/idf_component.yml +++ b/idf_component_examples/Arduino_ESP_Matter_over_OpenThread/main/idf_component.yml @@ -1,14 +1,9 @@ -targets: - - esp32c5 - - esp32c6 - - esp32h2 dependencies: espressif/esp_matter: - version: ">=1.4.1" + version: ">=1.3.0" require: public - idf: - version: ">=5.5.1" espressif/arduino-esp32: - version: ">=3.3.2" + version: ">=3.1.0" override_path: "../../../" pre_release: true + From 80c19916d3bcb12a239b960fa509479be73c48b2 Mon Sep 17 00:00:00 2001 From: Sugar Glider Date: Wed, 5 Nov 2025 00:31:08 -0300 Subject: [PATCH 18/22] fix(matter): Add target configurations to ci.yml --- .../Arduino_ESP_Matter_over_OpenThread/ci.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/idf_component_examples/Arduino_ESP_Matter_over_OpenThread/ci.yml b/idf_component_examples/Arduino_ESP_Matter_over_OpenThread/ci.yml index a551ae57cc7..31e60736f61 100644 --- a/idf_component_examples/Arduino_ESP_Matter_over_OpenThread/ci.yml +++ b/idf_component_examples/Arduino_ESP_Matter_over_OpenThread/ci.yml @@ -1,3 +1,9 @@ +targets: + esp32s2: false + esp32s3: false + esp32c2: false + esp32c3: false + esp32p4: false requires: - CONFIG_OPENTHREAD_ENABLED=y - CONFIG_ESP_MATTER_ENABLE_DATA_MODEL=y From 5cc5f698ae5c511c6d3b0f037990ab64601c09bd Mon Sep 17 00:00:00 2001 From: Sugar Glider Date: Wed, 5 Nov 2025 00:40:05 -0300 Subject: [PATCH 19/22] fix(matter): exclude CI failing incompatible targets --- idf_component_examples/Arduino_ESP_Matter_over_OpenThread/ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/idf_component_examples/Arduino_ESP_Matter_over_OpenThread/ci.yml b/idf_component_examples/Arduino_ESP_Matter_over_OpenThread/ci.yml index 31e60736f61..8fde8e9096c 100644 --- a/idf_component_examples/Arduino_ESP_Matter_over_OpenThread/ci.yml +++ b/idf_component_examples/Arduino_ESP_Matter_over_OpenThread/ci.yml @@ -2,7 +2,6 @@ targets: esp32s2: false esp32s3: false esp32c2: false - esp32c3: false esp32p4: false requires: - CONFIG_OPENTHREAD_ENABLED=y From de8ede2d97083b43f1bebb62e29eed9df6eefba2 Mon Sep 17 00:00:00 2001 From: Sugar Glider Date: Wed, 5 Nov 2025 07:17:20 -0300 Subject: [PATCH 20/22] fix(matter): fix cloning instructions Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .../Arduino_ESP_Matter_over_OpenThread/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/idf_component_examples/Arduino_ESP_Matter_over_OpenThread/README.md b/idf_component_examples/Arduino_ESP_Matter_over_OpenThread/README.md index 5b8db68920e..17cd43a8eb1 100644 --- a/idf_component_examples/Arduino_ESP_Matter_over_OpenThread/README.md +++ b/idf_component_examples/Arduino_ESP_Matter_over_OpenThread/README.md @@ -26,7 +26,7 @@ For Linux or MacOS: https://docs.espressif.com/projects/esp-idf/en/stable/esp32c 2- Test IDF with `idf.py --version` to check if it is installed and configured correctly. 3- To create a ESP-IDF project from this example with the latest release of Arduino-esp32, you can simply run command: -`idf.py create-project-from-example "espressif/arduino-esp32:Arduino_ESP-Matter-over-Thread_ESP32_C6"` +`idf.py create-project-from-example "espressif/arduino-esp32:Arduino_ESP_Matter_over_OpenThread"` ESP-IDF will download all dependencies needed from the component registry and setup the project for you. 4- Open an IDF terminal and execute `idf.py set-target esp32c6` (esp32c5 and esp32h2 are also possible targets) From 8ba6bf56c4d11e9f62c1e028835b7731bc16ef59 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci-lite[bot]" <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com> Date: Wed, 5 Nov 2025 11:48:23 +0000 Subject: [PATCH 21/22] ci(pre-commit): Apply automatic fixes --- .../main/CMakeLists.txt | 1 - .../main/MatterEnhancedColorLight.cpp | 2 +- .../main/idf_component.yml | 17 +-- .../partitions.csv | 20 +-- .../sdkconfig.defaults | 137 +++++++++--------- 5 files changed, 87 insertions(+), 90 deletions(-) diff --git a/idf_component_examples/Arduino_ESP_Matter_over_OpenThread/main/CMakeLists.txt b/idf_component_examples/Arduino_ESP_Matter_over_OpenThread/main/CMakeLists.txt index 80e7d4e0854..f18fa805695 100644 --- a/idf_component_examples/Arduino_ESP_Matter_over_OpenThread/main/CMakeLists.txt +++ b/idf_component_examples/Arduino_ESP_Matter_over_OpenThread/main/CMakeLists.txt @@ -1,3 +1,2 @@ idf_component_register(SRC_DIRS "." INCLUDE_DIRS ".") - diff --git a/idf_component_examples/Arduino_ESP_Matter_over_OpenThread/main/MatterEnhancedColorLight.cpp b/idf_component_examples/Arduino_ESP_Matter_over_OpenThread/main/MatterEnhancedColorLight.cpp index cff418bb164..3f4735f0d22 100644 --- a/idf_component_examples/Arduino_ESP_Matter_over_OpenThread/main/MatterEnhancedColorLight.cpp +++ b/idf_component_examples/Arduino_ESP_Matter_over_OpenThread/main/MatterEnhancedColorLight.cpp @@ -42,7 +42,7 @@ const uint8_t buttonPin = BOOT_PIN; // Set your pin here. Using BOOT Button. // Button control uint32_t button_time_stamp = 0; // debouncing control bool button_state = false; // false = released | true = pressed -const uint32_t debounceTime = 250; // button debouncing time (ms) +const uint32_t debounceTime = 250; // button debouncing time (ms) const uint32_t decommissioningTimeout = 5000; // keep the button pressed for 5s, or longer, to decommission // Set the RGB LED Light based on the current state of the Enhanced Color Light diff --git a/idf_component_examples/Arduino_ESP_Matter_over_OpenThread/main/idf_component.yml b/idf_component_examples/Arduino_ESP_Matter_over_OpenThread/main/idf_component.yml index 6d07b1eee28..233b595e654 100644 --- a/idf_component_examples/Arduino_ESP_Matter_over_OpenThread/main/idf_component.yml +++ b/idf_component_examples/Arduino_ESP_Matter_over_OpenThread/main/idf_component.yml @@ -1,9 +1,8 @@ -dependencies: - espressif/esp_matter: - version: ">=1.3.0" - require: public - espressif/arduino-esp32: - version: ">=3.1.0" - override_path: "../../../" - pre_release: true - +dependencies: + espressif/esp_matter: + version: ">=1.3.0" + require: public + espressif/arduino-esp32: + version: ">=3.1.0" + override_path: "../../../" + pre_release: true diff --git a/idf_component_examples/Arduino_ESP_Matter_over_OpenThread/partitions.csv b/idf_component_examples/Arduino_ESP_Matter_over_OpenThread/partitions.csv index c5b0dcea569..ffe5f242e76 100644 --- a/idf_component_examples/Arduino_ESP_Matter_over_OpenThread/partitions.csv +++ b/idf_component_examples/Arduino_ESP_Matter_over_OpenThread/partitions.csv @@ -1,10 +1,10 @@ -# Name, Type, SubType, Offset, Size, Flags -# Note: Firmware partition offset needs to be 64K aligned, initial 36K (9 sectors) are reserved for bootloader and partition table -esp_secure_cert, 0x3F, ,0xd000, 0x2000, encrypted -nvs, data, nvs, 0x10000, 0xC000, -nvs_keys, data, nvs_keys,, 0x1000, encrypted -otadata, data, ota, , 0x2000 -phy_init, data, phy, , 0x1000, -ota_0, app, ota_0, 0x20000, 0x1E0000, -ota_1, app, ota_1, 0x200000, 0x1E0000, -fctry, data, nvs, 0x3E0000, 0x6000 \ No newline at end of file +# Name, Type, SubType, Offset, Size, Flags +# Note: Firmware partition offset needs to be 64K aligned, initial 36K (9 sectors) are reserved for bootloader and partition table +esp_secure_cert, 0x3F, ,0xd000, 0x2000, encrypted +nvs, data, nvs, 0x10000, 0xC000, +nvs_keys, data, nvs_keys,, 0x1000, encrypted +otadata, data, ota, , 0x2000 +phy_init, data, phy, , 0x1000, +ota_0, app, ota_0, 0x20000, 0x1E0000, +ota_1, app, ota_1, 0x200000, 0x1E0000, +fctry, data, nvs, 0x3E0000, 0x6000 diff --git a/idf_component_examples/Arduino_ESP_Matter_over_OpenThread/sdkconfig.defaults b/idf_component_examples/Arduino_ESP_Matter_over_OpenThread/sdkconfig.defaults index 1dbb203daf4..aa3d5c838eb 100644 --- a/idf_component_examples/Arduino_ESP_Matter_over_OpenThread/sdkconfig.defaults +++ b/idf_component_examples/Arduino_ESP_Matter_over_OpenThread/sdkconfig.defaults @@ -1,69 +1,68 @@ -# Arduino ESP32 settings -CONFIG_BOOTLOADER_LOG_LEVEL_ERROR=y -CONFIG_AUTOSTART_ARDUINO=y -CONFIG_ARDUHAL_LOG_DEFAULT_LEVEL_INFO=y -CONFIG_FREERTOS_HZ=1000 -CONFIG_LOG_DEFAULT_LEVEL_ERROR=y - -# Enables Arduino Selective Library Compilation: Arduino Matter + Preferences Library -CONFIG_ARDUINO_SELECTIVE_COMPILATION=y -CONFIG_ARDUINO_SELECTIVE_Preferences=y -CONFIG_ARDUINO_SELECTIVE_Network=y -CONFIG_ARDUINO_SELECTIVE_ESPmDNS=y -CONFIG_ARDUINO_SELECTIVE_Matter=y - -# Flash Configuration -CONFIG_ESPTOOLPY_FLASHMODE_QIO=y -CONFIG_ESPTOOLPY_FLASH_SAMPLE_MODE_STR=y -CONFIG_ESPTOOLPY_FLASHMODE="dio" -CONFIG_ESPTOOLPY_FLASHFREQ_80M=y -CONFIG_ESPTOOLPY_FLASHFREQ="80m" -CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y -CONFIG_ESPTOOLPY_FLASHSIZE="4MB" -CONFIG_ESPTOOLPY_HEADER_FLASHSIZE_UPDATE=y -CONFIG_ESPTOOLPY_BEFORE_RESET=y -CONFIG_ESPTOOLPY_BEFORE="default_reset" -CONFIG_ESPTOOLPY_AFTER_RESET=y -CONFIG_ESPTOOLPY_AFTER="hard_reset" -CONFIG_ESPTOOLPY_MONITOR_BAUD=115200 - -# libsodium -CONFIG_LIBSODIUM_USE_MBEDTLS_SHA=y - -# NIMBLE -CONFIG_BT_ENABLED=y -CONFIG_BT_NIMBLE_ENABLED=y -CONFIG_BT_NIMBLE_EXT_ADV=n -CONFIG_BT_NIMBLE_HCI_EVT_BUF_SIZE=70 -CONFIG_USE_BLE_ONLY_FOR_COMMISSIONING=n - -# Enable OpenThread -CONFIG_OPENTHREAD_ENABLED=y -CONFIG_OPENTHREAD_SRP_CLIENT=y -CONFIG_OPENTHREAD_DNS_CLIENT=y -CONFIG_OPENTHREAD_LOG_LEVEL_DYNAMIC=n -CONFIG_OPENTHREAD_LOG_LEVEL_NOTE=y -CONFIG_OPENTHREAD_CLI=n - -# Disable lwip ipv6 autoconfig -CONFIG_LWIP_IPV6_AUTOCONFIG=n - -# Use a custom partition table -CONFIG_PARTITION_TABLE_CUSTOM=y -CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv" - -# LwIP config for OpenThread -CONFIG_LWIP_IPV6_NUM_ADDRESSES=8 -CONFIG_LWIP_MULTICAST_PING=y - -# MDNS platform -CONFIG_USE_MINIMAL_MDNS=n -CONFIG_ENABLE_EXTENDED_DISCOVERY=y - -# Disable STA and AP for ESP32C6 ==> no Wifi, thread only -CONFIG_ENABLE_WIFI_STATION=n -CONFIG_ENABLE_WIFI_AP=n - -# Enable HKDF in mbedtls -CONFIG_MBEDTLS_HKDF_C=y - +# Arduino ESP32 settings +CONFIG_BOOTLOADER_LOG_LEVEL_ERROR=y +CONFIG_AUTOSTART_ARDUINO=y +CONFIG_ARDUHAL_LOG_DEFAULT_LEVEL_INFO=y +CONFIG_FREERTOS_HZ=1000 +CONFIG_LOG_DEFAULT_LEVEL_ERROR=y + +# Enables Arduino Selective Library Compilation: Arduino Matter + Preferences Library +CONFIG_ARDUINO_SELECTIVE_COMPILATION=y +CONFIG_ARDUINO_SELECTIVE_Preferences=y +CONFIG_ARDUINO_SELECTIVE_Network=y +CONFIG_ARDUINO_SELECTIVE_ESPmDNS=y +CONFIG_ARDUINO_SELECTIVE_Matter=y + +# Flash Configuration +CONFIG_ESPTOOLPY_FLASHMODE_QIO=y +CONFIG_ESPTOOLPY_FLASH_SAMPLE_MODE_STR=y +CONFIG_ESPTOOLPY_FLASHMODE="dio" +CONFIG_ESPTOOLPY_FLASHFREQ_80M=y +CONFIG_ESPTOOLPY_FLASHFREQ="80m" +CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y +CONFIG_ESPTOOLPY_FLASHSIZE="4MB" +CONFIG_ESPTOOLPY_HEADER_FLASHSIZE_UPDATE=y +CONFIG_ESPTOOLPY_BEFORE_RESET=y +CONFIG_ESPTOOLPY_BEFORE="default_reset" +CONFIG_ESPTOOLPY_AFTER_RESET=y +CONFIG_ESPTOOLPY_AFTER="hard_reset" +CONFIG_ESPTOOLPY_MONITOR_BAUD=115200 + +# libsodium +CONFIG_LIBSODIUM_USE_MBEDTLS_SHA=y + +# NIMBLE +CONFIG_BT_ENABLED=y +CONFIG_BT_NIMBLE_ENABLED=y +CONFIG_BT_NIMBLE_EXT_ADV=n +CONFIG_BT_NIMBLE_HCI_EVT_BUF_SIZE=70 +CONFIG_USE_BLE_ONLY_FOR_COMMISSIONING=n + +# Enable OpenThread +CONFIG_OPENTHREAD_ENABLED=y +CONFIG_OPENTHREAD_SRP_CLIENT=y +CONFIG_OPENTHREAD_DNS_CLIENT=y +CONFIG_OPENTHREAD_LOG_LEVEL_DYNAMIC=n +CONFIG_OPENTHREAD_LOG_LEVEL_NOTE=y +CONFIG_OPENTHREAD_CLI=n + +# Disable lwip ipv6 autoconfig +CONFIG_LWIP_IPV6_AUTOCONFIG=n + +# Use a custom partition table +CONFIG_PARTITION_TABLE_CUSTOM=y +CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv" + +# LwIP config for OpenThread +CONFIG_LWIP_IPV6_NUM_ADDRESSES=8 +CONFIG_LWIP_MULTICAST_PING=y + +# MDNS platform +CONFIG_USE_MINIMAL_MDNS=n +CONFIG_ENABLE_EXTENDED_DISCOVERY=y + +# Disable STA and AP for ESP32C6 ==> no Wifi, thread only +CONFIG_ENABLE_WIFI_STATION=n +CONFIG_ENABLE_WIFI_AP=n + +# Enable HKDF in mbedtls +CONFIG_MBEDTLS_HKDF_C=y From 949b4ed82ac8324234afe2f1cd465003173095e8 Mon Sep 17 00:00:00 2001 From: Lucas Saavedra Vaz <32426024+lucasssvaz@users.noreply.github.com> Date: Wed, 5 Nov 2025 08:56:28 -0300 Subject: [PATCH 22/22] fix(pre-commit): Fix spelling --- .../Arduino_ESP_Matter_over_OpenThread/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/idf_component_examples/Arduino_ESP_Matter_over_OpenThread/README.md b/idf_component_examples/Arduino_ESP_Matter_over_OpenThread/README.md index 17cd43a8eb1..4c88aef7199 100644 --- a/idf_component_examples/Arduino_ESP_Matter_over_OpenThread/README.md +++ b/idf_component_examples/Arduino_ESP_Matter_over_OpenThread/README.md @@ -21,7 +21,7 @@ Edit this file to set the target versions, if necessary. https://docs.espressif.com/projects/esp-idf/en/stable/esp32c6/get-started/index.html For Windows: https://docs.espressif.com/projects/esp-idf/en/stable/esp32c6/get-started/index.html \ -For Linux or MacOS: https://docs.espressif.com/projects/esp-idf/en/stable/esp32c6/get-started/linux-macos-setup.html +For Linux or macOS: https://docs.espressif.com/projects/esp-idf/en/stable/esp32c6/get-started/linux-macos-setup.html 2- Test IDF with `idf.py --version` to check if it is installed and configured correctly.