fairecasoimeme / Zlinky_TIC

Téléinformation Linky autoalimenté ZigBee 3.0
311 stars 21 forks source link

OTA ne fonctionne pas #107

Open forty opened 2 years ago

forty commented 2 years ago

Bonjour,

Je tente de mettre à jour le firmware via OTA. J'utilise un dongle ZiGate+. J'ai essaye ZHA et Zigbee2mqtt avec des résulats identiques.

Information du zlinky

Firmware build date
    20220217
Firmware version
    4000-0005
Manufacturer
    LiXee
Model
    ZLinky_TIC

Information de z2m

Zigbee2MQTT version
    [1.28.0](https://github.com/Koenkk/zigbee2mqtt/releases/tag/1.28.0) commit: [03ba647](https://github.com/Koenkk/zigbee2mqtt/commit/03ba647)

Coordinator type
    zigate

Coordinator revision
    2103

Coordinator IEEE Address
    0x00158d0005007273

Frontend version
    0.6.112

Les log de zigbee2mqtt liés au zlinky durant la tentative d'update:

Zigbee2MQTT:info  2022-10-05 17:41:47: Updating 'Linky' to latest firmware
Zigbee2MQTT:info  2022-10-05 17:41:47: MQTT publish: topic 'zigbee2mqtt/bridge/log', payload '{"message":"Updating 'Linky' to latest firmware","meta":{"device":"Linky","status":"update_in_progress"},"type":"ota_update"}'
Zigbee2MQTT:info  2022-10-05 17:41:47: Using firmware file ZLinky_router_v9.0.ota
Zigbee2MQTT:info  2022-10-05 17:41:48: Update of 'Linky' at 0.00%
Zigbee2MQTT:info  2022-10-05 17:41:48: MQTT publish: topic 'zigbee2mqtt/Linky', payload '{"active_register_tier_delivered":"TH..","apparent_power":320,"available_power":30,"current_summ_delivered":7919.08,"current_tarif":"BASE","linkquality":54,"meter_serial_number":"<SNIP>","rms_current":1,"rms_current_max":90,"update":{"progress":0,"state":"updating"},"update_available":false,"warn_d_p_s":null}'
Zigbee2MQTT:info  2022-10-05 17:41:48: MQTT publish: topic 'zigbee2mqtt/bridge/log', payload '{"message":"Update of 'Linky' at 0.00%","meta":{"device":"Linky","progress":0,"status":"update_progress"},"type":"ota_update"}'
zlinky config: historique, single_phase, false, BASE
Zigbee2MQTT:info  2022-10-05 17:42:06: MQTT publish: topic 'zigbee2mqtt/Linky', payload '{"active_register_tier_delivered":"TH..","apparent_power":320,"available_power":30,"current_summ_delivered":7919.08,"current_tarif":"BASE","linkquality":49,"meter_serial_number":"<SNIP>","rms_current":1,"rms_current_max":90,"update":{"progress":0,"state":"updating"},"update_available":false,"warn_d_p_s":null}'
Zigbee2MQTT:info  2022-10-05 17:42:06: MQTT publish: topic 'zigbee2mqtt/Linky', payload '{"active_register_tier_delivered":"TH..","apparent_power":320,"available_power":30,"current_summ_delivered":7919.08,"current_tarif":"BASE","linkquality":51,"meter_serial_number":"<SNIP>","rms_current":1,"rms_current_max":90,"update":{"progress":0,"state":"updating"},"update_available":false,"warn_d_p_s":null}'
Zigbee2MQTT:info  2022-10-05 17:42:06: MQTT publish: topic 'zigbee2mqtt/Linky', payload '{"active_register_tier_delivered":"TH..","apparent_power":320,"available_power":30,"current_summ_delivered":7919.08,"current_tarif":"BASE","linkquality":52,"meter_serial_number":"<SNIP>","rms_current":1,"rms_current_max":90,"update":{"progress":0,"state":"updating"},"update_available":false,"warn_d_p_s":null}'
Zigbee2MQTT:info  2022-10-05 17:42:06: MQTT publish: topic 'zigbee2mqtt/Linky', payload '{"active_register_tier_delivered":"TH..","apparent_power":320,"available_power":30,"current_summ_delivered":7919.08,"current_tarif":"BASE","linkquality":51,"meter_serial_number":"<SNIP>","rms_current":1,"rms_current_max":90,"update":{"progress":0,"state":"updating"},"update_available":false,"warn_d_p_s":null}'
Zigbee2MQTT:info  2022-10-05 17:42:06: MQTT publish: topic 'zigbee2mqtt/Linky', payload '{"active_register_tier_delivered":"TH..","apparent_power":320,"available_power":30,"current_summ_delivered":7919.08,"current_tarif":"BASE","linkquality":53,"meter_serial_number":"<SNIP>","rms_current":1,"rms_current_max":90,"update":{"progress":0,"state":"updating"},"update_available":false,"warn_d_p_s":null}'
Zigbee2MQTT:info  2022-10-05 17:42:33: MQTT publish: topic 'zigbee2mqtt/Linky', payload '{"active_register_tier_delivered":"TH..","apparent_power":310,"available_power":30,"current_summ_delivered":7919.08,"current_tarif":"BASE","linkquality":49,"meter_serial_number":"<SNIP>","rms_current":1,"rms_current_max":90,"update":{"progress":0,"state":"updating"},"update_available":false,"warn_d_p_s":null}'
zlinky config: historique, single_phase, false, BASE
Zigbee2MQTT:info  2022-10-05 17:43:06: MQTT publish: topic 'zigbee2mqtt/Linky', payload '{"active_register_tier_delivered":"TH..","apparent_power":310,"available_power":30,"current_summ_delivered":7919.08,"current_tarif":"BASE","linkquality":56,"meter_serial_number":"<SNIP>","rms_current":1,"rms_current_max":90,"update":{"progress":0,"state":"updating"},"update_available":false,"warn_d_p_s":null}'
Zigbee2MQTT:info  2022-10-05 17:43:06: MQTT publish: topic 'zigbee2mqtt/Linky', payload '{"active_register_tier_delivered":"TH..","apparent_power":310,"available_power":30,"current_summ_delivered":7919.08,"current_tarif":"BASE","linkquality":56,"meter_serial_number":"<SNIP>","rms_current":1,"rms_current_max":90,"update":{"progress":0,"state":"updating"},"update_available":false,"warn_d_p_s":null}'
Zigbee2MQTT:info  2022-10-05 17:43:09: MQTT publish: topic 'zigbee2mqtt/Linky', payload '{"active_register_tier_delivered":"TH..","apparent_power":310,"available_power":30,"current_summ_delivered":7919.08,"current_tarif":"BASE","linkquality":55,"meter_serial_number":"<SNIP>","rms_current":1,"rms_current_max":90,"update":{"progress":0,"state":"updating"},"update_available":false,"warn_d_p_s":null}'
Zigbee2MQTT:info  2022-10-05 17:43:09: MQTT publish: topic 'zigbee2mqtt/Linky', payload '{"active_register_tier_delivered":"TH..","apparent_power":310,"available_power":30,"current_summ_delivered":7919.08,"current_tarif":"BASE","linkquality":55,"meter_serial_number":"<SNIP>","rms_current":1,"rms_current_max":90,"update":{"progress":0,"state":"updating"},"update_available":false,"warn_d_p_s":null}'
Zigbee2MQTT:info  2022-10-05 17:43:09: MQTT publish: topic 'zigbee2mqtt/Linky', payload '{"active_register_tier_delivered":"TH..","apparent_power":310,"available_power":30,"current_summ_delivered":7919.08,"current_tarif":"BASE","linkquality":55,"meter_serial_number":"<SNIP>","rms_current":1,"rms_current_max":90,"update":{"progress":0,"state":"updating"},"update_available":false,"warn_d_p_s":null}'
Zigbee2MQTT:info  2022-10-05 17:43:18: MQTT publish: topic 'zigbee2mqtt/Linky', payload '{"active_register_tier_delivered":"TH..","apparent_power":310,"available_power":30,"current_summ_delivered":7919.09,"current_tarif":"BASE","linkquality":54,"meter_serial_number":"<SNIP>","rms_current":1,"rms_current_max":90,"update":{"progress":0,"state":"updating"},"update_available":false,"warn_d_p_s":null}'
zlinky config: historique, single_phase, false, BASE
Zigbee2MQTT:info  2022-10-05 17:44:06: MQTT publish: topic 'zigbee2mqtt/Linky', payload '{"active_register_tier_delivered":"TH..","apparent_power":310,"available_power":30,"current_summ_delivered":7919.09,"current_tarif":"BASE","linkquality":54,"meter_serial_number":"<SNIP>","rms_current":1,"rms_current_max":90,"update":{"progress":0,"state":"updating"},"update_available":false,"warn_d_p_s":null}'
Zigbee2MQTT:info  2022-10-05 17:44:06: MQTT publish: topic 'zigbee2mqtt/Linky', payload '{"active_register_tier_delivered":"TH..","apparent_power":310,"available_power":30,"current_summ_delivered":7919.09,"current_tarif":"BASE","linkquality":55,"meter_serial_number":"<SNIP>","rms_current":1,"rms_current_max":90,"update":{"progress":0,"state":"updating"},"update_available":false,"warn_d_p_s":null}'
Zigbee2MQTT:info  2022-10-05 17:44:06: MQTT publish: topic 'zigbee2mqtt/Linky', payload '{"active_register_tier_delivered":"TH..","apparent_power":310,"available_power":30,"current_summ_delivered":7919.09,"current_tarif":"BASE","linkquality":55,"meter_serial_number":"<SNIP>","rms_current":1,"rms_current_max":90,"update":{"progress":0,"state":"updating"},"update_available":false,"warn_d_p_s":null}'
Zigbee2MQTT:info  2022-10-05 17:44:06: MQTT publish: topic 'zigbee2mqtt/Linky', payload '{"active_register_tier_delivered":"TH..","apparent_power":310,"available_power":30,"current_summ_delivered":7919.09,"current_tarif":"BASE","linkquality":54,"meter_serial_number":"<SNIP>","rms_current":1,"rms_current_max":90,"update":{"progress":0,"state":"updating"},"update_available":false,"warn_d_p_s":null}'
Zigbee2MQTT:info  2022-10-05 17:44:06: MQTT publish: topic 'zigbee2mqtt/Linky', payload '{"active_register_tier_delivered":"TH..","apparent_power":310,"available_power":30,"current_summ_delivered":7919.09,"current_tarif":"BASE","linkquality":55,"meter_serial_number":"<SNIP>","rms_current":1,"rms_current_max":90,"update":{"progress":0,"state":"updating"},"update_available":false,"warn_d_p_s":null}'
Zigbee2MQTT:info  2022-10-05 17:44:19: MQTT publish: topic 'zigbee2mqtt/Linky', payload '{"active_register_tier_delivered":"TH..","apparent_power":310,"available_power":30,"current_summ_delivered":7919.09,"current_tarif":"BASE","linkquality":55,"meter_serial_number":"<SNIP>","rms_current":1,"rms_current_max":90,"update":{"state":"available"},"update_available":true,"warn_d_p_s":null}'
Zigbee2MQTT:info  2022-10-05 17:44:19: MQTT publish: topic 'zigbee2mqtt/bridge/log', payload '{"message":"Update of 'Linky' failed (Timeout: device did not request any image blocks)","meta":{"device":"Linky","status":"update_failed"},"type":"ota_update"}'
Zigbee2MQTT:info  2022-10-05 17:44:19: MQTT publish: topic 'zigbee2mqtt/bridge/response/device/ota_update/update', payload '{"data":{"id":"Linky"},"error":"Update of 'Linky' failed (Timeout: device did not request any image blocks)","status":"error","transaction":"h2zpj-10"}'
Zigbee2MQTT:error 2022-10-05 17:44:19: Update of 'Linky' failed (Timeout: device did not request any image blocks)

De même, dans ZHA, l'update semble démarrer mais rester à 0%.

Auriez vous une idée de quel pourrait être mon problème?

Cordialement,

fairecasoimeme commented 2 years ago

Bonjour, Pour le moment, il n'y a pas de compatibilité OTA avec la zigate et (ZHA/Z2M). Je travaille sur le sujet.

forty commented 2 years ago

Ah super, content de savoir que ce n'est pas moi qui faisait n'importe quoi :)

