Koenkk / zigbee2mqtt

Zigbee 🐝 to MQTT bridge 🌉, get rid of your proprietary Zigbee bridges 🔨
https://www.zigbee2mqtt.io
GNU General Public License v3.0
11.79k stars 1.64k forks source link

OTA check for new firmware does not check #17740

Closed mmattel closed 1 month ago

mmattel commented 1 year ago

What happened?

Having two Bosch BTH II thermostats. I tried to update one, which failed telling about an issue in OTA communication. The other one worked. As you can see in the image, it shows that the firmware was updated on the second one but the first one still hast the old FW. Clicking on Check for new updates does not change the situation. Also tried to trigger via MQTT with zigbee2mqtt/bridge/request/device/ota_update/check, but the response is the same:

{
  "data": {
    "id": "Wohnzimmer/KF-BTH-RA-LG",
    "updateAvailable": false
  },
  "status": "ok",
  "transaction": "wiqry-1"
}

image

I have checked if the device is able to communicate to change requests and this works without issues.

It just seems that there was a "glitch" in the update communication. But whyever, the code does not respect the FW difference on manual check request. From an outer perspective, something is preventing this check.

Note that the battery is full (95%) on both thermostats.

Trying to update via MQTT returns:

{
  "data": {
    "id": "Wohnzimmer/KF-BTH-RA-LG"
  },
  "error": "Update of 'Wohnzimmer/KF-BTH-RA-LG' failed (No new image available)",
  "status": "error"
}

What did you expect to happen?

When pressing the manual check button or run a MQTT recheck and there is a FW differernce in installed vs available, the check must succeed.

How to reproduce it (minimal and precise)

Click check for new FW or via MQTT publish and it should tell that there is a newer FW available if the device shows a lower FW.

Zigbee2MQTT version

1.30.4 commit: b2dd21e

Adapter firmware version

20221226

Adapter

Sonoff_Zigbee_3.0_USB_Dongle_Plus

Debug log

No response

DerDreschner commented 1 year ago

My guess is that the update worked and just the displayed build id and build date is wrong as it's cached. Could you check the response in the dev console with the following settings?

image

mmattel commented 1 year ago

hmmm, I tried, but...

I am confused and run out of ideas...

mmattel commented 1 year ago

While playing around to get the requested infos, "something has happened" (tm), see the images: The FW now shows the correct one, though the Update button shows up.

image

Then, clicking on update, it does nothing and changes to blue and funnily (without image posted) the other BTH shows now whyever that you can update the FW. This finally, and only goes away when clicking on Check all...

image

Seems that the code for the OTA handling needs some intense love.

DerDreschner commented 1 year ago

Hmm, that's strange. How does the information in the state tab of the top thermostat look like? Did you remove the batteries of the BTH-RA for a few seconds after the update?

mbak77 commented 1 year ago

I had the same 'issue', updated 5 thermostats - 3 of them updated without any issue, displayed version is 3.05.05, but for remaining 2 it stayed 3.04.04. I've restarted the devices by taking the battery off for a few seconds, but it didn't help - in z2m's OTA it was still 3.04.04. After reading those 2 attributes mentioned above from a dev console, it somehow refreshed the data and already version is displayed correctly. Seems that FW update works fine, it's just some issue with refreshing the version id.

lux73 commented 1 year ago

this is a known "issue" - had the same Problem after updating my Danfoss TRV

ThatTallGuy21 commented 1 year ago

I had the same 'issue', updated 5 thermostats - 3 of them updated without any issue, displayed version is 3.05.05, but for remaining 2 it stayed 3.04.04. I've restarted the devices by taking the battery off for a few seconds, but it didn't help - in z2m's OTA it was still 3.04.04. After reading those 2 attributes mentioned above from a dev console, it somehow refreshed the data and already version is displayed correctly. Seems that FW update works fine, it's just some issue with refreshing the version id.

Yeah, same thing happened with some of my Inovelli blue switches. The firmware update occurs successfully behind the scenes but for some reason Z2M is caching something which makes it appear to be on the old firmware. The swBuildId trick mentioned above fixed the cached details and the firmware info displayed correctly for me.

github-actions[bot] commented 1 year ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days

pomeloy commented 1 year ago

