Part Number: LP-CC2652RB
Hello
I have two identical development boards on which i'm testing OTA functionality with local or external repository firmwares using Zigbee2Mqtt and Home Assistant. The problem i have is that one of the boards works really well (albeit incredibly slow, taking 5 hours to update a 170KB image) while the other one would never perform an update regardless of the image source.
The procedure to check and program the boards is identical between them and goes as follows:
- Delete boards from Z2M and clear records stored in persistent storage to ensure fresh repair
- Erase memory
- Program the board with BIM.hex and _oad.bin files
- Re-pair boards with coordinator (pairing is successful every time)
- Check for updates
- Update board
Everything works correctly for both boards up until step 6 where one board will never update and i get an error message.
Checking for updates and starting procedure:
Zigbee2MQTT:info 2023-10-03 17:01:50: MQTT publish: topic 'zigbee2mqtt/0x00124b00214f4a0b', payload '{"update":{"installed_version":2,"latest_version":3,"state":"available"},"update_available":true,"voltage":3800}'
Zigbee2MQTT:debug 2023-10-03 17:01:54: Received MQTT message on 'zigbee2mqtt/bridge/request/device/ota_update/update' with data '{"id":"0x00124b00214f4a0b","transaction":"6v0j5-24"}'
Zigbee2MQTT:info 2023-10-03 17:01:54: Updating '0x00124b00214f4a0b' to latest firmware
Zigbee2MQTT:info 2023-10-03 17:01:54: MQTT publish: topic 'zigbee2mqtt/bridge/log', payload '{"message":"Updating '0x00124b00214f4a0b' to latest firmware","meta":{"device":"0x00124b00214f4a0b","status":"update_in_progress"},"type":"ota_update"}'
Zigbee2MQTT:debug 2023-10-03 17:01:58: getNewImage for '0x00124b00214f4a0b', image header {"otaUpgradeFileIdentifier":{"type":"Buffer","data":[30,241,238,11]},"otaHeaderVersion":256,"otaHeaderLength":56,"otaHeaderFieldControl":0,"manufacturerCode":48830,"imageType":9810,"fileVersion":3,"zigbeeStackVersion":2,"otaHeaderString":"\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000","totalImageSize":176794}
Zigbee2MQTT:debug 2023-10-03 17:01:58: Got new image for '0x00124b00214f4a0b'
Zigbee2MQTT:debug 2023-10-03 17:01:58: Starting upgrade
Finally getting the error message:
Zigbee2MQTT:info 2023-10-03 17:02:34: MQTT publish: topic 'zigbee2mqtt/bridge/log', payload '{"message":"Update of '0x00124b00214f4a0b' failed (Update failed with reason: 'aborted by device')","meta":{"device":"0x00124b00214f4a0b","status":"update_failed"},"type":"ota_update"}'
Zigbee2MQTT:info 2023-10-03 17:02:34: MQTT publish: topic 'zigbee2mqtt/bridge/response/device/ota_update/update', payload '{"data":{"id":"0x00124b00214f4a0b"},"error":"Update of '0x00124b00214f4a0b' failed (Update failed with reason: 'aborted by device')","status":"error","transaction":"6v0j5-24"}'
Zigbee2MQTT:error 2023-10-03 17:02:34: Update of '0x00124b00214f4a0b' failed (Update failed with reason: 'aborted by device')
Zigbee2MQTT:debug 2023-10-03 17:02:34: Error: Update failed with reason: 'aborted by device'
at /app/node_modules/zigbee-herdsman-converters/src/lib/ota/common.ts:422:24
I find it weird that the header string is all zeros, but the image size is correct and the update works and is functioning as expected for the other board.
I suspect this might have something to do with my board rather than Z2M or the Sonoff coordinator as the other identical board will always work and this one has never did. I've tested multiple firmware versions (as we've had to keep adding features) and this one never works while the other one hasn't had any issues as far as i know.
Just to mention, all other communication between coordinator and boards works as expected and both send and receive messages as expected. I cannot sniff the traffic as i don't have a sniffer.