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
Attempt (temporary hack) to address zigbee-OTA#328 #6193
Conversation
Im fine with this hack but have some questions:
|
Sure:
(Sorry, commenting out code creates some side effects (unused variables).. Sorry for the failing Lint tests) |
I can sniff the official legrand OTA but i dont know how extract it to OTA file i cant confirm if the firmware from legrand.com was same from the official gateway in my opinion why legrand would make two versions of its firmware ? |
|
@SilentT-FR |
I think they said 78 because the firmware of my socket was in 78 |
3d4c1f4
to
dfeab61
Compare
Ive tested you have right |
@SilentT-FR can you check if the fix also works for you? |
0e49838
to
1b6c048
Compare
i use HA addon |
@FabianMangold
but after i have
and the OTA failed the popular way its device asking directly offset 50 but after retry, failed with 0-50, 50-12, its continue to ask 50-12 via legrand gateway its ask 0-62 and 62-8 |
But again, mine are NLVs, you seem to have an NLP. Would be great if you could test the fix. N.B: Looks like this version of the firmware expects 62 bytes. By default, the OTA limits to 50 bytes for stability, which may explain the behaviour you see above. In order to account for the 12 missing bytes, it requests another packet with only 12 bytes... but then, stalls for some reason. |
Yes but the legrand gateway not use same method for updating, and i dont understand why first the gateway notify its does that multiple times and after several times, the device Command: Query Next Image Request (0x01) and the devices ask directly
the official gateway work everytimes |
I can't wait to try it :D |
all is there : zbee_nwk.addr == 0x4ce9 key : 29:06:2A:5F:ED:79:DD:E5:F4:28:93:0B:CD:22:06:03 |
|
And after its asking 64 zbee_zcl_general.ota.data_size === 64 or zbee_zcl_general.ota.data_size < 64 0-62 |
That's correct, so it looks like we have observed the very same behaviour. |
why capping, when it is the devices themselves that ask for the size they want us to send? |
Network congestion ! Can you test the fix locally ? Do you know how to modify the library locally ? |
im using Z2M addon of HA |
1b6c048
to
f733c1a
Compare
Thanks for figuring this out! I can confirm that my 067771 (NLF) was updated from firmware 0046 to 0047 with the help of this patch! Before it was stuck with the usual "invalid image" symptoms. The log output was:
Then after trying to update again:
and requesting further offset 62, 70, 134, 198, ... until completion. While this "hack" seems to get the device unstuck, I wonder how our devices ended up with the broken state of the OTA stack in the first place. |
I totally forgot about this, we can easily remove the cap for this device, we also give a different cap for INSTA devices:
I propose to do this:
Would this work without changing anything else? Since this is a nice fix IMO, we can at least give it a try (commit it so it's available in the edge addon for @SilentT-FR) |
Thanks for confirming the fix @tkintscher. I believe that my "hack" might still be required to get the device "back to normal" however. Unfortunately, all my devices are running the latest firmware for now. @SilentT-FR would you be able to give this a test ? |
Zigbee2MQTT version Not see difference |
Just in the process of downgrading one of my devices to give your fix a try @Koenkk. By the way, the new firmware requests 62 bytes from offset 0, then 8 bytes, and then 64 bytes all along, confirming what @SilentT-FR and @tkintscher obeserved as well. |
i have found : https://github.com/zigbee2mqtt/hassio-zigbee2mqtt#issues im currently test ! |
f733c1a
to
caade1e
Compare
Yes because i have speak of that in the legrand forums i can create a new post for NLV and second point : the non presence of changelog where we need to aks legrand at each new version... |
@SilentT-FR: I've seen your post in the Legrand Forums, and didn't want to interfere. Could you please ask for the NLV please ? |
Instead of overflow, we dont have in zigbee protocol a response for reset OTA stack ? like no OTA update available or OTA abort ? |
Thanks @FabianMangold ! |
and if we can documented this for future or add popup log too explain and to do a retry ? |
@SilentT-FR The debug log contains an info. The update will fail (timeout because the device doesn't request any new blocks after the second attempt), and I believe it is quite intuitive to give it another try. @Koenkk: My pleasure, glad this is fixed. |
Legrand Forum : https://developer.legrand.com/forums/topic/connected-outlet-nlp-78-firmware/
I hope I wasn't wrong in my explanation. |
First the changelog https://developer.legrand.com/forums/topic/changelog-zigbee-firmware/ For the version not corresponding you can send the before and after upgrade version ? with the long number ? |
https://developer.legrand.com/forums/topic/nlc-firmware-version/ => second post... |
So i thinks we need to open a new forum post |
@SilentT-FR: This is the status with the current (v.56) version. Legrand should be able to take it from there IMHO.
|
https://developer.legrand.com/forums/topic/nlv-version-stack-not-corresponding-with-files/ |
https://csa-iot.org/wp-content/uploads/2022/01/07-5123-08-Zigbee-Cluster-Library-1.pdf#page1051 11.13.6.2.6 |
I will explain to legrand it dosent respect the zigbee stack... |
@FabianMangold Source v74 Updated via offical gateway moved to Z2M to read this Source v74 Updated via Z2M with firmware from dev.legrand.com |
That‘s really odd.
Can you sniff the Firmware on the official Gateway and compare it to one you‘ve uploaded to the repo (or the one from Legrand’s DEV site) ?
|
The uploaded to the repo is the same from the legrand dev website, i can sniff but i dont know how to extract it |
I think I'm in the same situation as many in this thread, but I'm not sure I understand how to fix it. Do I need to wait for an update to Z2M? Can I fix it by shutting down the power to my switches, so that they can cleanse this offset? I'm experiencing a lot of problems with legrand switches lately and I've seen a lot of "invalid image" logs when trying to update the ~40 switches in my network. |
If you are comfortable using Docker, you can point the Otherwise you might have to wait for the next stable release of Z2M. I have not managed to reset the OTA stack of my switches by cutting the power, unfortunately. |
Hi @dadino , |
Ok, I'm using the HA addon, is there a way to update the addon without resetting the network? My idea is to install the edge version and copy paste the coordinator_backup file from the stable version folder. Would it work? |
@dadino, yes that should work indeed. |
I'm trying to update a switch with a very old firmware (see here for more infos). I tried the "force" fix with the stable release and it failed with the "invalid image" message. I'm trying now with the dev branch and the "force" fix, when it reaches 100%, it goes back to 0% and starts over. I can't find "invalid image" in the logs, it just starts over (I'm now in the 3rd cycle). I got the logs for the restart
|
Can you carck Instagram password |
This is a POC only! Please use with care, and only if the "fix" has been confirmed to work with other devices.