dresden-elektronik / deconz-ota-plugin

Server side implementation of the standard Zigbee OTA protocol.
BSD 3-Clause "New" or "Revised" License
47 stars 13 forks source link

Issue updating Tradfri control outlet #21

Closed felker closed 3 years ago

felker commented 3 years ago

Thanks for all the great work you do on this plugin and deCONZ generally!

I thought I would dip my toe into understanding and using OTAU the other day, and I might have messed up my Zigbee network. I am on Raspberry Pi OS (Buster) and am using a Conbee II. My network consists of Xiaomi Aqara devices and IKEA Tradfri devices, including 3x Control Outlets. I noticed that they were on an old firmware version 1.4.020, so I thought I would attempt to update them to v2.0.024.

I used ikea-ota-download.py and opened the deCONZ GUI, which resulted in the correct conversion of the firmware file ~/otau/117C-1101-20024623.zigbee. I opened up the STD OTAU Plugin pane in the deCONZ GUI, ran Query on the 3x control outlets (took 15-20 min for each plug to get to 100%), then selected the "Otau file", and attempted to Update. Pressing the Update button did not appear to do anything, although I may have seen the node indicator lights flash red in the network visualization. I waited 30 mins, and nothing appeared to change. I attempted to Read the Basic Attributes in Cluster Info, power cycled the device, and nothing made the control outlet show that an update to the newer firmware occurred. So finally I rebooted my RPi, and deCONZ was unable to bring up my Zigbee network. It only detects the Aqara devices now. 

Where did I go wrong in the firmware update? Do I need to fully reset and re-pair the Tradfri control outlets to get them working agin?

ebaauw commented 3 years ago

Normally, when you press Query, the Entry in the table of the OTAU panel should show the device data and the file should be selected automatically. If you see a red status “light” on the node, it means the gateway gets no response from it. Maybe the outlet already dropped off the network?

felker commented 3 years ago

Strange. The file definitely was not selected automatically after a Query. Possible bug?

Should I reset my control outlets and re-pair?

I will methodically try the firmware update again once I manage to get it reconnected to the network.

ebaauw commented 3 years ago

Possible bug?

Doubt it. I think the outlet already dropped off the network.

Should I reset my control outlets and re-pair?

I'd try a power cycle first (unplug and plug). If that doesn't revive them, open the network and reset the device. I wouldn't delete it from deCONZ.

felker commented 3 years ago

Still learning about all the things that are possible through the deCONZ GUI. I just tried Reset node, and the status light turned solid yellow before blinking red 3x. So no luck with that approach. Same result after power cycling an outlet.

Delete and re-add now?

Very unusual--- not sure how I managed to put the outlets in this state

felker commented 3 years ago

Fortunately, I was able to get the plugs back on the network by permitting devices to join (via Phoscon web app, Add New Lights), and briefly pressing a paper clip in the reset switch (didnt need to hold it, apparently). They showed back up as connected in the GUI network just as they were before, and all my Homekit integrations worked right away

For each of the smart outlets, I read the Basic cluster attributes in the GUI, which showed that apparently their firmware was successfully updated to 2.0.024. But I had to restart deCONZ to get the firmware versions to sync/update in the Node List. #15 was helpful for figuring this out.

Now I am having more trouble with updating the firmware for the Tradfri Wireless Dimmer (on/off switch). I think this is because they are battery powered? I attempted to Read the "SW Build ID" attribute, but I get "Read Failed".

Also, what does it mean when the OTAU table shows 0 values for all the nodes? It seems like some of them eventually get populated over time, but the Query button seems to do nothing at first. image

austwhite commented 3 years ago

I just raised a similar issue for Hue devices in Australia. No matter how many times I press Query, progress will always show "No file" Not sure if it is related.

ebaauw commented 3 years ago

It seems like some of them eventually get populated over time, but the Query button seems to do nothing at first.

All devices supporting OTAU should eventually query the OTAU server and get their entry in the table populated. This might take a week or so on slow devices. Some cheaper devices expose the OTAU cluster, but don't seem to have implemented it. Make sure the battery-powered device is awake when pressing Query. Even then, not all devices will poll their parent on waking up, remaining unreachable.

austwhite commented 3 years ago

