Green Power Temperature Sensor
- Introduction
- Hardware Prerequisites
- Software Prerequisites
- Functional Description
- Configuration With SysConfig
- Example Usage
Introduction
This document discusses how to use the Green Power Temperature Sensor Sample App and the different parts that compose it. Green Power Temperature Sensor Sample Application is an example which exercises different features of TI Z-Stack for a green power device implementation.
Some of the features exercised include:
- Green Power application ID configuration for source ID or IEEE.
- Security level configuration.
- Auto commissioning.
- Sequence number capabilities.
- Temperature Sensor device that sends "Commissioning data frame" and "Attribute Reporting data frame".
- Report attributes functionality and configuration.
Hardware Prerequisites
- The Launchpad which is used by this particular project.
Software Prerequisites
Code Composer Studio™ (CCS) v9.1 or newer
Functional Description
Software Overview
This section describes the software components and the corresponding source files.
Application Files
- gpd_temperaturesensor.c/.h: Contains the application's event loop, device initialization function calls (for timers, peripherals, Nvm, LEDs, Switches), Application notifications and all Temperature Sensor specific logic.
- gpd_temperaturesensor_data.c: Contains the Green Power Data Frame definitions for this sample application.
- main.c: Defines the application task and the application stack size.
- gpd_config.h This file contains the configuration parameters for a Green Power Device.
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
This application uses a timer to keep track of how long a button has been pressed. If a button is pressed for less than a second, it is considered a short press, while more than a second is considered a long press. This is configurable by defining CUI_LONG_PRESS_DUR_MS in your project.
Short press:
- BTN-1
: Increase temperature to be reported.
- BTN-2
: Decrease temperature to be reported.
Long press:
- BTN-1
: Sends Attribute Reporting GPDF and trigger a timer to constantly send Attribute Reporting GPDF every 10 seconds (GPD_REPORT_TEMP_DELAY).
- BTN-2
: Sends Commissioning GPDF
LEDs
DIO6
: Red LED blinks if a frame(s) got transmitted but not all of them. If none of the frames were able to be transmitted then a solid On is set.DIO7
: If all duplicate frames are sent (GPDF_FRAME_DUPLICATES), then Green LED becomes solid On.
Commissioning the device Into the network
Green Power Devices can be commissioned to a Zigbee network by sending a commissioning GPDF, a GPDF with auto-commissioning or a commissioning tool. A Zigbee device with green power proxy capabilities can create an entry for a Green Power Device with the commissioning data. The proxy device will translate the GPDF commands to ZCL notifcations for the Zigbee network.
Interfacing with the Light Sink 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. Executing this screen will change the GPS Commissioning status from 'DISABLED' to 'ENABLED'
Send the Commissioning GPDF from the Green Power Device Temperature Sensor. Then from the Green Power Sink Commissioning Screen disable the GP commissioning mode.
Once the GP commissioning mode is disabled, sending the Attribute Reporting GPDF with the Green Power Device Temperature Sensor will update the remote temperature value in the application status line.
NOTE: If the temperature is not updated just repeat the commissioning process and try again.