Question (peut être stupide, pardon, je débute en domotique): est ce que le support compatibilité OTA sur lequel vous travaillez se fait au niveau du firmware ou coté Z2M? (via un driver zigate?).

Si le changement est coté firmware, sera il possible de mettre à jour par un autre moyen pour avoir le firmware compatible OTA zigate/Z2M? J'ai cru comprendre que sur les version récente du Zlinky, l'OTA était le seul moyen de mettre à jour.

Hedda commented 2 years ago

For your information, ZHA integration in Home Assistant uses zigpy library for OTA, see zigpy feature request -> https://github.com/zigpy/zigpy/issues/1060

Once such OTA provider is zigpy then can use OTA in ZHA https://www.home-assistant.io/integrations/zha#ota-firmware-updates

forty commented 2 years ago

@Hedda when testing with ZHA I was downloading the firmware manually. ZHA did attempt to do the OTA (meaning that the firmware was correctly picked up) but it remained stuck at 0% progress. Z2M does automatically download the firmware, but then had the same issue and remained stuck à 0% progress.

If there is currently no OTA support for zigate on ZHA & Z2M, as @fairecasoimeme mentioned, it makes sense that it doesn't work I guess (I'm pretty new to home automation and I'm a bit baffled that every dongle/object/software triplet must be integrated separately with custom code and/or firmware - but from what I have been seeing so far, it seems to be the norm)