Still an issue.

github-actions[bot] commented 1 year ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days

mmattel commented 1 year ago

keep open

ThatTallGuy21 commented 1 year ago

Yeah agreed, this should remain open. It doesn't seem like a show stopper kind of bug because a work around exists, but annoying nonetheless.

github-actions[bot] commented 1 year ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days

ThatTallGuy21 commented 1 year ago

keep open

github-actions[bot] commented 11 months ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days

ThatTallGuy21 commented 11 months ago

Keep open as all other related tickets mentioned above appear closed without a resolution.

hmaiss commented 11 months ago

Today I had the same problem while updating a brand-new BTH-RA form 3.02.05 to 3.05.05. dev console (see above) reported 3.05.05, while MQTT said "installed_version": 839193876 (= 3.02.05).

The solution was the orange button "reconfigure" ("Neu konfigurieren") in the Devices ("Geräte") view. Afterwards MQTT said "installed_version": 889525524 (= 3.05.05)

UPDATE: Immidiately after the OTA transfer of the update the "About" tab of the BTH-RA reported 3.02.05 even after a battery removal. About 2 hours later it reported 3.05.05 without further invention from my side during this time. I think the BTH-RA waits until there is some time of inactivity until the actual firmware update is performed.

fishi0x01 commented 9 months ago

z2m version 1.34.0-1. After OTA update 3.02.05 -> 3.05.05 the valve started having lots of communication issues - essentially climate.set service wasnt working reliably. Had to restart the valve (remove battery a few secs). Comms working again after that - however, still wrong firmware version displayed. Dev Console trick mentioned above didnt work for me. Restarted the z2m add-on and now proper firmware is displayed. All good again :)

DerDreschner commented 9 months ago

@mmattel : Did you got any errors during the update? Or did anything with the device at the end except maybe pushing the button when the calibration is requested? I look at the code right now and try to understand why this happens.

mmattel commented 9 months ago

@DerDreschner what happened is the following:

Many thanks for providing the upgrade capture 🎄

DerDreschner commented 9 months ago

@mmattel : Mhm, I see. It would be great to have a debug log from when this occurs. I also had a "invalid image" at the end of the firmware update once. After a reset by removing the batteries, the update went through flawlessly. Guess it would be the easiest to recommend that in the docs before each update (although I would hate to do that in larger installations personally).

@fishi0x01 @hmaiss @ThatTallGuy21 @mbak77 : In case anyone of you still has to do an update to the latest 3.05.09 from last week: Please enable debug logging before doing the update and - in case something goes wrong - paste the log file here. You can find more informations about how that works under this link: https://www.zigbee2mqtt.io/guide/usage/debug.html

Thanks!

hmaiss commented 8 months ago

I was able to update one BTH-RA without problems from 3.05.05 to 3.05.09.

DerDreschner commented 8 months ago

@hmaiss : Did you use Z2M version 1.35.0 from monday for the update?

hmaiss commented 8 months ago

@DerDreschner : I am somewhat behind with 1.33.1. I will use the current Z2M container when I update the 5 remainig BTH-RA after some time of testing.

hmaiss commented 8 months ago

@DerDreschner : Today I have updated the Z2M container from 1.33.1 to 1.35.1, wherein two BTH-RA where updated afterwards with debug logging enabled (https://www.dl3hm.de/log.zip).

The first BTH-RA was brand new. The update was from 3.02.05 to 3.05.09. At the end of the udate process some error messages showed up in the GUI. I was not able to directly read the swBuildId via the Developer Console. After removing and reinserting the battery everything was fine and the correct firmware version 3.05.09 showed up in the GUI. No GUI -> Devices -> reconfigure was necessary as in the past.

The second BTH-RA was updated from 3.05.05 to 3.05.09. At the end of a first run the transferred update was refused. Even after removing and reinserting the battery the old firmware version showed up in the GUI. The second run went fine. No battery removal or other steps where necessary to bring up the correct firmware version in the GUI. No error message showed up.

UPDATE: During the night I have seen a malfunction of the second BTH-RA (does not react to regular settings of pi_heating_demand). I have removed and reinserted the battery to solve this problem.

github-actions[bot] commented 2 months ago

This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 30 days