Skip to content

Commit 2dd56d1

Browse files
ci(pre-commit): Apply automatic fixes
1 parent ed71437 commit 2dd56d1

14 files changed

+746
-802
lines changed

idf_component_examples/esp_matter_light/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,3 @@ idf_build_set_property(C_COMPILE_OPTIONS "-Os" APPEND)
2525
# For RISCV chips, project_include.cmake sets -Wno-format, but does not clear various
2626
# flags that depend on -Wformat
2727
idf_build_set_property(COMPILE_OPTIONS "-Wno-format-nonliteral;-Wno-format-security" APPEND)
28-
Lines changed: 90 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -1,90 +1,90 @@
1-
| Supported Targets | ESP32-S3 | ESP32-C3 | ESP32-C6 |
2-
| ----------------- | -------- | -------- | -------- |
3-
4-
5-
# Managed Component Light
6-
7-
This example is configured by default to work with the ESP32-S3, which has the RGB LED GPIO set as pin 48 and the BOOT button on GPIO 0.
8-
9-
This example creates a Color Temperature Light device using the esp_matter component downloaded from the [Espressif Component Registry](https://components.espressif.com/) instead of an extra component locally, so the example can work without setting up the esp-matter environment.
10-
11-
See the [docs](https://docs.espressif.com/projects/esp-matter/en/latest/esp32/developing.html) for more information about building and flashing the firmware.
12-
13-
The code is based on the Arduino API and uses Arduino as an IDF Component.
14-
15-
## How to use it
16-
17-
Once the device runs for the first time, it must be commissioned to the Matter Fabric of the available Matter Environment.
18-
Possible Matter Environments are:
19-
- Amazon Alexa
20-
- Google Home Assistant (*)
21-
- Apple Home
22-
- Open Source Home Assistant
23-
24-
(*) Google Home Assistant requires the user to set up a Matter Light using the [Google Home Developer Console](https://developers.home.google.com/codelabs/matter-device#2). It is necessary to create a Matter Light device with VID = 0xFFF1 and PID = 0x8000. Otherwise, the Light won't show up in the GHA APP. This action is necessary because the Firmware uses Testing credentials and Google requires the user to create the testing device before using it.
25-
26-
There is no QR Code to be used when the Smartphone APP wants to add the Matter Device.
27-
Please enter the code manually: `34970112332`
28-
29-
The devboard has a built-in LED that will be used as the Matter Light.
30-
The default setting of the code uses pin 48 for the ESP32-S3.
31-
Please change it in `main/matter_accessory_driver.h` or in the `sdkconfig.defaults.<SOC>` file.
32-
33-
## LED Status and Factory Mode
34-
35-
The WS2812b built-in LED will turn purple as soon as the device is flashed and runs for the first time.
36-
The purple color indicates that the Matter Accessory has not been commissioned yet.
37-
After using a Matter provider Smartphone APP to add a Matter device to your Home Application, it may turn orange to indicate that it has no WiFi connection.
38-
39-
Once it connects to the WiFi network, the LED will turn white to indicate that Matter is working and the device is connected to the Matter Environment.
40-
Please note that Matter over WiFi using an ESP32 device will connect to a 2.4GHz WiFi SSID, therefore the Commissioner APP Smartphone shall be connected to this SSID.
41-
42-
The Matter and WiFi configuration will be stored in NVS to ensure that it will connect to the Matter Fabric and WiFi Network again once it is reset.
43-
44-
The Matter Smartphone APP will control the light state (ON/OFF), temperature (Warm/Cold White), and brightness.
45-
46-
## On Board Light toggle button
47-
48-
The built-in BOOT button will toggle On/Off and replicate the new state to the Matter Environment, making it visible in the Matter Smartphone APP as well.
49-
50-
## Returning to the Factory State
51-
52-
Holding the BOOT button pressed for more than 10 seconds and then releasing it will erase all Matter and WiFi configuration, forcing it to reset to factory state. After that, the device needs to be commissioned again. Previous setups done in the Smartphone APP won't work again; therefore, the virtual device shall be removed from the APP.
53-
54-
## Building the Application using WiFi and Matter
55-
56-
Use ESP-IDF 5.1.4 from https://github.com/espressif/esp-idf/tree/release/v5.1
57-
This example has been tested with Arduino Core 3.0.4
58-
59-
The project will download all necessary components, inluding the Arduino Core.
60-
Run `idf.py SDKCONFIG_DEFAULTS="sdkconfig.defaults.<SOC>.idf" -p <PORT> flash monitor`
61-
62-
Example for ESP32-S3/Linux|MacOS:
63-
`idf.py SDKCONFIG_DEFAULTS="sdkconfig.defaults.esp32s3" -p /dev/ttyACM0 flash monitor`
64-
Example for ESP32-C3/Windows:
65-
`idf.py -D SDKCONFIG_DEFAULTS="sdkconfig.defaults.esp32c3" -p com3 flash monitor`
66-
67-
It may be necessary to delete some folders and files before running `idf.py`
68-
Linux/MacOS: `rm -rf build managed_components sdkconfig dependencies.lock`
69-
Windows: `rmdir /s/q build managed_components` and `del sdkconfig dependencies.lock`
70-
71-
There is a configuration file for these SoC: esp32s3, esp32c3, esp32c6.
72-
Those are the tested devices that have a WS2812 RGB LED and can run BLE, WiFi and Matter.
73-
74-
In case it is necessary to change the Button Pin or the REG LED Pin, please use the `menuconfig`
75-
`idf.py menuconfig` and change the Menu Option `Light Matter Accessory`
76-
77-
## Using OpenThread with Matter
78-
79-
This is possible with the ESP32-C6.
80-
It is neessasy to have a Thread Border Routed in the Matter Environment. Check you matter hardware provider.
81-
In order to build the application that will use Thread Networking instead of WiFi, please execute:
82-
83-
Example for ESP32-S3/Linux|MacOS:
84-
`idf.py SDKCONFIG_DEFAULTS="sdkconfig.defaults.c6_thread" -p /dev/ttyACM0 flash monitor`
85-
Example for ESP32-C3/Windows:
86-
`idf.py -D SDKCONFIG_DEFAULTS="sdkconfig.defaults.c6_thread" -p com3 flash monitor`
87-
88-
It may be necessary to delete some folders and files before running `idf.py`
89-
Linux/MacOS: `rm -rf build managed_components sdkconfig dependencies.lock`
90-
Windows: `rmdir /s/q build managed_components` and `del sdkconfig dependencies.lock`
1+
| Supported Targets | ESP32-S3 | ESP32-C3 | ESP32-C6 |
2+
| ----------------- | -------- | -------- | -------- |
3+
4+
5+
# Managed Component Light
6+
7+
This example is configured by default to work with the ESP32-S3, which has the RGB LED GPIO set as pin 48 and the BOOT button on GPIO 0.
8+
9+
This example creates a Color Temperature Light device using the esp_matter component downloaded from the [Espressif Component Registry](https://components.espressif.com/) instead of an extra component locally, so the example can work without setting up the esp-matter environment.
10+
11+
See the [docs](https://docs.espressif.com/projects/esp-matter/en/latest/esp32/developing.html) for more information about building and flashing the firmware.
12+
13+
The code is based on the Arduino API and uses Arduino as an IDF Component.
14+
15+
## How to use it
16+
17+
Once the device runs for the first time, it must be commissioned to the Matter Fabric of the available Matter Environment.
18+
Possible Matter Environments are:
19+
- Amazon Alexa
20+
- Google Home Assistant (*)
21+
- Apple Home
22+
- Open Source Home Assistant
23+
24+
(*) Google Home Assistant requires the user to set up a Matter Light using the [Google Home Developer Console](https://developers.home.google.com/codelabs/matter-device#2). It is necessary to create a Matter Light device with VID = 0xFFF1 and PID = 0x8000. Otherwise, the Light won't show up in the GHA APP. This action is necessary because the Firmware uses Testing credentials and Google requires the user to create the testing device before using it.
25+
26+
There is no QR Code to be used when the Smartphone APP wants to add the Matter Device.
27+
Please enter the code manually: `34970112332`
28+
29+
The devboard has a built-in LED that will be used as the Matter Light.
30+
The default setting of the code uses pin 48 for the ESP32-S3.
31+
Please change it in `main/matter_accessory_driver.h` or in the `sdkconfig.defaults.<SOC>` file.
32+
33+
## LED Status and Factory Mode
34+
35+
The WS2812b built-in LED will turn purple as soon as the device is flashed and runs for the first time.
36+
The purple color indicates that the Matter Accessory has not been commissioned yet.
37+
After using a Matter provider Smartphone APP to add a Matter device to your Home Application, it may turn orange to indicate that it has no WiFi connection.
38+
39+
Once it connects to the WiFi network, the LED will turn white to indicate that Matter is working and the device is connected to the Matter Environment.
40+
Please note that Matter over WiFi using an ESP32 device will connect to a 2.4GHz WiFi SSID, therefore the Commissioner APP Smartphone shall be connected to this SSID.
41+
42+
The Matter and WiFi configuration will be stored in NVS to ensure that it will connect to the Matter Fabric and WiFi Network again once it is reset.
43+
44+
The Matter Smartphone APP will control the light state (ON/OFF), temperature (Warm/Cold White), and brightness.
45+
46+
## On Board Light toggle button
47+
48+
The built-in BOOT button will toggle On/Off and replicate the new state to the Matter Environment, making it visible in the Matter Smartphone APP as well.
49+
50+
## Returning to the Factory State
51+
52+
Holding the BOOT button pressed for more than 10 seconds and then releasing it will erase all Matter and WiFi configuration, forcing it to reset to factory state. After that, the device needs to be commissioned again. Previous setups done in the Smartphone APP won't work again; therefore, the virtual device shall be removed from the APP.
53+
54+
## Building the Application using WiFi and Matter
55+
56+
Use ESP-IDF 5.1.4 from https://github.com/espressif/esp-idf/tree/release/v5.1
57+
This example has been tested with Arduino Core 3.0.4
58+
59+
The project will download all necessary components, inluding the Arduino Core.
60+
Run `idf.py SDKCONFIG_DEFAULTS="sdkconfig.defaults.<SOC>.idf" -p <PORT> flash monitor`
61+
62+
Example for ESP32-S3/Linux|MacOS:
63+
`idf.py SDKCONFIG_DEFAULTS="sdkconfig.defaults.esp32s3" -p /dev/ttyACM0 flash monitor`
64+
Example for ESP32-C3/Windows:
65+
`idf.py -D SDKCONFIG_DEFAULTS="sdkconfig.defaults.esp32c3" -p com3 flash monitor`
66+
67+
It may be necessary to delete some folders and files before running `idf.py`
68+
Linux/MacOS: `rm -rf build managed_components sdkconfig dependencies.lock`
69+
Windows: `rmdir /s/q build managed_components` and `del sdkconfig dependencies.lock`
70+
71+
There is a configuration file for these SoC: esp32s3, esp32c3, esp32c6.
72+
Those are the tested devices that have a WS2812 RGB LED and can run BLE, WiFi and Matter.
73+
74+
In case it is necessary to change the Button Pin or the REG LED Pin, please use the `menuconfig`
75+
`idf.py menuconfig` and change the Menu Option `Light Matter Accessory`
76+
77+
## Using OpenThread with Matter
78+
79+
This is possible with the ESP32-C6.
80+
It is neessasy to have a Thread Border Routed in the Matter Environment. Check you matter hardware provider.
81+
In order to build the application that will use Thread Networking instead of WiFi, please execute:
82+
83+
Example for ESP32-S3/Linux|MacOS:
84+
`idf.py SDKCONFIG_DEFAULTS="sdkconfig.defaults.c6_thread" -p /dev/ttyACM0 flash monitor`
85+
Example for ESP32-C3/Windows:
86+
`idf.py -D SDKCONFIG_DEFAULTS="sdkconfig.defaults.c6_thread" -p com3 flash monitor`
87+
88+
It may be necessary to delete some folders and files before running `idf.py`
89+
Linux/MacOS: `rm -rf build managed_components sdkconfig dependencies.lock`
90+
Windows: `rmdir /s/q build managed_components` and `del sdkconfig dependencies.lock`

idf_component_examples/esp_matter_light/main/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ idf_component_register(SRC_DIRS "."
22
INCLUDE_DIRS ".")
33

44
set_property(TARGET ${COMPONENT_LIB} PROPERTY CXX_STANDARD 17)
5-
target_compile_options(${COMPONENT_LIB} PRIVATE "-DCHIP_HAVE_CONFIG_H")
5+
target_compile_options(${COMPONENT_LIB} PRIVATE "-DCHIP_HAVE_CONFIG_H")
Lines changed: 102 additions & 102 deletions
Original file line numberDiff line numberDiff line change
@@ -1,102 +1,102 @@
1-
menu "Light Matter Accessory"
2-
menu "On Board Light ON/OFF Button"
3-
config BUTTON_PIN
4-
int
5-
prompt "Button 1 GPIO"
6-
default ENV_GPIO_BOOT_BUTTON
7-
range -1 ENV_GPIO_IN_RANGE_MAX
8-
help
9-
The GPIO pin for button that will be used to turn on/off the Matter Light. It shall be connected to a push button. It can use the BOOT button of the development board.
10-
endmenu
11-
12-
13-
menu "LEDs"
14-
config WS2812_PIN
15-
int
16-
prompt "WS2812 RGB LED GPIO"
17-
default ENV_GPIO_RGB_LED
18-
range -1 ENV_GPIO_OUT_RANGE_MAX
19-
help
20-
The GPIO pin for the Matter Light that will be driven by RMT. It shall be connected to one single WS2812 RGB LED.
21-
endmenu
22-
23-
# TARGET CONFIGURATION
24-
if IDF_TARGET_ESP32C3
25-
config ENV_GPIO_RANGE_MIN
26-
int
27-
default 0
28-
29-
config ENV_GPIO_RANGE_MAX
30-
int
31-
default 19
32-
# GPIOs 20/21 are always used by UART in examples
33-
34-
config ENV_GPIO_IN_RANGE_MAX
35-
int
36-
default ENV_GPIO_RANGE_MAX
37-
38-
config ENV_GPIO_OUT_RANGE_MAX
39-
int
40-
default ENV_GPIO_RANGE_MAX
41-
42-
config ENV_GPIO_BOOT_BUTTON
43-
int
44-
default 9
45-
46-
config ENV_GPIO_RGB_LED
47-
int
48-
default 8
49-
endif
50-
if IDF_TARGET_ESP32C6
51-
config ENV_GPIO_RANGE_MIN
52-
int
53-
default 0
54-
55-
config ENV_GPIO_RANGE_MAX
56-
int
57-
default 30
58-
# GPIOs 16/17 are always used by UART in examples
59-
60-
config ENV_GPIO_IN_RANGE_MAX
61-
int
62-
default ENV_GPIO_RANGE_MAX
63-
64-
config ENV_GPIO_OUT_RANGE_MAX
65-
int
66-
default ENV_GPIO_RANGE_MAX
67-
68-
config ENV_GPIO_BOOT_BUTTON
69-
int
70-
default 9
71-
72-
config ENV_GPIO_RGB_LED
73-
int
74-
default 8
75-
endif
76-
if IDF_TARGET_ESP32S3
77-
config ENV_GPIO_RANGE_MIN
78-
int
79-
default 0
80-
81-
config ENV_GPIO_RANGE_MAX
82-
int
83-
default 48
84-
85-
config ENV_GPIO_IN_RANGE_MAX
86-
int
87-
default ENV_GPIO_RANGE_MAX
88-
89-
config ENV_GPIO_OUT_RANGE_MAX
90-
int
91-
default ENV_GPIO_RANGE_MAX
92-
93-
config ENV_GPIO_BOOT_BUTTON
94-
int
95-
default 0
96-
97-
config ENV_GPIO_RGB_LED
98-
int
99-
default 48
100-
endif
101-
102-
endmenu
1+
menu "Light Matter Accessory"
2+
menu "On Board Light ON/OFF Button"
3+
config BUTTON_PIN
4+
int
5+
prompt "Button 1 GPIO"
6+
default ENV_GPIO_BOOT_BUTTON
7+
range -1 ENV_GPIO_IN_RANGE_MAX
8+
help
9+
The GPIO pin for button that will be used to turn on/off the Matter Light. It shall be connected to a push button. It can use the BOOT button of the development board.
10+
endmenu
11+
12+
13+
menu "LEDs"
14+
config WS2812_PIN
15+
int
16+
prompt "WS2812 RGB LED GPIO"
17+
default ENV_GPIO_RGB_LED
18+
range -1 ENV_GPIO_OUT_RANGE_MAX
19+
help
20+
The GPIO pin for the Matter Light that will be driven by RMT. It shall be connected to one single WS2812 RGB LED.
21+
endmenu
22+
23+
# TARGET CONFIGURATION
24+
if IDF_TARGET_ESP32C3
25+
config ENV_GPIO_RANGE_MIN
26+
int
27+
default 0
28+
29+
config ENV_GPIO_RANGE_MAX
30+
int
31+
default 19
32+
# GPIOs 20/21 are always used by UART in examples
33+
34+
config ENV_GPIO_IN_RANGE_MAX
35+
int
36+
default ENV_GPIO_RANGE_MAX
37+
38+
config ENV_GPIO_OUT_RANGE_MAX
39+
int
40+
default ENV_GPIO_RANGE_MAX
41+
42+
config ENV_GPIO_BOOT_BUTTON
43+
int
44+
default 9
45+
46+
config ENV_GPIO_RGB_LED
47+
int
48+
default 8
49+
endif
50+
if IDF_TARGET_ESP32C6
51+
config ENV_GPIO_RANGE_MIN
52+
int
53+
default 0
54+
55+
config ENV_GPIO_RANGE_MAX
56+
int
57+
default 30
58+
# GPIOs 16/17 are always used by UART in examples
59+
60+
config ENV_GPIO_IN_RANGE_MAX
61+
int
62+
default ENV_GPIO_RANGE_MAX
63+
64+
config ENV_GPIO_OUT_RANGE_MAX
65+
int
66+
default ENV_GPIO_RANGE_MAX
67+
68+
config ENV_GPIO_BOOT_BUTTON
69+
int
70+
default 9
71+
72+
config ENV_GPIO_RGB_LED
73+
int
74+
default 8
75+
endif
76+
if IDF_TARGET_ESP32S3
77+
config ENV_GPIO_RANGE_MIN
78+
int
79+
default 0
80+
81+
config ENV_GPIO_RANGE_MAX
82+
int
83+
default 48
84+
85+
config ENV_GPIO_IN_RANGE_MAX
86+
int
87+
default ENV_GPIO_RANGE_MAX
88+
89+
config ENV_GPIO_OUT_RANGE_MAX
90+
int
91+
default ENV_GPIO_RANGE_MAX
92+
93+
config ENV_GPIO_BOOT_BUTTON
94+
int
95+
default 0
96+
97+
config ENV_GPIO_RGB_LED
98+
int
99+
default 48
100+
endif
101+
102+
endmenu

0 commit comments

Comments
 (0)