OTA updates - ius/zbminir2 GitHub Wiki

If your device already runs the custom firmware you can install updates over the air.

Refer to the Software preparation section of the Getting Started page for details on how to build the firmware - it also outputs an OTA image: zbminir2_0x1286_<version>.ota

This guide describes how to use an EZSP dongle to update the firmware - other OTA server implementations (such as Zigbee2MQTT) should also work but are not documented here.

Note

Make sure you've completed the steps up to and including the Software preparation section of the Getting Started page.

Re-enter the nix shell if needed: $ nix-shell nix/shell.nix

Hardware requirements

  • ZB-GW04 Zigbee dongle

Note

Other Silabs based dongles might work when flashed with EZSP firmware. Devices without hardware flow control (such as Sonoff ZBDongle-E) are currently incompatible with the SDK used by this project.

Flashing the dongle

Your dongle should be running EZSP/NCP firmware with a Zigbee stack version that corresponds to the Simplicity SDK used by this repository for building the software. At the time of writing this is version 8.1.0.

Tip

If not using a ZB-GW04, make sure to use the right firmware for your dongle

  1. Obtain 8.1.0 ncp firmware for your dongle - find the 8.1.0 release for ZB-GW04 here

    For ZB-GW04 use: easyiot_zb-gw04-1v2_zigbee_ncp_8.1.0.0_115200_hw_flow.gbl

  2. Flash the dongle:

$ sudo universal-silabs-flasher --probe-method ezsp --device /dev/ttyUSB0 \
	flash --firmware easyiot_zb-gw04-1v2_zigbee_ncp_8.1.0.0_115200_hw_flow.gbl

Run the Z3 gateway application

$ ./ota.sh 
Reset info: 11 (SOFTWARE)
ezsp ver 0x10 stack type 0x02 stack ver. [8.1.0 GA build 190]
[...]
Found OTA file 'zbminir2_0x1286_2.ota'
  Manufacturer ID: 0x1286
  Image Type ID:   0x0000
  Version:         0x00000002
  Header String:   zbminir2_0x1286_2
Found 1 files

Run the following commands to join an existing Zigbee network:

network leave
plugin network-steering start 0

A successful join looks like:

[...]
NWK Steering joining 0x1A62 on channel 11
SL_STATUS_NETWORK_UP 0xC9D1
NWK Steering stack status 0x15
NWK Steering network joined.

Send an OTA notify command to the device you wish to update. Replace the node id 0x1234 in the command below by the short node id of the device you wish to update.

plugin ota-server notify 0x1234 1 3 100 0x1286 0 2

The device should respond with a QueryNextImageRequest:

QueryNextImageRequest mfgId:0x1286 imageTypeId:0x0000, fw:0x00000001
Next fw version is: 0x00000002

Tip

If you don't get a response, instead form a new network and retry. This avoids issues with other OTA servers interfering.

network leave
plugin network-creator start 1
plugin network-creator-security open-network

Then join your target device to it by toggling the external switch 5 times in rapid succession.

Eventually the device should report its upgrade status (UpgradeEndReq) and reboot if the image is accepted (status: 0x00):

RX UpgradeEndReq status:00
Client 0x9A81 indicated upgrade status: 0x00
Upgrade End Response: Upgrade Now

An upgrade status other than 0x00 means an error has occurred.

Troubleshooting

Enable/disable printing of all received messages:

option print-rx-msgs enable
option print-rx-msgs disable
⚠️ **GitHub.com Fallback** ⚠️