Hedda commented 2 years ago

@Hedda when testing with ZHA I was downloading the firmware manually. ZHA did attempt to do the OTA (meaning that the firmware was correctly picked up) but it remained stuck at 0% progress.

OTA should work in ZHA (zigpy) if you manually downloaded the correct file and copy to the correct location (unpacked/uncompressed files only), and if that does not work then it might be an issue (e.g. a bug) with the zigpy library code that ZHA depends on, or it could just be that file was corrupted during download (or not unpacked/uncompressed).

https://github.com/zigpy/zigpy

https://github.com/zigpy/zigpy/issues

Maybe you could try with "zha-toolkit" which I believe has specifically been tested with ZHA and the LiXee ZLinky_TIC device, see:

https://github.com/mdeweerd/zha-toolkit#ota_notify

https://github.com/mdeweerd/zha-toolkit

forty commented 2 years ago

@Hedda well I can try to redo the setup with ZHA and capture the logs, but it was essentially the same as the ones I shared for Z2M (ie the OTA starts, hang at 0% and ends up timing out). I have also tried triggering the OTA "manually" following some discussion here https://forum.hacf.fr/t/zha-ota-update-firmware/9693 with same result

service: zha.issue_zigbee_cluster_command
data:
  ieee: "00:15:8d:00:05:d2:9a:35"
  endpoint_id: 1
  cluster_id: 0x0019
  cluster_type: out
  command_type: client
  command: 0
  args:
    - 0 
    - 100
