Matter OTA Test

[中文]

This section describes the process of conducting Matter OTA tests using the chip-ota-provider-app . The chip-ota-provider-app simulates a Matter OTA provider , sending OTA data to devices. The Beken device acts as the Matter OTA requestor and receives the OTA data.

The OTA process involves using chip-ota-provider-app on a Raspberry Pi to simulate a provider . Then, a new Raspberry Pi terminal is opened as the commissioner . In this new commissioner terminal , the simulated provider from the previous terminal must be commissioningly paired with the network, as well as the Beken device , to ensure both are on the same Fabric network. Once the provider is networked, the commissioner terminal needs to configure the provider’s ACL access permissions. It then informs the Beken device that a provider exists, initiating the OTA process.

1. Create OTA Upgrade Package

Use the RBL file automatically generated during compilation and packaging to create a Matter OTA file. The compiled RBL file is generally located at a path similar to build/matter/bk7236/encrypt/app_pack.rbl, depending on the specific project. Execute the following command to generate the OTA file.

Note: The -vn version number set here must be higher than the version number in the Beken device; otherwise, the software will not be upgraded.

cd components/matter/connectedhomeip
./src/app/ota_image_tool.py create -v 0xDEAD -p 0xBEEF -vn 2 -vs "2.0" -da sha256 app_pack.rbl app_pack.ota

-v : vid

-p : pid

-vn : Software version number

-vs : Software version number, string format

app_pack.ota : The generated Matter OTA file

2. Start the Provider

Execute the following command in the provider terminal. The provider is also a Matter device; It provides OTA image downloads for other devices.

./chip-ota-provider-app --discriminator 3855 --secured-device-port 5551 --KVS ./prokvs --filepath app_pack.ota -q updateAvailable

–KVS ./prokvs: Set the KVS storage path; this file must be deleted before starting a new provider each time

–filepath app_pack.ota : The OTA file to be upgraded

3. Add provider to Matter fabric

Execute the following command in the commissioner terminal, with the provider’s node id being 3.

./chip-tool pairing onnetwork-long 3 20202021 3855

4. Grant provider permissions

Execute the following command in the commissioner terminal.

./chip-tool accesscontrol write acl '[{"fabricIndex": 1, "privilege": 5, "authMode": 2, "subjects": [112233], "targets": null}, {"fabricIndex": 1, "privilege": 3, "authMode": 2, "subjects": null, "targets": [{"cluster": 41, "endpoint": null, "deviceType": null}]}]' 3 0

5. Start the device and commissioning

Execute the following command in the commissioner terminal, with the Beken device’s node id being 1.

Beken device’s commissioning information should be filled in according to the actual parameters.

./chip-tool pairing ble-wifi 1 wifi_ssid wifi_pw 20202021 3840

6. Start ota upgrade

Execute the following command in the commissioner terminal to initiate the OTA notification.

./chip-tool otasoftwareupdaterequestor announce-ota-provider 3 0 0 0 1 0

7. Confirm version number after OTA

After the OTA process, execute the following command in the commissioner terminal to check whether the version number in the Beken device has been updated.

./chip-tool basic read software-version 1  0

Also, enter a command similar to ‘version get’ in the Beken device’s serial terminal to confirm whether there is the new version firmware.