Closed yashijoe closed 11 months ago
For the moment the Gateway Legrand abort the OTA request... OTA ABORT.zip 29:06:2A:5F:ED:79:DD:E5:F4:28:93:0B:CD:22:06:03
Do I understand correctly that it also fails with the Legrand gateway?
No its because legrand provide ota update on the legrand gateway after 1 week of the available on the legrand developer website
zbee_nwk.addr == 0x4ce9
Key : 29:06:2A:5F:ED:79:DD:E5:F4:28:93:0B:CD:22:06:03 i upload the begenning of the OTA i have cut off to keep the socket not up to date
as you can see the update begin and the socket ask more than two block
as you can see the update begin and the socket ask more than two block
I don't see any ZCL OTA: Image Block Request
/ZCL OTA: Image Block Response
in OTA begin.zip , can you sniff for a bit longer?
Yes i see, after 1600sec you can see the real begin OTA begin no response and real begin.zip
I see this difference :
by Z2M
File Version: 0x00514203
0000 0000 .... .... .... .... .... .... = Application Release: 0
.... .... 0101 0001 .... .... .... .... = Application Build: 81
.... .... .... .... 0100 0010 .... .... = Stack Release: 66
.... .... .... .... .... .... 0000 0011 = Stack Build: 3
By Legrand Gateway
File Version: 0x00510000
0000 0000 .... .... .... .... .... .... = Application Release: 0
.... .... 0101 0001 .... .... .... .... = Application Build: 81
.... .... .... .... 0000 0000 .... .... = Stack Release: 0
.... .... .... .... .... .... 0000 0000 = Stack Build: 0
Legrand dev / Legrand from Gateway not use same image ?
i double check the downloaded file from legrand have same sha512 from my git folder and from a downloaded link from github
Could it be that Legrand published the wrong OTA files on their site? The file version is parsed from the OTA file.
the ota files work for new device.
Legrand forum say
We see that the product downloads the firmware starting the offstet 78 and not offstet 0. This case is hard to understand as it’s not reproduced on our side with our gateways and zigbee gateways tested
Legrand say 78 but i see 50 in the https://github.com/Koenkk/zigbee-OTA/files/12579307/Update_imageinvalid.zip packet 81
and for the good one : https://github.com/Koenkk/zigbee-OTA/files/12642704/OTA.begin.no.response.and.real.begin.zip packet number 6346 offset 0
So is it not the Z2M or the file but the powersocket who asking not the beginning of the file offset
So only method is it to poweroff for a long time period Legrand say
Can you try the following :
perform an electrical reboot of the device (and wait at least 30 seconds)
or
make a factory reset, reinstall the device, then re-try to perform the update
I have the chance where i can poweroff with the circuit breaker room by room but for those have circuit breaker for multiple room its hard !
im going to test tonight
im going to test tonight
I will try too
im going to test tonight
I will try too
Failed for me
Hi, sorry to jump in so late. Same issue for me, have a bunch of 067776 exposing the very same issue. Neither a long reset (power off) nor a factory reset helped. The device keeps requesting data starting with offset 50.
Attempted to offset the data by 50 bytes, no luck either.
I've been poking around with the devices, and eventualy managed to have my 067776s updated to the latest NLV firmware (0038)! Attached is a non-production hack for the OTA. Can anyone test if that works on other devices as well ? After having applied the patch, simply run the OTA. The first attempt will fail and end-up in a timeout. A subsequent update should work just fine.
Cheers
I've been poking around with the devices, and eventualy managed to have my 067776s updated to the latest NLV firmware (0038)! Attached in a non-production hack for the OTA. Can anyone test if that works on other devices as well ? After having applied the patch, simply run the OTA. The first attempt will fail and end-up in a timeout. A subsequent update should work just fine.
Cheers
How to use the file? Thanks
we can use this pull https://github.com/Koenkk/zigbee-herdsman-converters/pull/6193 ? @Koenkk you agree ?
The PR is ready (sorry for the intial issues with the Lint). Alternatively, you may want to patch this locally (OTA of zigbee-herdsman-converters), as i am not sure this should really make it into the dev branch.
Issue should be fixed now!
Changes will be available in the dev branch in a few hours from now. (https://www.zigbee2mqtt.io/advanced/more/switch-to-dev-branch.html)
Issue should be fixed now!
Changes will be available in the dev branch in a few hours from now. (https://www.zigbee2mqtt.io/advanced/more/switch-to-dev-branch.html)
Sounds great! Thanks
It works!
@benjR @trollix @tkintscher @essegi65 @titou4307 @rossowl @lamerjack @pierrepinon @Xavinooo @sekot @chpego @novisys @vezyr @Loic691 @marcbernis @denisjankovic @marcbernis
you can thank @FabianMangold, the problem is solved and the solution is available on the edge version of Z2M, otherwise you have to wait a little for production.
You have to launch an upgrade which will fail (its normal) then launch a second which will work
NLV(Shutter switch with neutral) and NLP(Connected outlet) product was tested, if you have other type of product and its work (or not) you can send it back to us
For the bug i cant say if its the Firmware of legrand is bugged or too careful or not respect the zigbee stack, or if Z2M not respect the ZigbeeStack @Koenkk you know ?
i want to use this meme "Legrand, Pas mal non c'est Français" => "Legrand, Not bad no it's French" Orson Welles
For me I will wait the time to pass the Edge to the production I am afraid to bug my Home Assistant installation by change the Zigbee2mqtt container- (I am not a perfect informatic !!)
And Many thanks to @FabianMangold and the other who have boss into this problem
If anyone could explain the solution easy (I am frenchee so it very difficult to traduce all the echanges
Titou4307
Is the docker latest-dev tag already updated ? If so, I still have the issue with a connected outlet I know is not up to date :
Info 2023-09-24 23:32:48Checking if update available for '0x00047400000c565b'
Warning 2023-09-24 23:32:48Firmware on '0x00047400000c565b' is newer than latest firmware online.
Info 2023-09-24 23:32:48No update available for '0x00047400000c565b'
Info 2023-09-24 23:32:48MQTT publish: topic 'zigbee2mqtt/0x00047400000c565b', payload '{"action":null,"led_if_on":"OFF","led_in_dark":"OFF","linkquality":134,"power":0,"power_apparent":null,"power_on_behavior":"previous","state":null,"update":{"installed_version":54531584,"latest_version":5325315,"state":"idle"},"update_available":null}'
Info 2023-09-24 23:32:48MQTT publish: topic 'zigbee2mqtt/bridge/response/device/ota_update/check', payload '{"data":{"id":"0x00047400000c565b","updateAvailable":false},"status":"ok","transaction":"1xudq-1"}'
If anyone could explain the solution easy
When OTA the devices indicate the offset ( where the devices wants the ota files)
For legrand and all Devices its need the begin so the Zero
with this offset, its indicate the size ( dont know if its bytes ou KBytes) Legrand say 62
and its the beginning of problem
Z2M limmit/capping at 50 so z2m respond with offset 0 and size 50
after that the Devices ask the offset 50 and size 12 ( 62 original ) normal because its receive 0 to 50
but the Legrand Firmware wasent happy i thinks its analize the file or whatever it respond invalid image
and when we retry the device ask the offset 50 to 62 ( size 12 ) and looping so bricked :(
So for this looping problem is it to reset the task or stack
electrical reset not work each time so @FabianMangold tested to BufferOverflow the devices by sending more than expected
its result to reset the ota task of devices
and when new notify OTA to the devices its aksing offset 0 size 62
But we looping because Z2m continue to send only 50
so we have update the limit to 64 ( because legrand ask 62 at begin and 64 after ) only for legrand devices
So i cant say if Legrand fimware was not coded to receive less size because dont know if its allowed in zigbee stack or not
After reading the zigbee documentation https://csa-iot.org/wp-content/uploads/2022/01/07-5123-08-Zigbee-Cluster-Library-1.pdf#page1051
Article
11.13.6.2.6 Maximum Data Size The value indicates the largest possible length of data (in bytes) that the client can receive at once. The server SHALL respect the value and not send the data that is larger than the maximum data size. The server MAY send the data that is smaller than the maximum data size value, for example, to account for source routing payload overhead if the client is multiple hops away. By having the client send both file offset and maximum data size in every command, it eliminates the burden on the server for having to remember the information for each client.
and articles
11.13.8.2.6 Data Size The value indicates the length of the image data (in bytes) that is being included in the command. The value MAY be equal or smaller than the maximum data size value requested by the client. See section 11.11.2 for more description.
So my conclusion its was the Legrand firmware cannot accept a smaller size wich devices aksing so it dident respect the ZigbeeStack
@SilentT-FR
I have understand the big line of the problem and of the solution
Thanks
It's working. Great job guys. Many thanks !
@SilentT-FR Legrand doesn't respect the max data size which z2m sends so it's a bug from their side.
Since this issue is solved now, I will close it.
@SilentT-FR Legrand doesn't respect the max data size which z2m sends so it's a bug from their side.
Since this issue is solved now, I will close it.
Yes i have write this explanation before i read the Zigbee Protocol Documentation from Zigbee_Alliance
still getting this error for Legrand 067776
Hi @stefanuytterhoeven, Just wanna make sure, are you using the DEV branch when performing your tests ?
Worked for me, many thanks !
Hi @stefanuytterhoeven, Has it worked out for you in the end ? Cheers
Hi @stefanuytterhoeven, Just wanna make sure, are you using the DEV branch when performing your tests ?
No,
Hi @stefanuytterhoeven, Has it worked out for you in the end ? Cheers
No, still the same error..
Hi Stefan,
The fix is only available in the DEV for now, which explains why it fails. Can you either switch to the DEV branch or wait for the fix the new release to be available ?
On 28 Sep 2023, at 19:56, Stefan Uytterhoeven <notifications
@FabianMangold @Koenkk Response of Legrand 👍
Hello Clément,
The problem is now clear for the devs and they understand why it wasn’t reproduced on their side
They will fix the max lenght of frame sent by the gateway (but it’s not still prioritized so I don’t know when it will be done)
But the update of your devices will be impossible without a fix on your gateway’s side. We see that the code on gateway was patched last week (GitHub). It seems that you manage to update products. Do you still have problems since this patch was done ?
Have a good day,
Leslie – Community Manager
HI @SilentT-FR , To be honnest, i don't get all those discussions about that topic. The issue is solved, there is nothing to be done anymore. Great that Legrand found an issue on their end, but from what we can tell, the latest firmware issue doesn't seem to expose the issue anymore. Regardless, our fix makes it possible to deal with the "bogus" firmware, and in addition enables flexible packet size, so all good from our end. Can you please tell Legrand, that "our" fix works, and that we have not experienced any issues since ? IMHO, this particular issue is fixed and closed. Thanks for your understanding.
i dont test to use old method ( cap 50 ) with the new firmware.
I no longer post discussions with Legrand on this thread
Thanks
I have tested old method (capping with size 50) with new firmware NLPv81 to same firmware with "forced: true" on the json
the devices OTA Invalid image, so the bug continue with the last firmware, so i continue to update legrand about the situation, for Z2M yes the issue is solved
Yes, it works. Really great work. Thank you.
Image updated, so .. it works! Thx!
Thanks for the great work.
Hi Z2M Updated today ... Legrand devices are updating (2/3 successv, awaiting the last one....)
All the update passed
Many thanks at all for the Energy to resolve this problem
Almost all devices have been updated. Cannot update Legrand 067774. The process reaches 99% and an error appears Update of 'Kitchen switch lighting' failed (Timeout: device did not request any image blocks)
Hi @vvn123421345, Just try it again once more straightaway after the failure. That weird behaviour might actually be "normal". Also, if that doesn't work, try to power cycle the device, and give it another try. That worked just fine for me.
Thank you. Removing the battery for a few minutes and then updating it helped. Before this I ran the update 6 times and got an error
What happened?
Interface tells me there is an update I try to upgrade and get the message “invalid image”
What did you expect to happen?
Upgrade successfully
How to reproduce it (minimal and precise)
Press upgrade firmware Get the message: “ Error 2023-05-17 09:18:40Update of 'refrigerator_plug' failed (Update failed with reason: 'invalid image')”
Zigbee2MQTT version
1.30.4-1
Adapter firmware version
004a
Adapter
Legrand 067775/741811
I’ve also tried with dev version and updated index.json. Same result
thank you