Closed SYESHASWINI closed 2 days ago
how to change the ota provider's software version. It is always 1.
You mean how to change the version reported by the image that the ota-requestor updates to? Where is that image coming from? How are you generating the image @SYESHASWINI ?
@bzbarsky-apple I'm Generating the image by enabling Matter Ota Image and setting the version in Get the project version from kconfig. Even though project version is set to 3, when I read the basic information cluster the software version is seen has 1.
@SYESHASWINI I don't know what "enabling Matter Ota Image" means (e.g. where are you enabling it?), but it sounds like you should report the bug on whatever utility you are using to generate the image.
@bzbarsky-apple I'm enabling those using menuconfig and the ota image will be generated as project_name-ota.bin
@SYESHASWINI please update the below lines in your CMakeLists.txt. https://github.com/project-chip/connectedhomeip/blob/dbf24304ba8473808768aba0196b5dd6a7dee640/examples/all-clusters-app/esp32/CMakeLists.txt#L21-L22
@shubhamdp it is already set in the cmake list. ota-provider-app version is not same as the ota image version.
Sorry, I may have misread the very first comment.
how to change the ota provider's software version. It is always 1.
As mentioned in https://github.com/project-chip/connectedhomeip/issues/26346#issuecomment-1534145720, you can change the firmware version like below in your project's CMakeLists.txt
set(PROJECT_VER "v2.0")
set(PROJECT_VER_NUMBER 2)
Once the ota is completed with version 1, then the ota for second time is getting failed as the ota-requestor software version is equal or greater the ota-provider.
Here, OTA provider's version has nothing to do with this. The check is for ota-requestor's verison, it checks if the version of downloaded firmware is greater than the running firmware version.
To test OTA requestor and provider functionality, please see if you are trying the below things.
announce-ota-provider
command to ota-requestorFiled an issue for broken ota image generation flow: https://github.com/project-chip/connectedhomeip/issues/26364
@shubhamdp I tried generating the ota image using the ota_image_tool.py, then it shows the error:
/esp/esp-matter/connectedhomeip/connectedhomeip/src/app$ ./ota_image_tool.py show e sp/light2/build/light-ota.bin Traceback (most recent call last): File "/home/ubuntu/esp/esp-matter/connectedhomeip/connectedhomeip/src/app/./ota_image_tool.py", line 391, in
main() File "/home/ubuntu/esp/esp-matter/connectedhomeip/connectedhomeip/src/app/./ota_image_tool.py", line 383, in main show_header(args) File "/home/ubuntu/esp/esp-matter/connectedhomeip/connectedhomeip/src/app/./ota_image_tool.py", line 260, in show_header magic, total_size, header_size, header_tlv = parse_header(args) File "/home/ubuntu/esp/esp-matter/connectedhomeip/connectedhomeip/src/app/./ota_image_tool.py", line 221, in parse_header with open(args.image_file, 'rb') as file: FileNotFoundError: [Errno 2] No such file or directory: 'esp/light2/build/light-ota.bin'
Please find below the sample command...
./ota_image_tool.py create --vendor-id 0xFFF1 --product-id 0x8001 \
--version 2 --version-str "v2.0" \
--digest-algorithm sha256 \
light.bin light-matter-ota.bin
NOTE: please provide the valid path for build/light.bin
and modify the vendor-id product-id, version, and version string as per your configurations.
To see the header details in generated image,
./ota_image_tool.py show light-matter-ota.bin
@shubhamdp given the valid path and the error through like this:
./ota_image_tool.py create --vendor-id 0xFFF1 --product-id 0x8000 \ --version 1 --version-str "v1.0" \ --digest-algorithm sha256 /esp/light/build/light.bin /esp/light/build/light-ota.bin
usage: ota_image_tool.py create [-h] -v VENDOR_ID -p PRODUCT_ID -vn VERSION -vs VERSION_STR -da {sha3_512,sha3_224,sha3_256,sha256,sha3_384,sha512,sha384} [-mi MIN_VERSION] [-ma MAX_VERSION] [-rn RELEASE_NOTES] input_files [input_files ...] output_file ota_image_tool.py create: error: the following arguments are required: input_files, output_file -bash: /esp/light/build/light.bin: No such file or directory
-bash: /esp/light/build/light.bin: No such file or directory
This is the error, are you sure that the file (/esp/light/build/light.bin
) is present, because error says it not.
Yes, the file is present in the path, but don't know why the error occurs.
Ohh, I missed one escape character in command after specifying the digest algorithm :-(. Please try the following, I have pasted the whole command in the single line now.
./ota_image_tool.py create --vendor-id 0xFFF1 --product-id 0x8001 --version 2 --version-str "v2.0" --digest-algorithm sha256 /esp/light/build/light.bin /esp/light/build/light-ota.bin
@shubhamdp Generated OTA image using ota_image_tool and performed ota. Once the device restarts it shows the confirm image failure.
E (2742) chip[SWU]: Failed to confirm image: 3
Can you please attach the complete logs from ota-requestor when this happened?
@shubhamdp attaching the requestor log matter_ota_requestor.txt
Boot up logs before OTA
I (369) boot: Loaded app from partition at offset 0x20000
I (396) cpu_start: Application information:
I (399) cpu_start: Project name: light
I (404) cpu_start: App version: 1
I (408) cpu_start: Compile time: May 5 2023 17:15:08
I (414) cpu_start: ELF file SHA256: 752e579ea7c45437...
Boot up logs after OTA
I (374) boot: Loaded app from partition at offset 0x200000
I (401) cpu_start: Application information:
I (404) cpu_start: Project name: light
I (408) cpu_start: App version: 1
I (413) cpu_start: Compile time: May 5 2023 17:15:08
I (419) cpu_start: ELF file SHA256: 9a77918ecc6981cb...
Few observations based on above logs:
0x20000
and after: 0x200000
.1
, before and after OTA.Please try following:
Duplicate Comment, I am unable to delete it...
@shubhamdp while performing ota it throws the error as Unsupported Cluster.Before it was working fine. attaching the error log. ota-unsupported cluster.txt
Hi @shubhamdp, is there any issue with OTA process currently?. As I announce the OTA it shows general error :0xc3 (UNSUPPORTED CLUSTER)
@SYESHASWINI Sorry for the delayed response for the above message. Have you enabled config option CONFIG_ENABLE_OTA_REQUESTOR
https://github.com/project-chip/connectedhomeip/blob/bfa05804ac3c224c9e70921a857ffcac32ccc7f4/config/esp32/components/chip/Kconfig#L176-L180
@shubhamdp Yes, forgot to enable it. Thank You.
@shubhamdp followed the instructions as below and changed the versions in CMakelist but still the error E (2674) chip[SWU]: Failed to confirm image: 3 is appearing.
Build an application with Version: 1 and flash it on the device. To generate the OTA image, please please bump the firmware version as described in https://github.com/project-chip/connectedhomeip/issues/26346#issuecomment-1534145720 in your projects CMakeLists.txt. Build the firmware with updated version and generate the matter ota image using ota_image_too.py Then use that image with ota-provider-app
@SYESHASWINI After OTA upgrade is complete, device boots from upgraded partition.
Below is the source of error log If you see [here](https://github.com/project-chip/connectedhomeip/blob/master/src/app/clusters/ota-requestor/DefaultOTARequestorDriver.cpp#L79) (place for error print), this is when it fails to confirm the image.
And below is the implementation for ConfirmCurrentImage()
https://github.com/project-chip/connectedhomeip/blob/43cfe21dc1f852e7c1d2f2667f13b4db125d20d0/src/platform/ESP32/OTAImageProcessorImpl.cpp#L68-L84 It has an explicit check for version, if version is not exactly same as it was promised in then it prints an error.
Can you please read the version using chip-tool to confirm if that is that case?
// 1 is the node id, please replace with the node id of requestor
./chip-tool basicinformation read software-version 1 0
Also, one more identifier if OTA was success or not is I (369) boot: Loaded app from partition at offset 0x20000
line in ESP32 bootup logs. The address will change after OTA upgrade. (https://github.com/project-chip/connectedhomeip/issues/26346#issuecomment-1539997780)
@shubhamdp the partition address is changing from ota1 to ota2, but the basic information cluster values are same before and after ota.
@SYESHASWINI Can you please share the sdkconfig
and below two lines from your project's top level CMakeLists.txt
https://github.com/project-chip/connectedhomeip/blob/4f6923fe7c7df3dea22b3e9d5bc4944b888e5dbb/examples/lighting-app/esp32/CMakeLists.txt#L21-L22
@shubhamdp Sharing the sdkconfig file. sdkconfig.txt This is for OTA-Requestor: set(PROJECT_VER "v1.0") set(PROJECT_VER_NUMBER 1) OTA-Image: set(PROJECT_VER "v2.0") set(PROJECT_VER_NUMBER )
OTA-Image: set(PROJECT_VER "v2.0") set(PROJECT_VER_NUMBER )
If you see here, version number is missing right? It should be set(PROJECT_VER_NUMBER 2)
.
@shubhamdp It is gone while commenting it is set(PROJECT_VER "v2.0") set(PROJECT_VER_NUMBER 2) performed OTA with this versions
@SYESHASWINI Thanks for the sdkconfig
, now I understood the problem, and I think it will be better to document it in docs/guides/esp32
other than code.
You have CONFIG_APP_PROJECT_VER_FROM_CONFIG=y
option enabled which is not allowing to pick the version from CMakeLists.txt
. Please see below https://github.com/project-chip/connectedhomeip/blob/530349abc047f3d911216eac94c733bd6de4604d/config/esp32/components/chip/CMakeLists.txt#L70-L80.
This was done in order to be in sync with IDF.
So, two options:
CONFIG_APP_PROJECT_VER_FROM_CONFIG
intentionally then please set the version using CONFIG_DEVICE_SOFTWARE_VERSION_NUMBER
option. (Component config -> CHIP Device Layer -> Device Identification Options -> Device Software Version Number)CMakeLists.txt
.@SYESHASWINI any updates?
@shubhamdp sorry for the delay. I'm facing issues while commissioning devices through chip-tool, the ble is getting error so I was unable to test it. error: bluez.Errorsoftware caused connection abort(38). Is there any other way to test OTA functionality
@SYESHASWINI If you are facing BLE commissioning issues then you can connect the device to wifi using below config options. Then carry out the onnetwork commissioning and rest stays the same.
CONFIG_DEFAULT_WIFI_SSID=example-ssid
CONFIG_DEFAULT_WIFI_PASSWORD=example-passphrase
@shubhamdp Checking with this method, will update you soon
@shubhamdp with idf version v4.4.4 I'm getting the error while ota is inprogress. error: Failed to Send CHIP MessageCounter:5072182 on exchange 34130i sendCount: 4 max retries: 4. How can I solve this error as it is interrupting the ota process
I am having the same error: chip[SWU]: Failed to confirm image: 3. and I have project config CONFIG_APP_PROJECT_VER_FROM_CONFIG is not set and my cmake_minimum_required(VERSION 3.5)
set(PROJECT_VER "v1.0") set(PROJECT_VER_NUMBER 1)
and device logs are as below I (681) cpu_start: Project name: chip-lighting-app I (687) cpu_start: App version: v1.0 but as soon as I update the firmware, version remains same and then this error appears.
@SYESHASWINI Closing this issue as the problem was solved
Reproduction steps
how to change the ota provider's software version. It is always 1.
Once the ota is completed with version 1, then the ota for second time is getting failed as the ota-requestor software version is equal or greater the ota-provider.
Bug prevalence
whenever I execute the command
GitHub hash of the SDK that was being used
none
Platform
esp32
Platform Version(s)
No response
Type
Core SDK Interopability Issue
Anything else?
No response