Hedda commented 2 years ago

If you still have that specific problem with it hanging at 0% when trying to update correct the OTA firmware image with the ZHA integration in Home Assistant (which depends on the zigpy library) then suggest collect new debug logs after enabled debug logging and report that issue with to either Home Assistant core repository and/or the zigpy repository:

https://www.home-assistant.io/integrations/zha#debug-logging

https://www.home-assistant.io/integrations/zha#reporting-issues

https://github.com/home-assistant/core/issues

https://github.com/zigpy/zigpy/issues

mospaeda commented 2 years ago

Hello My conf is as follow : Raspberry / ZiGate+ / Zlinky firmware 9 Home Assistant 2022.11.1 Supervisor 2022.10.2 Operating System 9.3 Interface utilisateur : 20221102.1 - latest

I prepared OTA in the configuration.yaml file with

zha:
  zigpy_config:
    ota:
      otau_directory: /config/zigpy_ota
      ikea_provider: true
      ledvance_provider: true

and dowloaded in /config/zigpy_ota with wget the latest version of Zlinky firmware (currently 11)

After restart, the output is

image

forty commented 1 year ago

Bonjour @fairecasoimeme 👋

Auriez vous une update de l'avancée du support OTA avec ZHA/Z2M et Zigate? Pouvons nous aider d'une manière ou d'une autre? (Test, log, autre?)

Merci !

mospaeda commented 1 year ago

Bonjour @fairecasoimeme

Est ce que la mise à jour depuis Zigate du Zlinky est programmée ? Y a t'il un autre moyen de faire la mise à jour de Zlinky ? avec un autre dongle Zigbee? Dans ce cas lesquels sont compatibles?