Skip to content

Commit

Permalink
Merge branch 'project-chip:master' into mandatoryDeviceTypes
Browse files Browse the repository at this point in the history
  • Loading branch information
paulr34 authored Sep 24, 2024
2 parents 130ee7d + 792895d commit da3cebe
Show file tree
Hide file tree
Showing 78 changed files with 10,127 additions and 1,198 deletions.
1 change: 1 addition & 0 deletions .github/.wordlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1630,3 +1630,4 @@ Zigbee
zigbeealliance
zigbeethread
zsdk
TBR
4 changes: 2 additions & 2 deletions .github/workflows/darwin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
framework:
name: Build framework
if: github.actor != 'restyled-io[bot]'
runs-on: macos-13
runs-on: macos-14
strategy:
matrix:
options: # We don't need a full matrix
Expand Down Expand Up @@ -73,7 +73,7 @@ jobs:
name: Run framework tests
if: github.actor != 'restyled-io[bot]'
needs: [framework] # serialize to avoid running to many parallel macos runners
runs-on: macos-13
runs-on: macos-14
strategy:
matrix:
options: # We don't need a full matrix
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/example-tv-casting-darwin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
tv-casting-bridge:
name: Build TV Casting Bridge example
if: github.actor != 'restyled-io[bot]'
runs-on: macos-13
runs-on: macos-14
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/examples-nxp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,6 @@ jobs:
./scripts/build/build_examples.py \
--target nxp-rw61x-freertos-all-clusters-wifi \
--target nxp-rw61x-freertos-all-clusters-thread \
--target nxp-rw61x-freertos-all-clusters-thread-wifi \
--target nxp-rw61x-freertos-all-clusters-wifi-ota-cmake \
build \
--copy-artifacts-to out/artifacts \
Expand All @@ -265,7 +264,6 @@ jobs:
./scripts/build/build_examples.py \
--target nxp-rw61x-freertos-laundry-washer-wifi \
--target nxp-rw61x-freertos-laundry-washer-thread \
--target nxp-rw61x-freertos-laundry-washer-thread-wifi \
build \
--copy-artifacts-to out/artifacts \
"
Expand Down
107 changes: 107 additions & 0 deletions docs/guides/nxp/nxp_otbr_guide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
# Thread Border Router usage

This document describes the use of the Thread Border router and secondary
network interface for a Matter application

<hr>