For me, some of the data gets populated eventually but I never see a firmware file, but I know there have been updates as some globes still on a hue bridge have had two or three updates in the same time period. The gloves are all mains powered and always have power applied.

felker commented 3 years ago

Are you aware of anyone that has successfully performed OTAU on battery-powered IKEA devices?

ebaauw commented 3 years ago

I have.

samnewman86 commented 3 years ago

I have managed to update one of my four remotes. It took 4 hours

felker commented 3 years ago

@ebaauw thanks this is very informative.

@samnewman86 did you try to update the other 3x and it failed? Or was there no issue?

samnewman86 commented 3 years ago

Eventually, very slow progress 🤪

felker commented 3 years ago

I will post my failing methodology for trying to get the IKEA Tradfri Wireless Dimmer (on/off switch) to somehow get its OTA update in case you have a spare minute to check it for anything obviously wrong, @ebaauw.

E.g. the "Switch for Christmas Lights" in the attached photos, address ends in 4199. Vendor=0x117c, Image=0x11c5.

image

On Firmware version 1.4.018, trying to update to 2.2.010. See below files in ~/otau/, which I had previously used to update my Tradfi Control Outlets. My device is about 10 feet away from my Conbee II during this process.

  1. Press the on switch; the indicator light next to the node in the deConz graph flashes blue once, then green (not sure what the different colors indicate here).
  2. Select the Basic Cluster in deConz. In the Cluster Info tab, press the read button. The indicator light flashes blue a few times, but none of the fields populate.
  3. In the STD OTAU Plugin window, it claims that the Last Image Query for this device was 15 hours ago, but it still shows the Progress=No file. Query button doesnt do anything image
  4. Try manually selecting the firmware file. The progress switches to "Idle". Try pressing "Update", nothing happens.

image

I have tried waiting several days to 1+ weeks after performing of these steps to observe any changes, and/or using the switch to try to "wake" it before querying it, updating it etc. Is there a specific step for this device that you are aware of?

➜  otau ls
10005777-6.1-TRADFRI-control-outlet-2.0.024.ota.ota.signed
10005778-10.1-TRADFRI-onoff-shortcut-control-2.2.010.ota.ota.signed
10032198-2.2-TRADFRI-gateway-1.12.31.p.elf.sig.ota.signed
10035514-2.1-TRADFRI-bulb-ws-2.3.050.ota.ota.signed
10035515-TRADFRI-bulb-cws-1.3.013.ota.ota.signed
10035534-2.1-TRADFRI-bulb-ws-gu10-2.3.050.ota.ota.signed
10037585-5.1-TRADFRI-connected-blind-2.2.009.ota.ota.signed
10037603-3.1-TRADFRI-signal-repeater-2.2.005.ota.ota.signed
10038562-2.1-TRADFRI-sy5882-bulb-ws-2.0.029.ota.ota.signed
10039874-1.0-TRADFRI-motion-sensor-2-2.0.022.ota.ota.signed
10040611-3.2-TRADFRI-sy5882-unified-2.3.050.ota.ota.signed
10043101-3.1-TRADFRI-dimmer-2.1.024.ota.ota.signed
10046695-1.1-TRADFRI-light-unified-w-2.3.050.ota.ota.signed
10047227-1.2-TRADFRI-cv-cct-unified-2.3.050.ota.ota.signed
10054470-TRADFRI-shortcut-button-2.3.015.ota.ota.signed
117C-0002-165801BC.zigbee
117C-1101-20024623.zigbee
117C-1102-22005631.zigbee
117C-1187-22009631.zigbee
117C-11C1-23014631.zigbee
117C-11C2-23028631.zigbee
117C-11C4-12214572.zigbee
117C-11C5-22010631.zigbee
117C-11C6-23015631.zigbee
117C-11C8-20022623.zigbee
117C-11CA-21024631.zigbee
117C-2101-12214572.zigbee
117C-2201-23050631.zigbee
117C-2202-23050631.zigbee
117C-2203-23050631.zigbee
117C-2801-13013572.zigbee
117C-4101-12245572.zigbee
117C-4103-23050631.zigbee
117C-4201-12224573.zigbee
117C-4202-12224573.zigbee
117C-4203-20029623.zigbee
117C-4204-20029623.zigbee
117C-4205-23050631.zigbee
117C-4206-23050631.zigbee
159495-TRADFRI-transformer-1.2.245.ota.ota.signed
159695-2.1-TRADFRI-bulb-ws-1000lm-2.3.050.ota.ota.signed
159696-TRADFRI-bulb-w-1000lm-1.2.214.ota.ota.signed
159697-TRADFRI-driver-hp-1.2.224.ota.ota.signed
159698-TRADFRI-driver-lp-1.2.224.ota.ota.signed
159699-5.1-TRADFRI-remote-control-2.3.014.ota.ota.signed
159700-TRADFRI-motion-sensor-1.2.214.ota.ota.signed
159701-2.1-TRADFRI-wireless-dimmer-2.3.028.ota.ota.signed
190579-ncp572b444.ebl.ota.ota.signed
191100-4.1-TRADFRI-sy5882-driver-ws-2.0.029.ota.ota.signed
ebaauw commented 3 years ago

