I don't understand Zigbee OTA, can someone help?

This weekend I created a flatcar VM to run openhab in a docker. Added a zigbee USB stick and once that was running (it took a bit more time than “once” :wink: ) I added to things to my brand new openhab:

  • Ember Coordinator
  • Ikea Inspelning

This seems to work fine, although the ikea plug is providing the wrong information, for which a firmware update to inspelning exists.

I have read Zigbee binding documentation, focusing on the part where it says: # # Device Firmware Updates (there is a typo in the markdown # # should be ##)

If I understand that part of the documentation correctly then firmware updates are done automatically by request of a ZigBee device. And as the request interval is a given of the ZigBee device, I don’t need to do anything but to patiently wait for an update to happen.
Correct :question:

When I run Zigbee commands in the console, I get:

openhab> zigbee otaupgrade
Address    Ieee Address      State     
E02A/1     94EC32FFFE0049A5  OTA_UNINITIALISED

But I can’t find any documentation on that, what does OTA_UNINITIALISED mean :question:

I have also read these forum post:

I also had a look at the github that is mentioned in the documentation: Koenkk OTA, the README of that github says: have a look at the index.json. It shows me there is an update for the device I am looking at:

{
    "fileName": "inspelning-smart-plug-soc_release_prod_v33816645_02579ff4-6fec-42f6-8957-4048def87def.ota",
    "fileVersion": 33816645,
    "fileSize": 294530,
    "url": "https://github.com/Koenkk/zigbee-OTA/raw/master/images/IKEA/inspelning-smart-plug-soc_release_prod_v33816645_02579ff4-6fec-42f6-8957-4048def87def.ota",
    "imageType": 40766,
    "manufacturerCode": 4476,
    "sha512": "76f16f4c2ca48a2b6a66693c3a2d4f85d2f52ff440cc09a565b5856d46a872435b28c5a9b6746d50cb2425555db9bdf41ae05e1a17b0292095198af53552e5eb",
    "otaHeaderString": "GBL inspelning_smart_plug_soc\u0000\u0000\u0000"
  },

Using the file above could I also " force" an update :question:
What would be the steps to do so :question:
(Openhab files in the docker are linked to local /opt/openhab)

1 Like

had a look in my userdata folder and saw this:

/opt/openhab/userdata/zigbee/firmware/github.com/Koenkk/zigbee-OTA/raw/master/images/Hue $ ls -al
total 272
drwxr-xr-x. 2 core core   4096 Jan 19 14:29 .
drwxr-xr-x. 4 core core   4096 Jan 20 22:11 ..
-rw-r--r--. 1 core core 267452 Jan 20 17:50 100B-010C-01001A02-ConfLight-Lamps_0012.zigbee

So I created a folder with the same"naming convention" and added the file mentioned in my first post:

/opt/openhab/userdata/zigbee/firmware/github.com/Koenkk/zigbee-OTA/raw/master/images/IKEA $ wget https://github.com/Koenkk/zigbee-OTA/raw/master/images/IKEA/inspelning-smart-plug-soc_release_prod_v33816645_02579ff4-6fec-42f6-8957-4048
def87def.ota

And then used openhab console in docker:

$ docker exec -it openhab-server /openhab/runtime/bin/client
......
openhab> zigbee otaupgrade start 57386/1 zigbee/firmware/github.com/Koenkk/zigbee-OTA/raw/master/images/IKEA/inspelning-smart-plug-soc_release_prod_v33816645_02579ff4-6fec-42f6-8957-4048def87def.ota
OTA File "zigbee/firmware/github.com/Koenkk/zigbee-OTA/raw/master/images/IKEA/inspelning-smart-plug-soc_release_prod_v33816645_02579ff4-6fec-42f6-8957-4048def87def.ota" set for node E02A/1
OTA File: ZigBeeOtaFile [headerVersion=256, headerLength=56, manufacturerCode=4476, imageType=9F3E, fileVersion=02040045, stackVersion=ZIGBEE_PRO, headerString=GBL inspelning_smart_plug_soc, imageSize=294530]

openhab> zigbee otaupgrade state 57386
OTA Upgrade configuration for E02A/1
Current state    : OTA_TRANSFER_IN_PROGRESS
Firmware Version : 02040034

...long wait...

openhab> zigbee otaupgrade state 57386                                                                        
OTA Upgrade configuration for E02A/1
Current state    : OTA_UPGRADE_COMPLETE
Firmware Version : 02040045

So I was able to do an update. But still would like to know:
Is this how it is supposed to work :question:
Or will it actually automagically be able to do do an update without user interference :question:

In principle it should download the files automatically from the web, and update them. Note though that this can take days since most devices will only make a request once per day, and the way the system works it will take a couple of requests.

1 Like