Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[OTA] Update matter-devices.xml for OTA devices, update README for the OTA Requestor #13718

Merged
merged 9 commits into from
Jan 21, 2022
22 changes: 16 additions & 6 deletions examples/ota-requestor-app/efr32/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#CHIP EFR32 OTA Requestor Example
# CHIP EFR32 OTA Requestor Example

An example showing the use of the Matter OTA Requestor functionality on the
Silicon Labs EFR32 MG12.
Expand All @@ -9,7 +9,7 @@ Silicon Labs EFR32 MG12.

The EFR32 OTA Requestor example provides a baseline demonstration the Matter OTA
Requestor functionality built with the Silicon Labs gecko SDK. It can be
controlled by a Chip controller over Openthread network..
controlled by a Chip controller over Open thread network..
selissia marked this conversation as resolved.
Show resolved Hide resolved

<a name="building"></a>

Expand Down Expand Up @@ -48,6 +48,8 @@ examples/lighting-app/efr32/README.md
$ cd ~/connectedhomeip
$ rm -rf ./out/

<a name="Flashing the Application"></a>

## Flashing the Application

- On the command line:
Expand All @@ -61,7 +63,9 @@ examples/lighting-app/efr32/README.md

## Viewing Logging Output

See examples/lighting-app/efr32/README.md
See `examples/lighting-app/efr32/README.md`

<a name="Running the OTA Download scenario"></a>

## Running the OTA Download scenario

Expand All @@ -74,10 +78,14 @@ See examples/lighting-app/efr32/README.md
scripts/examples/gn_build_example.sh examples/chip-tool out/
scripts/examples/gn_build_example.sh examples/ota-provider-app/linux out/debug chip_config_network_layer_ble=false

- In a terminal start the provider app passing to it the path to the image
file that the Requestor is supposed to download (for example /tmp/ota.out):
- Create a bootable image file:

commander gbl create chip-efr32-ota-requestor-example.gbl --app chip-efr32-ota-requestor-example.s37

- In a terminal start the provider app passing to it the path to the bootable
image file created in the previous step:

./out/debug/chip-ota-provider-app -f /tmp/ota.out
./out/debug/chip-ota-provider-app -f chip-efr32-ota-requestor-example.gbl

- In a separate terminal run the chip-tool commands to provision the Provider:

Expand All @@ -98,3 +106,5 @@ where operationalDataset is obtained from the Open Thread Border Router.
./out/chip-tool otasoftwareupdaterequestor announce-ota-provider 1 0 0 0 2 0

- The Requestor will connect to the Provider and start the image download.
Once the image is downloaded the Requestor will reboot into the downloaded
image.
36 changes: 31 additions & 5 deletions examples/ota-requestor-app/linux/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,37 @@ In terminal 2:
- `${REQUESTOR_LONG_DISCRIMINATOR}` is the long discriminator of the
ota-requestor-app specified in terminal 3 above

```
./chip-tool otasoftwareupdaterequestor announce-ota-provider ${NODE_ID_TO_ASSIGN_PROVIDER} 0 0 0 ${NODE_ID_TO_ASSIGN_REQUESTOR} 0
selissia marked this conversation as resolved.
Show resolved Hide resolved
```

## Note

When the Provider, Requestor and chip-tool are run on the same Linux node the
user must issue `rm -r /tmp/chip_*` before starting the Provider and
`rm /tmp/chip_kvs` before starting the Requestor. These commands reset the
shared Key Value Store to a consistent state.

## Example

Building:

```
scripts/examples/gn_build_example.sh examples/chip-tool out/ chip_config_network_layer_ble=false && scripts/examples/gn_build_example.sh examples/ota-provider-app/linux out/debug chip_config_network_layer_ble=false && scripts/examples/gn_build_example.sh examples/ota-requestor-app/linux out/debug chip_config_network_layer_ble=false
```

Running (in separate terminals as described above):

```
rm -r /tmp/chip_*
./out/debug/chip-ota-provider-app -f /tmp/ota.txt
./out/chip-tool pairing onnetwork 1 20202021
rm /tmp/chip_kvs
./out/debug/chip-ota-requestor-app -u 5560 -d 42
./out/chip-tool pairing onnetwork-long 2 20202021 42
./out/chip-tool otasoftwareupdaterequestor announce-ota-provider 1 0 0 0 2 0
```

## Current Features / Limitations

### Features
Expand All @@ -68,10 +99,5 @@ In terminal 2:

### Limitations

- Needs chip-tool to commission the OTA Provider device first because the Node
ID and IP Address of the OTA Provider must be supplied to this reference
application
- Does not verify QueryImageResponse message contents
- Stores the downloaded file in the directory this reference app is launched
from
- Does not support AnnounceOTAProvider command or OTA Requestor attributes
7 changes: 4 additions & 3 deletions src/app/zap-templates/zcl/data-model/chip/matter-devices.xml
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,9 @@ limitations under the License.
</clusters>
</deviceType>
<deviceType>
<name>MA-otarequester</name>
<name>MA-otarequestor</name>
<domain>CHIP</domain>
<typeName>Matter OTA Requester</typeName>
<typeName>Matter OTA Requestor</typeName>
<profileId editable="false">0x0103</profileId>
<deviceId editable="false">0x0012</deviceId>
<clusters lockOthers="true">
Expand All @@ -129,7 +129,7 @@ limitations under the License.
<requireAttribute>BINDING</requireAttribute>
</include>
<include cluster="OTA Software Update Requestor" client="false" server="true" clientLocked="true" serverLocked="true"></include>
<include cluster="OTA Software Update Provider" client="false" server="true" clientLocked="true" serverLocked="true"></include>
<include cluster="OTA Software Update Provider" client="true" server="false" clientLocked="true" serverLocked="true"></include>
</clusters>
</deviceType>
<deviceType>
Expand All @@ -156,6 +156,7 @@ limitations under the License.
<requireAttribute>BINDING</requireAttribute>
</include>
<include cluster="OTA Software Update Provider" client="false" server="true" clientLocked="true" serverLocked="true"></include>
<include cluster="OTA Software Update Requestor" client="true" server="false" clientLocked="true" serverLocked="true"></include>
</clusters>
</deviceType>
<deviceType>
Expand Down