Zigbee Coordinator Thermostat Sink Example App
Introduction
This document discusses how to use the Zigbee Thermostat Example App and the different parts that compose it. Zigbee Thermostat Application is an example which exercises different features of TI Z-Stack. This example has the same behavior as the Zigbee Thermostat but with addition of Green Power (GP) Sink functionality to process GP Temperature Sensor commands.
Some of the features exercised include:
- Base Device Behavior attribute configuration.
- Green Power Sink functionality enabled for a temperature sensor application.
- Thermostat device that acts as Target of Finding and Binding.
- Receive and process Attribute reports.
Hardware Prerequisites
Software Prerequisites
Code Composer Studio™ (CCS) v7.3 or newer
Functional Description
Software Overview
This section describes software components and the corresponding source file.
Application Files
- zcl_samplethermostat_sink.c/.h: Contains the application’s event loop, device initialization function calls (for timers, peripherals, Nvm, LEDs, Switches, Serial interface), Zigbee stack notifications and all thermostat specific logic.
- zcl_samplethermostat_sink_data.c/.h: Contains the endpoint, cluster and attribute definitions for this sample application.
- main.c Defines the application task, the application stack size.
- bdb_interface.h Defines commissioning parameters to be used and configured in the application upon calling commissioning methods (see zclSampleThermostat_initParameters()).
Example Usage
This section describes how to use this sample application.
Buttons
BTN-1
: Starts the commissioning process.
LEDs
DIO6
: Reflects the Heating unit. It is on when reported temperature is lower than the heating set point (zclSampleThermostat_OccupiedHeatingSetpoint). Off otherwise.DIO7
: Reflects the Cooling unit. It is on when the reported temperature is higher tha the cooling set point (zclSampleThermostat_OccupiedCoolingSetpoint) and the Heating unit is not On. Off otherwise.
Serial interface
- Open a serial session (e.g.
PuTTY
, etc.) to the appropriate COM port.- The COM port can be determined via Device Manager in Windows or via
ls /dev/tty*
in Linux.
- The COM port can be determined via Device Manager in Windows or via
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 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 applications uses the stack notifications (zstackmsg_CmdIDs_BDB_NOTIFICATION) on a successful network formation process to open the network and allow new devices join, even if the Steering Mode is not enabled from the common user interface. If the network is closed, it can be open again by enabling the Steering Mode and execute the commmissioning process in the Commissioning Screen.
Interfacing with the GP Temperature Sensor Example App
Once the Thermostat Sink and another routing device are in the same network, put the Thermostat Sink in GP Commissioning Mode from the App Menu in the Green Power Sink Commissioning Screen.
Green Power Commissioning screen
Send the Commissioning GPDF from the GP Temperature Sensor. Then from the Green Power Sink Commissioning Screen disable the GP commissioning mode.
Green Power Commissioning screen
Once the GP commissioning mode is disabled, sending the Attribute Reporting GPDF with the GP Temperature Sendor will update the remote temperature value.
NOTE: If the temperature is not updated just repeat the commissioning process and try again.
Interfacing with the Temperature Sensor Example App
Once the Temperature Sensor and Thermostat are in the same network, enable the Finding and Binding Mode and excecute it from the Commissioning Screen. When Finding and Binding is executed, the Thermostat device is set in Identify mode for 180 seconds, during this time Temperature Sensor device must perform Finding and Binding as well to find the Thermostat device in Identify mode and create a bind to it. The status of the Identify process is shown in Commissioning Screen.
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 Temperature Sensor device has the bind to the Thermostat, it will periodically send Reporting Attribute commands accordigly to the reporting configuration set by Zstackapi_bdbRepAddAttrCfgRecordDefaultToListReq(). The Thermostat will process those reporting attributes by updating zclSampleThermostat_LocalTemperature which will also be displayed in the application screen
Remote temperature received screen in Thermostat device
The temperature reported will also control the state of the heat and cooling system of the Thermostat device as described in LEDs section. The heat and cooling set point can be set in the Application menu of the user interface:
Heating setpoint screen in Thermostat device
Cooling setpoint screen in Thermostat device
The Temperature Sensor can adjust the temperature in the Application menu of the user interface:
Local temperature set screen in Temperature sensor device