A prototype application that demonstrates OTA Requestor capabilities.
Pull docker image:
$ docker pull ghcr.io/project-chip/chip-build-ameba:50
Run docker container:
$ docker run -it -v ${CHIP_DIR}:/root/chip ghcr.io/project-chip/chip-build-ameba:50
Setup build environment:
$ source ./scripts/bootstrap.sh
To build the demo application:
$ ./scripts/build/build_examples.py --target ameba-amebad-ota-requestor build
The output image files are stored in out/ameba-amebad-ota-requestor/asdk/image
folder.
The bootloader image files are stored in out/ameba-amebad-ota-requestor/asdk/bootloader
folder.
After building the application, Ameba Image Tool is used to flash it to Ameba board.
Commission Ameba (ota-requestor-app) using chip-tool
$ ./chip-tool pairing ble-wifi 1 <SSID> <PASSWORD> 20202021 3840
Launch the linux ota-provider-app and provide the SW_IMAGE_FILE
$ ./chip-ota-provider-app -f ${SW_IMAGE_FILE}
Commission the ota-provider-app using chip-tool
$ ./chip-tool pairing onnetwork 2 20202021
Write the Default OTA providers into Ameba
$ ./chip-tool otasoftwareupdaterequestor write default-otaproviders '[{"fabricIndex": 1, "providerNodeID": 2, "endpoint": 0}]' 1 0
Configure the ACL of the ota-provider-app to allow access for Ameba
$ ./chip-tool accesscontrol write acl '[{"fabricIndex": 1, "privilege": 3, "authMode": 2, "subjects": null, "targets": [{"cluster": 41, "endpoint": null, "deviceType": null}]}]' 1235 0
Use the chip-tool to announce the ota-provider-app to start the OTA process
$ ./chip-tool otasoftwareupdaterequestor announce-otaprovider 1 0 0 0 2 0
The OTA process should include downloading the image, verification of image header, erasing upgraded flash partition, writing to flash and checksum verification.