Zigbee End Device Door Lock Example App

Introduction

This document discusses how to use the Zigbee Door Lock Example App and the different parts that compose it. Zigbee Door Lock 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 software components and the corresponding source file.

Application Files

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. This common menu has to be used to commission the device into a network.

Commissioning the Device Into the Network

Zigbee end devices can only join networks, this is done using the Steering Mode and executing the commissioning process in the Commissioning Screen. Zigbee end devices must also have a router parent device (this can be either Zigbee Coordinator or Zigbee Router), which is the device that allows it to join. End Devices cannot transmit/receive frames unless these goes through its parent. If an end device lost its parent, then it cannot be active in the network until it find another suitable parent. This sample application uses stack notifications (zstackmsg_CmdIDs_BDB_NOTIFICATION) to automatically find a new suitable parent if it is lost (unresponsive due to any reason).

Interfacing with the Door Lock Controller Example App

Once the Door Lock and Door Lock Controller device are in the same network, enable the Finding and Binding Mode and excecute it from the Commissioning Screen on both devices. Both devices will be set in Identify mode for 180 seconds and will search for each other to create a bind (Door Lock will create a bind to Door Lock Controller and the otherway around as well).

FindingBinding
Finding and binding status screen

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 Door Lock Controller device has the bind, it will be able to lock or unlock the door in the Door Lock screen. When the Door Lock creates the bind to the Door Lock Controller it will be able to report the state of the door automatically through reporting mechanism.

Both devices will set IdXXX and SrcYYY to 180 seconds and will count down as ZZ will count the binds to the other devices found. Multiple devices can perform this procedure at the same time, by default one device can have up to 4 binds (one Door Lock can report up to 4 Door Lock Controllers or one Door Lock Controller can control 4 Door Locks), this is defined by NWK_MAX_BINDING_ENTRIES. There is no limit on the number of Door Lock Controllers that can control a single Door Lock.

Finding and Binding for Door Lock cluster is meant to be use to create the bind in Door Lock only, but this sample application has been modify to create the bind in the Door Lock Controller to allow sending the controller commands easily.

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

AppMenu
Application menu entrance screen

In the Change PIN screen the PIN can be changed, both devices Door Lock and Door Lock Controller must have the same PIN in order to lock or unlock the door.

Change PIN
Change PIN screen

The status of the door is display in the Door Lock status screen in which it can also be changed. The Door Lock Controller can keep track of the status of the Door Lock due to the reports the Door Lock sends whenever the status of the door changes.

Change PIN
Control door screen