- [Thread Border Router usage](#thread-border-router-usage)
- [Thread Border Router overview](#thread-border-router-overview)
- [Using the Thread Border Router management cluster](#using-the-thread-border-router-management-cluster)
- [Using the Secondary Network commissioning interface](#using-the-secondary-network-commissioning-interface)
- [Using the Thread credential sharing mechanism](#using-the-thread-credential-sharing-mechanism)

<hr>

<a name="thread-border-router-overview"></a>

## Thread Border Router overview

This section contains an overview of the Border Router architecture and
describes the general use cases.

<a name="using-the-thread-border-router-management-cluster"></a>

## Using the Thread Border Router management cluster

The Thread Border Router management cluster allows provisioning of the Thread
interface using a Matter commissioner.

After the device has been provisioned over WIFI the set active dataset command
can be used to configure the Thread active dataset on the border router. Once
the dataset is set successfully the Thread network interface will be enabled and
the device will create a new PAN or join an existing one if already present.
Note that this command cannot be used on a device that already has an active
dataset configured. In this situation the set pending dataset command must be
used instead.

Before using the set active dataset command a fail-safe timer must be armed
(recommend using a timeout of 120 seconds):

```
ubuntu@ubuntu:~$ ./chip-tool generalcommissioning arm-fail-safe timeout-seconds 1 node-id 0
```

Then an active dataset in HEX TLV format (the same type used to provision a
Matter over Thread device using the `ble-thread` command) can be used to
provision the Border Router. What the active dataset should be is outside the
scope of this README but as an example one can be obtained from the OpenThread
cli on an already provisioned device using the `dataset active -x` command.

Note that the Thread Border Router management cluster has been set to endpoint 2
in the zap file.

```
ubuntu@ubuntu:~$ ./chip-tool threadborderroutermanagement set-active-dataset-request hex:<active-dataset> node id 2
```

If the active dataset command is successful, a commissioning complete command
must be send to disarm the fail-safe timer and commit the configuration to
non-volatile storage.

```
ubuntu@ubuntu:~$ ./chip-tool-19-jul generalcommissioning commissioning-complete node-id 0
```

Note that this command cannot be used on a device that already has an active
dataset configured. In this situation the set pending dataset command must be
used instead.

```
ubuntu@ubuntu:~$ ./chip-tool threadborderroutermanagement set-pending-dataset-request hex:<active-dataset> node id 2
```

To read the active dataset of an already provisioned device, for example to make
a joining Border Router use the same Thread network as an already configured
one, the get active dataset command can be used:

```
ubuntu@ubuntu:~$ ./chip-tool-19-jul threadborderroutermanagement get-active-dataset-request node-id 2
```

<a name="using-the-secondary-network-commissioning-interface"></a>

## Using the Secondary Network commissioning interface

To use the secondary network commissioning interface over Thread the device must
not be provisioned over WIFI. The regular `ble-thread` pairing is used as for
any other Matter over Thread device. The chip-tool will read all the endpoints
of the device and discover Thread network commissioning cluster on endpoint 3
and use that to provision the device. As for any other Matter over Thread device
a Thread Border Router is required in this case.

```
ubuntu@ubuntu:~$ ./chip-tool pairing ble-thread node-id hex:<active-dataset> 20202021 3840
```

<a name="using-the-thread-credential-sharing-mechanism"></a>

## Using the Thread credential sharing mechanism

The details about using the credential sharing mechanism are in the ot-nxp repo
border router application
[readme](https://github.com/NXP/ot-nxp/blob/v1.4.0-pvw1/examples/br/README-OTBR.md).
See `Ephemeral Key functionality` section.

Note that all OpenThread commands executed from then Matter CLI must have
`otcli` added before the command.
54 changes: 12 additions & 42 deletions examples/all-clusters-app/nxp/rt/rw61x/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,10 @@ assert(target_os == "freertos")
assert(nxp_platform == "rt/rw61x")

declare_args() {
# Allows to start the tcp download test app
tcp_download = false

# Allows to start the wifi connect test app
wifi_connect = false

# The 2 params below are used only if tcp_download or wifi_connect are true, otherwise they're unused.
wifi_ssid = ""
wifi_password = ""
# Allows to connect to a predefine Wi-Fi network at boot
wifi_auto_connect_at_boot = false
wifi_auto_connect_at_boot_ssid = ""
wifi_auto_connect_at_boot_password = ""

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

if (tcp_download == true && wifi_connect == true) {
assert("Cannot enable tcp_download and wifi_connect at the same time!")
}

app_common_folder = "all-clusters-app/all-clusters-common"

# Create here the SDK instance.
Expand Down Expand Up @@ -213,42 +204,21 @@ rt_executable("all_cluster_app") {
]
}

if (wifi_connect) {
if (wifi_auto_connect_at_boot) {
assert(wifi_auto_connect_at_boot_ssid != "" &&
wifi_auto_connect_at_boot_password != "",
"WiFi SSID and password must be specified at build time!")

defines += [
"WIFI_CONNECT_TASK=1",
"WIFI_CONNECT=1",
"CONFIG_CHIP_APP_WIFI_CONNECT_AT_BOOT=1",
"CONFIG_CHIP_APP_WIFI_SSID=\"${wifi_auto_connect_at_boot_ssid}\"",
"CONFIG_CHIP_APP_WIFI_PASSWORD=\"${wifi_auto_connect_at_boot_password}\"",
]

if (!chip_enable_matter_cli) {
assert(wifi_ssid != "" && wifi_password != "",
"WiFi SSID and password must be specified at build time!")
}

if (wifi_ssid != "") {
defines += [ "WIFI_SSID=\"${wifi_ssid}\"" ]
}

if (wifi_password != "") {
defines += [ "WIFI_PASSWORD=\"${wifi_password}\"" ]
}

include_dirs += [ "${common_example_dir}/wifi_connect/include" ]
sources += [ "${common_example_dir}/wifi_connect/source/WifiConnect.cpp" ]
}

if (tcp_download) {
defines += [ "CONFIG_CHIP_TCP_DOWNLOAD=1" ]
defines += [
"WIFI_CONNECT=1",
"WIFI_SSID=\"${wifi_ssid}\"",
"WIFI_PASSWORD=\"${wifi_password}\"",
]

include_dirs += [ "${common_example_dir}/tcp_download_test/include" ]
sources +=
[ "${common_example_dir}/tcp_download_test/source/TcpDownload.cpp" ]
}

# In case a dedicated assert function needs to be supported the flag sdk_fsl_assert_support should be set to false
# The would add to the build a dedicated application assert implementation.
if (!sdk_fsl_assert_support) {
Expand Down
35 changes: 30 additions & 5 deletions examples/all-clusters-app/nxp/rt/rw61x/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ commissioning and different cluster control.
- [Testing the example](#testing-the-example)
- [Matter Shell](#testing-the-all-clusters-application-with-matter-cli-enabled)
- [OTA Software Update](#ota-software-update)
- [Thread Border Router overview](#thread-border-router-overview)

<hr>

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

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

This configuration requires enabling the Matter CLI in order to control the
Thread network on the Border Router.
This configuration supports the Thread Border Router management cluster to
provision the Thread credentials. Enabling the Matter CLI in order to control
the Thread network on the Border Router is optional but recommended for other
features like the Thread credential sharing.

Note that the Thread Border Router management cluster is only supported on the
thermostat application for now.

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

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

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

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

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

In this configuration, the device can be commissioned over Wi-Fi with the
Expand Down Expand Up @@ -393,3 +408,13 @@ Over-The-Air software updates are supported with the RW61x all-clusters example.
The process to follow in order to perform a software update is described in the
dedicated guide
['Matter Over-The-Air Software Update with NXP RW61x example applications'](../../../../../docs/guides/nxp/nxp_rw61x_ota_software_update.md).

<a name="thread-border-router-overview"></a>

## Thread Border Router overview

To enable Thread Border Router support see the [build](README.md#building)
section.

The complete Border Router guide is located
[here](../../../../../docs/guides/nxp/nxp_otbr_guide.md).
Original file line number Diff line number Diff line change
Expand Up @@ -3464,6 +3464,7 @@ cluster DoorLock = 257 {
nullable fabric_idx creatorFabricIndex = 2;
nullable fabric_idx lastModifiedFabricIndex = 3;
nullable int16u nextCredentialIndex = 4;
optional nullable octet_string credentialData = 5;
}

request struct ClearCredentialRequest {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2613,9 +2613,9 @@ endpoint 1 {
}

server cluster TemperatureMeasurement {
persist attribute measuredValue default = 0x800;
persist attribute minMeasuredValue default = 0x800;
persist attribute maxMeasuredValue default = 0x800;
persist attribute measuredValue default = 0;
persist attribute minMeasuredValue default = -5000;
persist attribute maxMeasuredValue default = 7500;
persist attribute tolerance default = 0;
callback attribute generatedCommandList;
callback attribute acceptedCommandList;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3107,7 +3107,7 @@
"storageOption": "NVM",
"singleton": 0,
"bounded": 0,
"defaultValue": "0x800",
"defaultValue": "0",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
Expand All @@ -3123,7 +3123,7 @@
"storageOption": "NVM",
"singleton": 0,
"bounded": 0,
"defaultValue": "0x800",
"defaultValue": "-5000",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
Expand All @@ -3139,7 +3139,7 @@
"storageOption": "NVM",
"singleton": 0,
"bounded": 0,
"defaultValue": "0x800",
"defaultValue": "7500",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
Expand Down
1 change: 1 addition & 0 deletions examples/chef/devices/rootnode_doorlock_aNKYAreMXE.matter
Original file line number Diff line number Diff line change
Expand Up @@ -2301,6 +2301,7 @@ cluster DoorLock = 257 {
nullable fabric_idx creatorFabricIndex = 2;
nullable fabric_idx lastModifiedFabricIndex = 3;
nullable int16u nextCredentialIndex = 4;
optional nullable octet_string credentialData = 5;
}

request struct ClearCredentialRequest {
Expand Down
Loading

0 comments on commit da3cebe

Please sign in to comment.