Zigbee Coordinator Zone Device

Introduction

This document discusses how to use the Zigbee Zone Example App and the different parts that compose it. Zigbee Zone 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.

Buttons

LEDs

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 CIE Example App using Zone Cluster

Upon joining the network, any CIE already present in the network will attempt to write its IEEE address in the Zone Device, after which, the serial UI or the Button-2 can be used to send an Enroll Request command. This will cause the CIE to issue an Enrollment Response command containing the Zone ID assigned to the Zone Device. This Zone ID will be used when the Zone device generates a Change Notification.

Once the device is enrolled, the user can send Change notifications toggling between fire alarm and No-Alarm notifications with the UI or by pressing Button-2.

Becoming discoverable to CIE

If the CIE does not write the IEEE address into the Zone device, the discovery process can be triggered from the App Menu with the Discover screen by pressing Enter on this screen. To allow Zone devices to be discovered by CIE, follow these steps in CIE and Zone device:

  1. In Zone's App Menu, go to the Discover screen and execute it. From here you can enable or disable Identify mode on the Zone.
  2. In CIE's App Menu, go to the Discover screen and execute it. This will discover the Zone device and will trigger the commissioning method on CIE to write its IEEE address into the Zone device.

DiscoverableScreen

Discover screen

Using the serial UI

Enter into App Menu to access to application specific controls.

AppMenu

Application menu entrance screen.

Inside of the application menu there are 4 screens: Enrollment Mode, Manual Discovery, Send Enroll Request, and Toggle Alarm.

  1. The Enrollment Mode screen can be used to change the current Enrollment Mode. Modes supported in this sample application are Trip-To-Pair and Auto Enroll Request.

    Zone-Status.png

  2. The Manual Discovery screen is explained more in the previous section.

  3. The Send Enroll Request screen can be used when using the Trip-to-Pair enrollment method. This screen will manually send a Zone Enroll Request to the CIE, if the CIE's IEEE Addr has already been written to the local device.

    Zone-Status.png

  4. The Toggle Alarm screen can be used to change the alarm state of the local device, which will update the Zone Alarmed status line element locally, and it will also send a Zone Change notification to the CIE.

    Zone-Status.png

This application also has 2 status lines, which displays various information about the current state of the IAS Zone cluster on the local device.

Zone Status Lines

After Zone device joins a network, the CIE IEEE Addr will be populated by the CIE, and then the Zone device may send an Enroll Request to the CIE, after which the status line elements above will be updated appropriately.

The Enrollment status screen summarizes the enrollment status of the Zone device by displaying if the process is completed or not. This screen also displays the type of the Zone (fire alarm for this sample application).

Zone Application considerations

The Zone Cluster attributes are saved in Nvm whenever those are updated using zclport_writeNV API. The attributes stored in Nvm are zclSampleZone_ZoneState, zclSampleZone_CIE_Address, zclSampleZone_ZoneId. For further details on Nvm API see zcl_port.h Once the Zone device has the CIE IEEE address, the CIE address attribute can be changed only by the CIE device. The authentication of any write command to this attribute is done in the callback zclSampleZone_AuthenticateCIE. In the same way, once the CIE IEEE address is written, the binds to Zone cluster are protected from being changed by a device which is not the CIE. This is done using the API Zstackapi_ZdoSetBindUnbindAuthAddrReq. Once the enrollment is done, the application will also create a bind to CIE using Zstackapi_ZdoBindReq. This allows the Zone application send the Change Notification request commands using the bind table. NOTE: Since the binds are used to send the notifications to the enrolled CIE device, the developer is encouraged to be careful when using Finding and Binding commissioning process, as it may create unintended binds to other CIE devices.

User interaction to send an Enroll Request is known as Trip-To-Pair enrollment, while waiting 30 seconds for sending it automatically is known as Auto Enroll Request enrollment. Please refer to the Zigbee Cluster Library document for more details on these.