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 End Request (TZ-1250) #466

Open
kiw-github opened this issue Oct 28, 2024 · 4 comments
Open

OTA Upgrade End Request (TZ-1250) #466

kiw-github opened this issue Oct 28, 2024 · 4 comments
Labels

Comments

@kiw-github
Copy link

kiw-github commented Oct 28, 2024

Question

My ESP32C6 device send Upgrade End Request to coordinator:

Frame 10407: 71 bytes on wire (568 bits), 71 bytes captured (568 bits) on interface /dev/cu.usbmodem1101, id 0
IEEE 802.15.4 Data, Src: 0x4d83, Dst: 0x0000
ZigBee Network Layer Data, Dst: 0x0000, Src: 0x4d83
ZigBee Application Support Layer Data, Dst Endpt: 1, Src Endpt: 1
ZigBee Cluster Library Frame
    Frame Control Field: Cluster-specific (0x01)
    Sequence Number: 218
    Command: Upgrade End Request (0x06)
    Payload
        Status: Success (0x00)
        Manufacturer Code: Unknown (0x7777)
        Image Type: Manufacturer Specific (0x0011)
        File Version: 0x00009999
            0000 0000 .... .... .... .... .... .... = Application Release: 0
            .... .... 0000 0000 .... .... .... .... = Application Build: 0
            .... .... .... .... 1001 1001 .... .... = Stack Release: 153
            .... .... .... .... .... .... 1001 1001 = Stack Build: 153

Coordinator answer Upgrade End Response:

ZigBee Cluster Library Frame
    Frame Control Field: Cluster-specific (0x19)
    Sequence Number: 218
    Command: Upgrade End Response (0x07)
    Payload
        Manufacturer Code: Unknown (0xffff)
        Image Type: Reserved: Wild Card (0xffff)
        File Version: 0xffffffff
            1111 1111 .... .... .... .... .... .... = Application Release: 255
            .... .... 1111 1111 .... .... .... .... = Application Build: 255
            .... .... .... .... 1111 1111 .... .... = Stack Release: 255
            .... .... .... .... .... .... 1111 1111 = Stack Build: 255
        Current Time: Now
        Upgrade Time: 0 seconds from now

The response corresponds to "ZigBee Cluster Library Specification Document 07-5123 Revision 8" paragraph 11.13.9.6 "Upgrade And Response Command".

But the event ESP_ZB_CORE_OTA_UPGRADE_VALUE_CB_ID does not come with ESP_ZB_ZCL_OTA_UPGRADE_STATUS_FINISH or ESP_ZB_ZCL_OTA_UPGRADE_STATUS_ERROR.

If Upgrade End Response has a Manufacturer Code, Image Type and File Version the same as in the request, then the update goes through - I get ESP_ZB_ZCL_OTA_UPGRADE_STATUS_FINISH.

How to fix it?

@github-actions github-actions bot changed the title OTA Upgrade End Request OTA Upgrade End Request (TZ-1250) Oct 28, 2024
@xieqinan
Copy link
Contributor

Hi @kiw-github ,

Could you print the Manufacturer Code, Image Type, and File Version when the ESP_ZB_CORE_OTA_UPGRADE_SRV_STATUS_CB_ID signal is triggered with the ESP_ZB_ZCL_OTA_UPGRADE_SERVER_END status on the coordinator side? I believe these values typically should match the request values.

I think the phenomenon is wired, could you please provide your reproduced steps?

@kiw-github
Copy link
Author

kiw-github commented Oct 29, 2024

Im using a ready-made coordinator from another manufacturer (not on ESP32). The problem is that it is this coordinator that sends the above response without the manufacturer code, file version and image type. But this answer is consistent with the specification. The coordinator can respond like this in accordance with the Cluster Library Specification:

11.13.9.6.3 Manufacturer Code
Manufacturer code MAY be sent using wildcard value of 0xfffff in order to apply the command to all devices
disregard of their manufacturers. See Chapter 2 for detailed description.
11.13.9.6.4 Image Type
Image type MAY be sent using wildcard value of 0xfffff in order to apply the command to all devices disre-
gard of their manufacturers. See section 11.4.2.6 for detailed description.
11.13.9.6.5 File Version
The file version included in the payload represents the newly downloaded OTA upgrade image file version.
The value SHALL match that included in the request. Alternatively, file version MAY be sent using wildcard
value of 0xfffffffff in order to apply the command to all devices disregard of their manufacturers. See section
11.4.2.7 for more detailed description.

@ANARHIST1984
Copy link

I have same error. Can't finish OTA via SprutHub

@xieqinan
Copy link
Contributor

xieqinan commented Nov 4, 2024

@kiw-github @ANARHIST1984

But this answer is consistent with the specification. The coordinator can respond like this in accordance with the Cluster Library Specification:

Yes, you’re correct. However, the current SDK does not yet support wildcard value checking for the Upgrade End Response command. I’ll update you here once this feature is added.

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