Skip to content

Commit c669c0c

Browse files
authored
Merge branch 'master' into bugfix/fix_for_thermostat
2 parents 30f8451 + b6a1304 commit c669c0c

File tree

49 files changed

+9714
-1021
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+9714
-1021
lines changed

.github/.wordlist.txt

+1
Original file line numberDiff line numberDiff line change
@@ -1630,3 +1630,4 @@ Zigbee
16301630
zigbeealliance
16311631
zigbeethread
16321632
zsdk
1633+
TBR

.github/workflows/examples-nxp.yaml

-2
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,6 @@ jobs:
242242
./scripts/build/build_examples.py \
243243
--target nxp-rw61x-freertos-all-clusters-wifi \
244244
--target nxp-rw61x-freertos-all-clusters-thread \
245-
--target nxp-rw61x-freertos-all-clusters-thread-wifi \
246245
--target nxp-rw61x-freertos-all-clusters-wifi-ota-cmake \
247246
build \
248247
--copy-artifacts-to out/artifacts \
@@ -265,7 +264,6 @@ jobs:
265264
./scripts/build/build_examples.py \
266265
--target nxp-rw61x-freertos-laundry-washer-wifi \
267266
--target nxp-rw61x-freertos-laundry-washer-thread \
268-
--target nxp-rw61x-freertos-laundry-washer-thread-wifi \
269267
build \
270268
--copy-artifacts-to out/artifacts \
271269
"

docs/guides/nxp/nxp_otbr_guide.md

