Zigbee_DoorLock_Client_Router Application Description

How to use the DoorLock cluster on a device acting as a Client within a Centralized Zigbee network.

The purpose of this application is to show how to create a Zigbee centralized network, and how to communicate from one node to another one using the DoorLock cluster. Once the Zigbee mesh network is created, the user can send requests from the Client to Server (through push buttons SW1, SW2 and SW3), and Server to Client (push buttons SW1).

Keywords

Connectivity, Zigbee, Zigbee protocol, 802.15.4 protocol, DoorLock cluster

Demo use case

This demo shows how to use DoorLock cluster.

Note: When the DoorLock Server is in passage mode, the PIN code is not checked and the lock remains open after an unlock.

Hardware Requirements

For this application it is requested to have:

    

                Router                                                                      Coord.
              +----------+                                                                +----------+
              |          |                                                                |          |
              | DoorLock |                                                                | DoorLock |
              | Client   |                                                                | Server   |  - DoorLock Server during Init 
              |          |                                                                |          |    <= ZbZclAttrIntegerWrite(ZCL_DOORLOCK_ATTR_LOCKSTATE)
              |          |                                                                |          |    <= ZbZclAttrIntegerWrite(ZCL_DOORLOCK_ATTR_DOORSTATE)
              |          |                                                                |          |   <= ZbZclAttrIntegerWrite(ZCL_DOORLOCK_ATTR_SUPPORTED_MODES)
              |          |                                                                |          |    <= ZbZclAttrIntegerWrite(ZCL_DOORLOCK_ATTR_MODE)
              |          |                                                                |          |    <= ZbZclAttrIntegerWrite(ZCL_DOORLOCK_ATTR_AUTO_RELOCK)
              |          |                                                                |          |           
              |          |                                                                |         || => GREEN LED ON
              |          |                                                                |  Door   ||
              |          |                                                                |  Lock   ||
              |          |    /* Door Lock client/server normal mode interaction */       |         ||           
              |          |                                                                |         ||
              |          |            ZbZclDoorLockClientUnlockReq(PIN)                   |         ||
  PushB SW1=> |          | -------------------------------------------------------------> |         || => GREEN LED OFF
              |          | <------------------------------------------------------------- |          |
              |          |                                                                |  Door    |
              |          |                                                                |  UnLock  |
              |          |                                                                |          |  /* When Auto Relock Time is reached */
              |          |                                                                |          | <= ZbZclAttrIntegerWrite(ZCL_DOORLOCK_ATTR_LOCKSTATE)
              |          |                                                                |         || => GREEN LED ON
              |          |                                                                |  Door   ||
              |          |                                                                |  Lock   ||
              |          |            ZbZclDoorLockClientUnlockReq(PIN)                   |         ||
  PushB SW1=> |          | -------------------------------------------------------------> |         || => GREEN LED OFF
              |          | <------------------------------------------------------------- |          |
              |          |                                                                |  Door    |
              |          |                                                                |  UnLock  |
              |          |                                                                |          |
              |          |            ZbZclDoorLockClientLockReq(PIN)                     |          |
  PushB SW2=> |          | -------------------------------------------------------------> |         || => GREEN LED ON
              |          | <------------------------------------------------------------- |  Door   ||
              |          |                                                                |  Lock   ||
              |          |                                                                |         ||
              |          |            ZbZclDoorLockClientUnlockReq(WRONG_PIN)             |         ||
  PushB SW3=> |          | -------------------------------------------------------------> |         || => GREEN LED remains ON
              |          | <------------------------------------------------------------- |         ||
              |          |                                                                |         ||
              |          |                                                                |         ||
              |          |                                                                |         ||           
              |          |    /* Door Lock client/server passage interaction */           |         ||
              |          |                                                                |         ||
              |          |            ZbZclDoorLockClientUnlockReq(PIN)                   |         ||
  PushB SW1=> |          | -------------------------------------------------------------> |         || => GREEN LED OFF
              |          | <------------------------------------------------------------- |          |
              |          |                                                                |  Door    |
              |          |                                                                |  UnLock  |           
              |          |                                                                |          |           
              |          |            ZbZclDoorLockClientLockReq(PIN)                     |          |
  PushB SW2=> |          | -------------------------------------------------------------> |         || => GREEN LED ON
              |          | <------------------------------------------------------------- |         ||
              |          |                                                                |  Door   ||
              |          |                                                                |  Lock   ||
              |          |                                                                |         ||           
              |          |            ZbZclDoorLockClientUnlockReq(WRONG_PIN)             |         ||
  PushB SW3=> |          | -------------------------------------------------------------> |         ||
              |          | <------------------------------------------------------------- |         ||
              |          |                                                                |         ||
              |          |                                                                |         ||
              |          |    /* Forced Door Open under Door Locked Condition alarm */    |         ||  
              |          |                                                                |         || <= PushB SW1 : 
              |          |                                                                |         || <= ZbZclAttrIntegerWrite(ZCL_DOORLOCK_ATTR_DOORSTATE)
              |          |                                                                |         ||
              |          |                       ZbZclClusterSendAlarm                    |         ||
Red LED ON <= |          | <------------------------------------------------------------- |         ||
              |          |                                                                |         ||
              |          |                                                                |         ||
              |          |                                                                |         || <= PushB SW2 : Passage Mode during 10 sec.
              |          |                                                                |         ||
              |          |            ZbZclDoorLockClientUnlockReq(WRONG_PIN)             |         ||
  PushB SW3=> |          | -------------------------------------------------------------> |         || => GREEN LED OFF 
              |          | <------------------------------------------------------------- |          | (It is possible to unlock the door, even if the
              |          |                                                                |  Door    |  pin is wrong because of the 'passage' mode)
              |          |                                                                |  UnLock  |
              |          |                                                                |          |
              |          |                                                                |          | => Expiration of Passage mode after 10 sec.
              |          |                                                                |          | 
              |          |                                                                |          | 
              |          |            ZbZclDoorLockClientLockReq(PIN)                     |          |
  PushB SW2=> |          | -------------------------------------------------------------> |         || => GREEN LED ON 
              |          | <------------------------------------------------------------- |  Door   ||
              |          |                                                                |  Lock   ||
              |          |            ZbZclDoorLockClientUnlockReq(WRONG_PIN)             |         ||
  PushB SW3=> |          | -------------------------------------------------------------> |         || => GREEN LED remains ON
              |          | <------------------------------------------------------------- |         ||
              |          |                                                                |         || 
              +----------+                                                                +----------+
  
  

Application Setup

Note: When LED Red, Green and Blue are toggling it is indicating an error has occurred on application.

Hardware and Software environment

Traces

Note

By default, this application runs with Zigbee PRO stack R23.
If you want to run this application using Zigbee PRO stack R22, you should replace ZigBeeProR23_FFD.a by ZigBeeProR22_FFD.a and ZigBeeProR23_RFD.a by ZigBeeProR22_RFD.a and ZigBeeClusters.a by ZigBeeClustersR22.a in the build environment.
Also, set in the project setup compilation flag CONFIG_ZB_REV=22.