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 Upgrade "Query Next Image Request Command" file version field is always zero (TZ-269) #100

Closed
u236 opened this issue Sep 11, 2023 · 3 comments
Labels

Comments

@u236
Copy link

u236 commented Sep 11, 2023

Hello! We're testing OTA Upgrade features with your client example (https://github.com/espressif/esp-zigbee-sdk/tree/main/examples/esp_zigbee_ota/ota_client), and have found little bug:

After Image Notify Command sent from our "server", test device sends Query Next Image Request Command, but value of "File Version" field is always zero.

Some "client" code hunks:

#define OTA_UPGRADE_MANUFACTURER 0x1001 /* The attribute indicates the file version of the downloaded image on the device*/
#define OTA_UPGRADE_IMAGE_TYPE 0x1011 /* The attribute indicates the value for the manufacturer of the device */
#define OTA_UPGRADE_FILE_VERSION 0x01010101 /* The attribute indicates the file version of the running firmware image on the device */

esp_zb_ota_cluster_cfg_t ota_cluster_cfg = {
.ota_upgrade_downloaded_file_ver = OTA_UPGRADE_FILE_VERSION,
.ota_upgrade_manufacturer = OTA_UPGRADE_MANUFACTURER,
.ota_upgrade_image_type = OTA_UPGRADE_IMAGE_TYPE,

Query Next Image Request Command dump and parsed data:

2023.09.11 11:34:09.540 (inf) zigbee:    request dump:        "01:01:10:11:10:00:00:00:00:01:01"
2023.09.11 11:34:09.540 (inf) zigbee:    request field ctrl:  "1"
2023.09.11 11:34:09.540 (inf) zigbee:    request manuf. code: "1001"
2023.09.11 11:34:09.540 (inf) zigbee:    request image type:  "1011"
2023.09.11 11:34:09.540 (inf) zigbee:    request file ver.:   "0"

This bug can cause "infinite" OTA Upgrades in some cases :)

@github-actions github-actions bot changed the title OTA Upgrade "Query Next Image Request Command" file version field is always zero OTA Upgrade "Query Next Image Request Command" file version field is always zero (TZ-269) Sep 11, 2023
@xieqinan
Copy link
Contributor

@u236
Thank you for reminder, we will fix it.

@chshu chshu added the Bug label Oct 12, 2023
@xieqinan
Copy link
Contributor

Hello @u236 ,

There is a workaround available, outlined below:

    esp_zb_ota_cluster_cfg_t ota_cluster_cfg = {
        .ota_upgrade_file_version = 0x01010111,
        .ota_upgrade_downloaded_file_ver = OTA_UPGRADE_FILE_VERSION,
        .ota_upgrade_manufacturer = OTA_UPGRADE_MANUFACTURER,
        .ota_upgrade_image_type = OTA_UPGRADE_IMAGE_TYPE,
    };

@xieqinan
Copy link
Contributor

@u236 ,

This issue has been resolved in the esp-zigbee-lib v1.0.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants