Xbee3 Firmware Over The Air (FOTA) update using XCTU

Introduction

The ability to update Digi’s Xbee3 Zigbee radio firmware and application file system remotely and securely over the air is a very useful feature. The Zigbee node needing an update may be deployed in a difficult to reach location or it may just be more convenient to update the node without having to physically connect to it. Digi’s XBee 3 Zigbee RF Module supports firmware over-the-air (FOTA) updates using their XCTU configuration and test utility as well as Zigbee 3.0 Cluster Library specifications. To perform a FOTA update, the device to be updated must be associated and communicable with a Zigbee network.

In this example project a Zigbee sensor node located on the roof of Digi-Key Electronics headquarters building has it’s MicroPython application file system updated remotely “Over The Air” from an indoor Zigbee node located in engineering. Digi’s XCTU Configuration & Test Utility software is used to build a new application firmware image and send over the air to the remote Zigbee node. XCTU uses a public/private ECDSA signing key pair. to implement the update securely.The steps covered in this example are: Generate a public/private key pair, Set the public key on the XBee 3 device, Create the OTA file system image, Perform the OTA file system update on the remote node, and reset the remote node to restart MicroPython and the updated application. The FOTA process for both the XCTU tool and Zigbee 3.0 Cluster Library specifications is described in detail in XBee3 Zigbee 3.0 Module User Guide.

(note: the FOTA process using XCTU for both 802.15.4 and Digi-Mesh firmware versions of Xbee3 modules is the same as the Zigbee firmware versions, see XBee3 802.15.4 RF Module User’s Manual and Digi XBee3 DigiMesh 2.4 RF Module User Guide for detailed information)

Hardware

Supplier Documentation

What is XCTU?

XCTU is Digi’s free multi-platform configuration and test utility that enables developers to interact with their RF modules through a simple-to-use graphical interface. It includes all of the tools a developer needs to quickly get up and running with XBee. Features include network view, which graphically represents the XBee network along with the signal strength of each connection, and the XBee API frame builder, which helps to build and interpret API frames for XBees being used in API mode. XCTU includes a set of embedded tools such as: Frames generator to easily generate any kind of API frame to save its value; Frames interpreter to decode an API frame and see its specific frame values; Recovery to recover radio modules which have damaged firmware or are in programming mode; Load console session to load a console session saved in any PC running XCTU; Range test to perform a range test between 2 radio modules of the same network; Firmware explorer to navigate through XCTU’s firmware library.

Installation

The latest version of XCTU can be downloaded from DOWNLOAD XCTU .

Step 1: Configure Hardware and use XCTU to generate a public/private key pair

The Zigbee radio used to remotely update the remote node located on the roof is an Xbee3 Zigbee module mounted in a Xbee Grove board. It is connected over USB to a Windows 10 laptop running XCTU. The Zigbee radio (Xbee3/Grove board) being used to send the updated file system must be part of the same Zigbee network as the remote node being updated.

Since OTA file system updates are signed, remote devices must be configured so that they can validate incoming updates. Digi International Xbee File System Update security is based on the Elliptic Curve Digital Signature Algorithm (ECDSA). To set up a network for OTA file system updates:

  1. In XCTU select File System Manager in Tools. In File System Manager select Keys and then Generate to generate a public/private ECDSA signing key pair. Name and save the public and private keys to your computer.
  2. Parameter FK (File System Public Key) on all devices that will receive OTA file system updates must be configured with the generated public key.

Step 2: Set the public key on the remote XBee 3 device

The Xbee3 device having the file system remotely updated must have previously had the public key installed. Setting the file system public key on an Xbee3 device needs to done locally with a XCTU wired connection. XBee 3 firmware DOES NOT support remotely setting the file system public key at this time.

  1. In XCTU open the configuration view of the target device and go to the File System Options category.
  2. In the File System Public Key row, click Configure.
  3. In the Configure File System Public Key dialog box, click Browse and choose the .pem file that you saved the public key into. Once this is done, the HEX value of the public key is visible under the Public key section on the dialog box as shown.
  4. Click OK to ensure that the key gets written into the device.

Step 3: Create the OTA file system image

To create the OTA file system image:

  1. In Tools open the File System Manager dialog box.
  2. Open a connection on the device that you want to generate the OTA file system image from.
  3. Click FS Image.
  4. In the Generate a signed file system image window that displays, click Browse and choose the .pem file that the private key was stored in.
  5. Once the path shows up on the Private Key file field, click Save to assign the .fs.ota an appropriate file name and location.

Step 4: Perform the OTA file system update

  1. To add the target remote device, click Discover radios in the same network from the source device. In this example “Network_Probe2” is the source and “Code Builder” is the remote target.
  2. Enter Configuration mode on the remote device (Code Builder).
  3. Click the down arrow next to the Update button and choose Update File System.
  4. Choose the OTA file system image (.fs.ota) that the target node needs to be updated to.
  5. Select Open

Remote file system being updated.

XCTU message when remote file system update complete.

image

Step 5: Reset remote node to restart MicroPython application

Follow instructions in XBee3 Over The Air Remote AT Command Using XCTU to send a FR (Firmware Reset) to the remote node over the air. Resetting the remote restarts MicroPython and the updated file system application.