Other Parts Discussed in Thread: , UNIFLASH
Hello. I have been trying to get OTA to work for some time now on my temperature sensor project. My implementation uses SDK version 6.20.00.29 and work really well otherwise. The problem I have is that, when trying to update using Zigbee2Mqtt, I get an error saying that OTA was aborted by device. Logs below:
Zigbee2MQTT:debug 2024-03-19 11:20:13: Received Zigbee message from 'Batch2 Sen5', type 'commandQueryNextImageRequest', cluster 'genOta', data '{"fieldControl":0,"fileVersion":1,"imageType":9810,"manufacturerCode":48830}' from endpoint 8 with groupID 0 Zigbee2MQTT:debug 2024-03-19 11:20:14: OTA: Request offsets: fileOffset=0 pageOffset=0 dataSize=32 Zigbee2MQTT:debug 2024-03-19 11:20:14: OTA: Payload offsets: start=0 end=32 dataSize=32 Zigbee2MQTT:debug 2024-03-19 11:20:14: OTA: Update at 0%, remaining Infinity seconds Zigbee2MQTT:info 2024-03-19 11:20:14: Update of 'Batch2 Sen5' at 0.00% Zigbee2MQTT:info 2024-03-19 11:20:14: MQTT publish: topic 'zigbee2mqtt/Batch2 Sen5', payload '{"battery":0,"humidity_8":0,"linkquality":87,"temperature_8":-40,"temperature_9":-40,"update":{"installed_version":1,"latest_version":2,"progress":0,"state":"updating"},"update_available":null,"voltage":4100}' Zigbee2MQTT:debug 2024-03-19 11:20:14: OTA: Request offsets: fileOffset=32 pageOffset=0 dataSize=32 Zigbee2MQTT:debug 2024-03-19 11:20:14: OTA: Payload offsets: start=32 end=64 dataSize=32 Zigbee2MQTT:debug 2024-03-19 11:20:14: OTA: Request offsets: fileOffset=64 pageOffset=0 dataSize=32 Zigbee2MQTT:debug 2024-03-19 11:20:14: OTA: Payload offsets: start=64 end=96 dataSize=32 Zigbee2MQTT:debug 2024-03-19 11:20:14: OTA: Request offsets: fileOffset=96 pageOffset=0 dataSize=32 Zigbee2MQTT:debug 2024-03-19 11:20:14: OTA: Payload offsets: start=96 end=128 dataSize=32 Zigbee2MQTT:debug 2024-03-19 11:20:20: OTA: Request offsets: fileOffset=128 pageOffset=0 dataSize=32 Zigbee2MQTT:debug 2024-03-19 11:20:20: OTA: Payload offsets: start=128 end=160 dataSize=32 Zigbee2MQTT:debug 2024-03-19 11:20:20: OTA: Request offsets: fileOffset=160 pageOffset=0 dataSize=32 Zigbee2MQTT:debug 2024-03-19 11:20:20: OTA: Payload offsets: start=160 end=192 dataSize=32 Zigbee2MQTT:debug 2024-03-19 11:20:20: OTA: Request offsets: fileOffset=192 pageOffset=0 dataSize=32 Zigbee2MQTT:debug 2024-03-19 11:20:20: OTA: Payload offsets: start=192 end=224 dataSize=32 Zigbee2MQTT:debug 2024-03-19 11:20:20: OTA: Got upgrade end request for '0x00124b0031e5d997' (AFTSHT35X2): {"status":149,"manufacturerCode":48830,"imageType":9810,"fileVersion":2} Zigbee2MQTT:debug 2024-03-19 11:20:20: OTA: Update failed with reason: 'aborted by device' Zigbee2MQTT:debug 2024-03-19 11:20:20: Update of 'Batch2 Sen5' failed (Error: OTA: Update failed with reason: 'aborted by device')
I was unable to validate OTA using OTAServer utilities and LP-CC2652RB boards because I could not get them to pair. Coordinator appears in the app when I connect it via serial, but I cannot get them to pair and am unable to see the joining devices with the provided examples. Anyways, I could still validate that TI's implementation of OTA is working by using the zr_sw_ota_client_LP_CC2652RB_tirtos_ticlang example and pairing it to my coordinator using Home Assistant. The update worked and the full image was downloaded.
I then took the ota directory of that project, added it to mine and rebuilt the project to test it. Now, unlike the sample project, it only seems to download a couple to packets then I get a message saying that the update was aborted. I have not modified anything inside the ota files and only added the ota_process_loop function to my main loop.
When debugging through the code, I got no hit inside otaClient_UpgradeComplete, but I can see that the app periodically asks for updates and receives a couple of frames as per the logs. Any idea what might be causing this or how can I better debug it?
Additional question: My device is a two-endpoint temperature sensor with two temperature clusters. Should I implement OTA cluster on both of them? It is currently only implemented on the main endpoint. I can still check for updates and initiate an update, but cannot finish it. Everything else works fine with respect to attribute reporting, commissioning and device stability.
My device is a battery-powered end device based on zed_temperature_sensor with the added ota cluster and second endpoint. Power source is set as battery and power cluster is configured and working correctly. OTA doesn't work regardless of the board being powered by battery of through the debugger. Are there special settings for battery powered OTA devices?