Basic Firmware Update

Demonstrates activating a device with a specified product, using the DMS.

API Features Demonstrated


This app works on:

Requirements and Prerequisites

This app requires a ZentriOS evaluation board. See the Platforms list above.


This demonstration 'activates' a device with the specified product.

This is for demonstration purposes only.

Typically the device is activated with a product during manufacturing.

This allows for switching the device's product and thus switching the device's firmware.

Note: The account which 'claims' this device must have access to the given product. See zn_dms_claim for more information.

Usage Instructions

Open a ZentriOS serial terminal to the device. See Getting Started, Opening a ZentriOS Terminal.

This app requires your ZentriOS device to be set up with the credentials to join your local network. If you have not already set up network credentials, on the ZentriOS terminal, run the commands:

network_up -s

See the Wi-Fi Command API documentation for network_up and save.

You may have to change the defined PRODUCT_CODE to a product accessible to your device and account. In the output below the value is:


No interaction is required.

After building, downloading and running the ZAP, the output is similar to the following:

> Firmware Update Example App start ...
[Associating to Zentri_Guest]
> Obtaining IPv4 address via DHCP
IPv4 address:
Current firmware verison: ZENTRI-OM13086SCCK_ZAP-, 2016-04-22T07:24:59Z, ZentriOS-WZ-
Activating device with product code: ZENTRI-BAHELLOWORLD
Request POST /activate
Connecting (https):
Starting TLS
Checking for new firmware ...
Request GET /ota?bundle_id=213142c9-a635-4d35-86f6-793e818a457c
Connecting (https):
Starting TLS
New firmware available: ZENTRI-BAHELLOWORLD-, 2016-02-24T04:00:50Z, ZentriOS-WZ-

*** Starting firmware update ...

Request GET /ota?bundle_id=213142c9-a635-4d35-86f6-793e818a457c
Connecting (https):
Starting TLS
UUID: 4BA004772430020F45501EAA52139254C50700F5
Connecting to network
Request POST /ota
Connecting (https):
Starting TLS
Bundle size: 638976, Free space: 827392, Core size: 442368
Bundle version: ZENTRI-BAHELLOWORLD-, 2016-02-24T04:00:50Z, ZentriOS-WZ-
Bundle ID: ce76c661-acae-4766-a36d-493d8080c8f8
Downloading new firmware...
Setting boot image to sys/services.bin (0)
Booting to new image
JTAG debug enabled
Posting OTA result to DMS
[Associating to Zentri_Guest]
> [Associated]
> Request POST /ota/result
Connecting (https):
Starting TLS
JTAG debug enabled
OTA completed successfully
> zap_run
> Hello world!!
JTAG debug enabled




This demonstration runs once and then terminates.

The sequence of steps is: