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

Z2M: OTA update failed with reason: 'invalid image' (fw below v0.1.0.3) #11

Closed
ikoz opened this issue Nov 20, 2023 · 7 comments
Closed

Comments

@ikoz
Copy link

ikoz commented Nov 20, 2023

Some days ago I flashed a couple of LYWSD03MMC sensors from custom BTHome to the ZigbeeTLc firmware using TelinkMiFlasher.

I added the 2 devices in Z2M and they work fine so far - showing up as version 3001-0102

I am now trying to do OTA update via Z2M - either to latest 106 firmware or even back to BLE.

I've tried both firmware 1141-020a-01103001-Z03MMC.zigbee and 1141-020a-99993001-ATC_v46.zigbee

However in both cases Z2M shows update starting ..0% - and then immediatelly after it fails with "Update failed with reason: 'invalid image'"

2023-11-20 14:31:56 Got upgrade end request for '0xa4c138fda3d5689c': {"status":150,"manufacturerCode":4417,"imageType":522,"fileVersion":2576953345}
2023-11-20 14:31:56 Update failed with reason: 'invalid image'

Not sure where to go from there - any way to update via OTA or do I need to use USB cable?

@nonflammable
Copy link

nonflammable commented Nov 20, 2023

what size are the update files on your disk?
did you try to download this file:
https://github.com/pvvx/ZigbeeTLc/raw/master/bin/1141-020a-01103001-Z03MMC.zigbee
size: 126274

@ikoz
Copy link
Author

ikoz commented Nov 20, 2023

what size are the update files on your disk? did you try to download this file: https://github.com/pvvx/ZigbeeTLc/raw/master/bin/1141-020a-01103001-Z03MMC.zigbee size: 126274

yes that's the file, and the file size is correct on disk.

$ cat configuration.yaml 
...
ota:
  ikea_ota_use_test_url: false
  zigbee_ota_override_index_location: override_update_index.json

$ cat override_update_index.json 
[
  {
    "url": "1141-020a-01103001-Z03MMC.zigbee",
    "force": true
  }
]


$ ls -l 1141-020a-01103001-Z03MMC.zigbee
-rwxrwxrwx+ 1 ikoz users 126274 Nov 20 13:56 1141-020a-01103001-Z03MMC.zigbee

$ sha1sum 1141-020a-01103001-Z03MMC.zigbee
ce1096a0f2a349b91649617fb8269bc4ca709d88  1141-020a-01103001-Z03MMC.zigbee

@pvvx
Copy link
Owner

pvvx commented Nov 20, 2023

Before flashing the firmware, check the compliance of the “Manufacturer Code” and “Image Type” between the OTA file and those issued by the Zigbee device.

Sample: "1141-020a-01103001-Z03MMC.zigbee"

Manufacturer Code Image Type File Version Stack Version Name Ext OTA
1141 020a 0110 3001 Z03MMC zigbee
0x1141 - Telink 0x02 - TLSR825x, 0x0a - Xiaomi LYWSD03MMC App release 0.1, App build 1.0 Zigbee v3.0, Release 0.1 Z03MMC OTA
Image Type Device, note
0x0201 MHO-C401 (old version)
0x0202 CGG1 (old version)
0x0203 LYWSD03MMC ver https://github.com/devbis/z03mmc
0x0204 WATERMETER ver https://github.com/slacky1965/watermeter_zed
0x0206 CGDK2
0x0207 CGG1 (new version)
0x0208 MHO-C401 (new version)
0x0209 MJWSD05MMC
0x020A LYWSD03MMC ver https://github.com/pvvx/ZigbeeTLc
0x020B MHO-C122
0x0210 Water Tank sensors
0x0211 TS0201-TZ3000
0x0212 TS0202-TZ3000

@ikoz
Copy link
Author

ikoz commented Nov 20, 2023

Hmm not sure how to check these parameters. My device is 4417 (0x1141) and 522 image type (0x20A) as far as I can tell.

If I try to flash a firmware that is not for 0x20A I get a different message saying "No image available for imageType '522'".

So Z2M will not even attempt to flash a firmware that is not for 0x20A. But those that are for 0x20A fail with "invalid image".
Is the format of the files correct for Z2M - has anyone successfully used them via Z2M instead of ZHA?

@pvvx
Copy link
Owner

pvvx commented Nov 20, 2023

I added the 2 devices in Z2M and they work fine so far - showing up as version 3001-0102

Beta version below 0.1.0.3 may have a bug related to the not very common TLSR825x, which has an integrated flash memory die from Zbit Semiconductor.

@ikoz
Copy link
Author

ikoz commented Nov 20, 2023

I added the 2 devices in Z2M and they work fine so far - showing up as version 3001-0102

Beta version below 0.1.0.3 may have a bug related to the not very common TLSR825x, which has an integrated flash memory die from Zbit Semiconductor.

Interesting. How do I check if I have TLSR825x?

Both devices work fine and report temperatures fine, so I wouldn't consider them bricked though. Only the OTA doesn't work! I guess my only choice is to try to update using a cable.

@pvvx
Copy link
Owner

pvvx commented Nov 20, 2023

TLSR825x chips with Flash from ZB (Zbit Semiconductor) with fw version lower than 0.1.0.3 cannot write Flash.
For this reason, OTA does not work. And any saving of the Zigbee configuration does not work.
Rewriting flash memory is only possible using any version of the hardware programmer.

@pvvx pvvx changed the title OTA update failed with reason: 'invalid image' Z2M: OTA update failed with reason: 'invalid image' (fw below v0.1.0.3) Nov 20, 2023
@pvvx pvvx mentioned this issue Nov 21, 2023
@pvvx pvvx closed this as completed Nov 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants