Zigbee Coordinator Light Example App


This document discusses how to use the Zigbee Light Example App and the different parts that compose it. Zigbee Light Example Application is an example which exercises different features of TI Z-Stack.

Some of the features exercised include:

Hardware Prerequisites

Software Prerequisites

Functional Description

Software Overview

This section describes the software components and the corresponding source files.

Application Files

Configuration With SysConfig

SysConfig is a GUI configuration tool that allows for TI driver and stack configurations.

To configure using SysConfig, import the SysConfig-enabled project into CCS. Double click the *.syscfg file from the CCS project explorer, where * is the name of the example project. The SysConfig GUI window will appear, where Zigbee stack and TI driver configurations can be adjusted. These settings will be reflected in the generated files.

The example project comes with working default settings for SysConfig. For the purposes of this README, it is not recommended to change the default driver settings, as any changes may impact the functionality of the example. The Zigbee stack settings may be changed as required for your use case.

Note that some Z-Stack settings are stored in non-volatile storage, and Z-Stack prioritizes stored settings over SysConfig settings. To guarantee SysConfig settings are applied, perform a factory reset of the device to clear non-volatile storage.

Example Usage

This section describes how to use this sample application.



Serial interface

The connection will have the following settings:

    Baud-rate:     115200
    Data bits:          8
    Stop bits:          1
    Parity:          None
    Flow Control:    None

Note: The serial output is known to be formatted incorrectly in Tera Term and in the CCS Terminal.

The serial interface allows you to control the commissioning configuration as well as application behavior. The commissioning interface is common for all applications and is implemented in the module zcl_sampleapps_ui.c/.h. Any application specific behavior of the serial interface is implemented in the example application files.

The serial interface implements a common set of menus described in 'Application Overview' within the Zigbee docs in this SDK. This common menu can be used to commission the device into a network.

Commissioning the Device Into the Network

Zigbee coordinators can only create networks and other devices must join the network. This is done using the common interface by enabling Formation Mode and executing the commissioning process in the Commissioning Screen. This sample application uses the stack notifications (zstackmsg_CmdIDs_BDB_NOTIFICATION) on a successful network formation process to open the network and allow new devices to join, even if the Steering Mode is not enabled from the common user interface. If the network is closed, it can be opened again by enabling the Steering Mode and executing the commissioning process in the Commissioning Screen.

Interfacing with the Switch Example App

Once the Light and Switch device are in the same network, enable the Finding and Binding Mode and execute it from the Commissioning Screen. When Finding and Binding is executed, the Light device be set in Identify mode for 180 seconds. During this time the Switch device must perform Finding and Binding as well to find the Light device in Identify mode and create a bind to it. The status of the Identify process is shown in the BDB status line.


Finding and binding status in the BDB status line

IdXXX shows the remaining XXX seconds in Identify mode, SrchYYY/ZZ shows the remaining YYY seconds searching for devices in Identify mode and ZZ the number of binds created during this process. Once the Switch device has the bind, it will be able to toggle the Light in the Toggle Light screen.

Light device will set IdXXX, while Switch device will set SrcYYY and count the binds in ZZ. Multiple devices can perform this procedure at the same time, by default up to 4 lights can be binded to a single Switch (defined by NWK_MAX_BINDING_ENTRIES). There is no limit on the number of Switches that can control a single Light.

Enter into App Menu to access to application specific application controls.


Application menu entrance screen

The local Light can be Toggled in the Toggle Screen. This can be done in the Light device to Toggle the Light locally, or can be done remotely by Switch device. The state of the Light will be displayed on the Application Status line



Toggle light menu and Light state in App Status line

The light device can also report its light state if it creates a bind to another device. SampleLight and Switch provide a Discover mechanism to allow a Light device create a bind to a Switch to illustrate this.

  1. In the App Menu of the switch device go to the Discover screen and execute it, it will set the switch in identify mode.
  2. In the App Menu of the Light device go to the Discover screen and execute it, that will make Light device to send an Identify Query request.


Discover menu

When Switch devices responds to this query, the Light device will discover the missing information from the responding device to create the bind, after which it will start sending reports when the light state changes or periodically every 10 seconds.