+107
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
# Thread Border Router usage
2+
3+
This document describes the use of the Thread Border router and secondary
4+
network interface for a Matter application
5+
6+
<hr>
7+
8+
- [Thread Border Router usage](#thread-border-router-usage)
9+
- [Thread Border Router overview](#thread-border-router-overview)
10+
- [Using the Thread Border Router management cluster](#using-the-thread-border-router-management-cluster)
11+
- [Using the Secondary Network commissioning interface](#using-the-secondary-network-commissioning-interface)
12+
- [Using the Thread credential sharing mechanism](#using-the-thread-credential-sharing-mechanism)
13+
14+
<hr>
15+
16+
<a name="thread-border-router-overview"></a>
17+
18+
## Thread Border Router overview
19+
20+
This section contains an overview of the Border Router architecture and
21+
describes the general use cases.
22+
23+
<a name="using-the-thread-border-router-management-cluster"></a>
24+
25+
## Using the Thread Border Router management cluster
26+
27+
The Thread Border Router management cluster allows provisioning of the Thread
28+
interface using a Matter commissioner.
29+
30+
After the device has been provisioned over WIFI the set active dataset command
31+
can be used to configure the Thread active dataset on the border router. Once
32+
the dataset is set successfully the Thread network interface will be enabled and
33+
the device will create a new PAN or join an existing one if already present.
34+
Note that this command cannot be used on a device that already has an active
35+
dataset configured. In this situation the set pending dataset command must be
36+
used instead.
37+
38+
Before using the set active dataset command a fail-safe timer must be armed
39+
(recommend using a timeout of 120 seconds):
40+
41+
```
42+
ubuntu@ubuntu:~$ ./chip-tool generalcommissioning arm-fail-safe timeout-seconds 1 node-id 0
43+
```
44+
45+
Then an active dataset in HEX TLV format (the same type used to provision a
46+
Matter over Thread device using the `ble-thread` command) can be used to
47+
provision the Border Router. What the active dataset should be is outside the
48+
scope of this README but as an example one can be obtained from the OpenThread
49+
cli on an already provisioned device using the `dataset active -x` command.
50+
51+
Note that the Thread Border Router management cluster has been set to endpoint 2
52+
in the zap file.
53+
54+
```
55+
ubuntu@ubuntu:~$ ./chip-tool threadborderroutermanagement set-active-dataset-request hex:<active-dataset> node id 2
56+
```
57+
58+
If the active dataset command is successful, a commissioning complete command
59+
must be send to disarm the fail-safe timer and commit the configuration to
60+
non-volatile storage.
61+
62+
```
63+
ubuntu@ubuntu:~$ ./chip-tool-19-jul generalcommissioning commissioning-complete node-id 0
64+
```
65+
66+
Note that this command cannot be used on a device that already has an active
67+
dataset configured. In this situation the set pending dataset command must be
68+
used instead.
69+
70+
```
71+
ubuntu@ubuntu:~$ ./chip-tool threadborderroutermanagement set-pending-dataset-request hex:<active-dataset> node id 2
72+
```
73+
74+
To read the active dataset of an already provisioned device, for example to make
75+
a joining Border Router use the same Thread network as an already configured
76+
one, the get active dataset command can be used:
77+
78+
```
79+
ubuntu@ubuntu:~$ ./chip-tool-19-jul threadborderroutermanagement get-active-dataset-request node-id 2
80+
```
81+
82+
<a name="using-the-secondary-network-commissioning-interface"></a>
83+
84+
## Using the Secondary Network commissioning interface
85+
86+
To use the secondary network commissioning interface over Thread the device must
87+
not be provisioned over WIFI. The regular `ble-thread` pairing is used as for
88+
any other Matter over Thread device. The chip-tool will read all the endpoints
89+
of the device and discover Thread network commissioning cluster on endpoint 3
90+
and use that to provision the device. As for any other Matter over Thread device
91+
a Thread Border Router is required in this case.
92+
93+
```
94+
ubuntu@ubuntu:~$ ./chip-tool pairing ble-thread node-id hex:<active-dataset> 20202021 3840
95+
```
96+
97+
<a name="using-the-thread-credential-sharing-mechanism"></a>
98+
99+
## Using the Thread credential sharing mechanism
100+
101+
The details about using the credential sharing mechanism are in the ot-nxp repo
102+
border router application
103+
[readme](https://github.com/NXP/ot-nxp/blob/v1.4.0-pvw1/examples/br/README-OTBR.md).
104+
See `Ephemeral Key functionality` section.
105+
106+
Note that all OpenThread commands executed from then Matter CLI must have
107+
`otcli` added before the command.

examples/all-clusters-app/nxp/rt/rw61x/BUILD.gn

+12-42
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,10 @@ assert(target_os == "freertos")
3535
assert(nxp_platform == "rt/rw61x")
3636

3737
declare_args() {
38-
# Allows to start the tcp download test app
39-
tcp_download = false
40-
41-
# Allows to start the wifi connect test app
42-
wifi_connect = false
43-
44-
# The 2 params below are used only if tcp_download or wifi_connect are true, otherwise they're unused.
45-
wifi_ssid = ""
46-
wifi_password = ""
38+
# Allows to connect to a predefine Wi-Fi network at boot
39+
wifi_auto_connect_at_boot = false
40+
wifi_auto_connect_at_boot_ssid = ""
41+
wifi_auto_connect_at_boot_password = ""
4742

4843
# Setup discriminator as argument
4944
setup_discriminator = 3840
@@ -53,10 +48,6 @@ example_platform_dir =
5348
"${nxp_sdk_matter_support_root}/examples/platform/${nxp_platform}"
5449
common_example_dir = "${chip_root}/examples/platform/nxp/common"
5550

56-
if (tcp_download == true && wifi_connect == true) {
57-
assert("Cannot enable tcp_download and wifi_connect at the same time!")
58-
}
59-
6051
app_common_folder = "all-clusters-app/all-clusters-common"
6152

6253
# Create here the SDK instance.
@@ -213,42 +204,21 @@ rt_executable("all_cluster_app") {
213204
]
214205
}
215206

216-
if (wifi_connect) {
207+
if (wifi_auto_connect_at_boot) {
208+
assert(wifi_auto_connect_at_boot_ssid != "" &&
209+
wifi_auto_connect_at_boot_password != "",
210+
"WiFi SSID and password must be specified at build time!")
211+
217212
defines += [
218-
"WIFI_CONNECT_TASK=1",
219-
"WIFI_CONNECT=1",
213+
"CONFIG_CHIP_APP_WIFI_CONNECT_AT_BOOT=1",
214+
"CONFIG_CHIP_APP_WIFI_SSID=\"${wifi_auto_connect_at_boot_ssid}\"",
215+
"CONFIG_CHIP_APP_WIFI_PASSWORD=\"${wifi_auto_connect_at_boot_password}\"",
220216
]
221217

222-
if (!chip_enable_matter_cli) {
223-
assert(wifi_ssid != "" && wifi_password != "",
224-
"WiFi SSID and password must be specified at build time!")
225-
}
226-
227-
if (wifi_ssid != "") {
228-
defines += [ "WIFI_SSID=\"${wifi_ssid}\"" ]
229-
}
230-
231-
if (wifi_password != "") {
232-
defines += [ "WIFI_PASSWORD=\"${wifi_password}\"" ]
233-
}
234-
235218
include_dirs += [ "${common_example_dir}/wifi_connect/include" ]
236219
sources += [ "${common_example_dir}/wifi_connect/source/WifiConnect.cpp" ]
237220
}
238221

239-
if (tcp_download) {
240-
defines += [ "CONFIG_CHIP_TCP_DOWNLOAD=1" ]
241-
defines += [
242-
"WIFI_CONNECT=1",
243-
"WIFI_SSID=\"${wifi_ssid}\"",
244-
"WIFI_PASSWORD=\"${wifi_password}\"",
245-
]
246-
247-
include_dirs += [ "${common_example_dir}/tcp_download_test/include" ]
248-
sources +=
249-
[ "${common_example_dir}/tcp_download_test/source/TcpDownload.cpp" ]
250-
}
251-
252222
# In case a dedicated assert function needs to be supported the flag sdk_fsl_assert_support should be set to false
253223
# The would add to the build a dedicated application assert implementation.
254224
if (!sdk_fsl_assert_support) {

examples/all-clusters-app/nxp/rt/rw61x/README.md

+30-5
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ commissioning and different cluster control.
1616
- [Testing the example](#testing-the-example)
1717
- [Matter Shell](#testing-the-all-clusters-application-with-matter-cli-enabled)
1818
- [OTA Software Update](#ota-software-update)
19+
- [Thread Border Router overview](#thread-border-router-overview)
1920

2021
<hr>
2122

@@ -124,8 +125,13 @@ user@ubuntu:~/Desktop/git/connectedhomeip/examples/all-clusters-app/nxp/rt/rw61x
124125

125126
#### Building with Matter over Wifi + OpenThread Border Router configuration on RW612
126127

127-
This configuration requires enabling the Matter CLI in order to control the
128-
Thread network on the Border Router.
128+
This configuration supports the Thread Border Router management cluster to
129+
provision the Thread credentials. Enabling the Matter CLI in order to control
130+
the Thread network on the Border Router is optional but recommended for other
131+
features like the Thread credential sharing.
132+
133+
Note that the Thread Border Router management cluster is only supported on the
134+
thermostat application for now.
129135

130136
- Build Matter with Border Router configuration with BLE commissioning
131137
(ble-wifi) :
@@ -142,6 +148,13 @@ out/debug/chip-rw61x-all-cluster-example.
142148

143149
Optional GN options that can be added when building an application:
144150

151+
- To enable the
152+
[secondary network commissioning interface](../../../../../docs/guides/nxp/nxp_otbr_guide.md#using-the-secondary-network-commissioning-interface),
153+
the arguments `chip_enable_secondary_nwk_if=true` and
154+
`chip_device_config_thread_network_endpoint_id=2` must be added to the _gn
155+
gen_ command. Note that this is only supported when building the Matter over
156+
Wifi + OpenThread Border Router configuration. Note that is only supported
157+
on the on the thermostat application for now.
145158
- To enable the
146159
[matter CLI](README.md#testing-the-all-clusters-application-with-matter-cli-enabled),
147160
the argument `chip_enable_matter_cli=true` must be added to the _gn gen_
@@ -265,9 +278,11 @@ The "ble-thread" pairing method can be used in order to commission the device.
265278

266279
#### Matter over wifi with openthread border router configuration :
267280

268-
In order to create or join a Thread network on the Matter Border Router, the
269-
`otcli` commands from the matter CLI can be used. For more information about
270-
using the matter shell, follow instructions from
281+
In order to create or join a Thread network on the Matter Border Router, the TBR
282+
management cluster or the `otcli` commands from the matter CLI can be used. For
283+
more information about using the TBR management cluster follow instructions from
284+
['Using the TBR management cluster'](../../../../../docs/guides/nxp/nxp_otbr_guide.md#using-the-thread-border-router-management-cluster).
285+
For more information about using the matter shell, follow instructions from
271286
['Testing the all-clusters application with Matter CLI'](#testing-the-all-clusters-application-with-matter-cli-enabled).
272287

273288
In this configuration, the device can be commissioned over Wi-Fi with the
@@ -393,3 +408,13 @@ Over-The-Air software updates are supported with the RW61x all-clusters example.
393408
The process to follow in order to perform a software update is described in the
394409
dedicated guide
395410
['Matter Over-The-Air Software Update with NXP RW61x example applications'](../../../../../docs/guides/nxp/nxp_rw61x_ota_software_update.md).
411+
412+
<a name="thread-border-router-overview"></a>
413+
414+
## Thread Border Router overview
415+
416+
To enable Thread Border Router support see the [build](README.md#building)
417+
section.
418+
419+
The complete Border Router guide is located
420+
[here](../../../../../docs/guides/nxp/nxp_otbr_guide.md).

examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter

+1
Original file line numberDiff line numberDiff line change
@@ -3464,6 +3464,7 @@ cluster DoorLock = 257 {
34643464
nullable fabric_idx creatorFabricIndex = 2;
34653465
nullable fabric_idx lastModifiedFabricIndex = 3;
34663466
nullable int16u nextCredentialIndex = 4;
3467+
optional nullable octet_string credentialData = 5;
34673468
}
34683469

34693470
request struct ClearCredentialRequest {

examples/chef/devices/rootnode_airqualitysensor_e63187f6c9.matter

+3-3
Original file line numberDiff line numberDiff line change
@@ -2613,9 +2613,9 @@ endpoint 1 {
26132613
}
26142614

26152615
server cluster TemperatureMeasurement {
2616-
persist attribute measuredValue default = 0x800;
2617-
persist attribute minMeasuredValue default = 0x800;
2618-
persist attribute maxMeasuredValue default = 0x800;
2616+
persist attribute measuredValue default = 0;
2617+
persist attribute minMeasuredValue default = -5000;
2618+
persist attribute maxMeasuredValue default = 7500;
26192619
persist attribute tolerance default = 0;
26202620
callback attribute generatedCommandList;
26212621
callback attribute acceptedCommandList;

examples/chef/devices/rootnode_airqualitysensor_e63187f6c9.zap

+3-3
Original file line numberDiff line numberDiff line change
@@ -3107,7 +3107,7 @@
31073107
"storageOption": "NVM",
31083108
"singleton": 0,
31093109
"bounded": 0,
3110-
"defaultValue": "0x800",
3110+
"defaultValue": "0",
31113111
"reportable": 1,
31123112
"minInterval": 1,
31133113
"maxInterval": 65534,
@@ -3123,7 +3123,7 @@
31233123
"storageOption": "NVM",
31243124
"singleton": 0,
31253125
"bounded": 0,
3126-
"defaultValue": "0x800",
3126+
"defaultValue": "-5000",
31273127
"reportable": 1,
31283128
"minInterval": 1,
31293129
"maxInterval": 65534,
@@ -3139,7 +3139,7 @@
31393139
"storageOption": "NVM",
31403140
"singleton": 0,
31413141
"bounded": 0,
3142-
"defaultValue": "0x800",
3142+
"defaultValue": "7500",
31433143
"reportable": 1,
31443144
"minInterval": 1,
31453145
"maxInterval": 65534,

examples/chef/devices/rootnode_doorlock_aNKYAreMXE.matter

+1
Original file line numberDiff line numberDiff line change
@@ -2301,6 +2301,7 @@ cluster DoorLock = 257 {
23012301
nullable fabric_idx creatorFabricIndex = 2;
23022302
nullable fabric_idx lastModifiedFabricIndex = 3;
23032303
nullable int16u nextCredentialIndex = 4;
2304+
optional nullable octet_string credentialData = 5;
23042305
}
23052306

23062307
request struct ClearCredentialRequest {

0 commit comments

Comments
 (0)