Press the on switch; the indicator light next to the node in the deConz graph flashes blue once, then green (not sure what the different colors indicate here).

See deCONZ for dummies.

Select the Basic Cluster in deConz. In the Cluster Info tab, press the read button. The indicator light flashes blue a few times, but none of the fields populate.

Like most battery-powered devices, the dimmer powers off its radio to preserve power, effectively becoming unreachable. You need to wake it by pressing a button when interacting with it from the GUI. If you cannot read the Basic cluster attributes, you won’t be able to get it to upgrade either. If it still doesn’t respond, try resetting and re-pairing the dimmer (don’t remove it from the GUI nor from the API).

The file should be selected automatically when the table entry fills. By design, the OTA upgrade for battery-powered devices needs to be started manually.

felker commented 3 years ago

I reset and re-paired the switch (took several tries via Phoscon, for some reason, like https://github.com/dresden-elektronik/deconz-rest-plugin/issues/2107) and rebooted deCONZ. I was able to read the Basic cluster attributes, and the STD OTAU table is slowly updating, see attached.

image

However, the first table row that was filled was my other Tradfri on/off switch (whose Basic attributes I can still read), and it was populated with No File. What should I do in this case? I expect the same result for the switch I reset. Does this imply that 117C-11C5-22010631.zigbee is somehow invalid?

ebaauw commented 3 years ago

The OTAU panel shows "OTAU disabled"?! It showed "OTAU enabled" in your previous screenshot.

You can enabled it in the old web app (under Advanced Settings) or through ph -p put /config '{"otauactive": true}'.

felker commented 3 years ago

Thanks; I ran that command and it immediately switched to Enabled and the Progress switched to Idle (file still not selected, but hopefully eventually it will automatically select it on the next query?). Not sure how it was Enabled before in the past, since I have never run an explicit command. Perhaps pressing the Update button in previous deCONZ sessions Enabled it?

image

ebaauw commented 3 years ago

If it shows Idle, it has matched a file. You need to start the update manually, by pressing Update, making sure the device is awake. The Idle changes into a percentage. It typically takes up to four hours to update a battery-powered device; make sure there’s plenty of juice in the battery.

felker commented 3 years ago

Interesting that it didnt show a file in the previous image, even though it was Idle. But I did check on it a bit after that, and saw that the Otau File, etc. fields were populated for that device. I clicked Update and pressed a button on the remote to wake it up, and indeed the Idle changed into a percentage. Thanks so much for your help and for creating a great tool!

I hope that this walkthrough will prove useful for others who are having issues and googling around.

felker commented 3 years ago

@ebaauw another follow up question: what does it mean when the update Progress column starts ticking backwards? One problematic Tradfri switch placed 5 cm from the Conbee II jumped to 0.05% after I hit the Update button while waking it, made it as far as 0.10%, then was back at 0.02% when I checked on it a few hours later.

felker commented 3 years ago

I have tried a couple more times with that switch and it seems to keep getting stuck at 0.02% with Time listed as 0:10

ebaauw commented 3 years ago

The device is abandoning the update. Some pointers at throubleshooting:

felker commented 3 years ago

Installing a fresh battery finally solved the issue for me. Note, after both switch firmware updates, I had to remove the battery, delete the switches from Phoscon, and re-add them to the network to get them to respond. They would appear in deCONZ with flashing green and blue status symbols, indicating communication with the coordinator, but I would be unable to read any of the Basic cluster attributes or use the switch in Homebridge until they were reset.