Green Power Application Overview

Green Power Device

A Green Power Device (GPD) a special type of Zigbee device that is designed for an application where the end product has a very strict energy budget, such as an energy-harvesting device. GPDs follow their own special Zigbee device type specification that differs from the standard Zigbee device type specifications. A GPD must be commissioned to a Green Power Proxy or a Green Power Sink to relay Green Power Data Frames as ZCL Green Power Notifications to communicate on a Zigbee network. Processing of Green Power Notifications is an application dependent procedure and is not covered in this document.

General Application Architecture

This section describes how a Green Power Device application task is structured in more detail.

Configuration

gpd_config.h provides configuration definitions for parameters like device ID, security level and security keys. To change the Green Power Device behavior is necesary to modify the predefined symbols in the project properties.

../../_images/gpd-defines.png
Green Power Device definitions
Name Description Values
DEVICE_ID (uint8) Green Power Device ID 0x00 - 0xFF, refer to GPD spec
GPD_APP_ID Unique identifier of the GPD, either the 4-byte SrcID or the IEEE Addr
0b00 GPD_APP_TYPE_SRC_ID
0b10 GPD_APP_TYPE_IEEE_ID
GPDF_FRAME_DUPLICATES (uint8) Application-specific. Number of GPDF retries per packet. 0x00 - 0xFF (recommended to be low, more retries = more power consumption)
GPD_CHANNEL IEEE channel, 11 - 26 (in Hex) 0x0B - 0x1A
GP_SECURITY_LEVEL Defines the security level which GPDF packets are encrypted and sent with
0b00 GP_SECURITY_LVL_NO_SEC
0b01 Reserved
0b10 GP_SECURITY_LVL_4FC_4MIC
0b11 GP_SECURITY_LVL_4FC_4MIC_ENCRYPT
AUTO_COMMISSIONING Defines whether or not the device will automatically start commissioning on power-up TRUE/FALSE
RX_AFTER_TX RxOnCapability commissioning option. Defines whether or not GPD will turn RX on after TXing a frame, i.e. whether or not GPD is expecting a response TRUE/FALSE
SEQUENCE_NUMBER_CAP Sequence Number Capability commissioning option. Defines if GPD will use Seq Num TRUE/FALSE

Non Volatile Memory

gpd_memory.c provides an interface for Non Volatile Memory required for attribute persistence in some GPD configurations. For example the persistence of Sequence Number when Sequence Number Capability is Required. Use gp_nv_item_init() to create a new NV item, then gp_nv_read() to get the NV value and gp_nv_write() to update the NV value when necesary.

Callbacks

The application code also likely includes various callbacks from the protocol stack layer and RTOS modules. To ensure thread safety, processing should be minimized in the actual callback, and the bulk of the processing should be done in the application context.

static uint16 gpdSampleSw_process_loop( void )
{
    /* Forever loop */
    for(;;)
    {
        if(events & SAMPLEAPP_KEY_EVT)
        {
            // Process Key Presses
            gpdSampleSw_processKey(keys);
            keys = 0;
            events &= ~SAMPLEAPP_KEY_EVT;
        }

        ApiMac_processIncoming();
    }
}

Send Green Power Data Frames

An API to send Green Power Data Frames (GPDF) is provided in gpd.c. The generic function GreenPowerDataFrameSend() sends a frame formated for the Green Power Device configuration automatically by providing a gpdfReq_t struct, the desired channel and a flag to enable frame security.

Additionally GreenPowerCommissioningSend() and GreenPowerAttributeReportingSend() functions use GreenPowerDataFrameSend() to generate the corresponding commands.

Setting Up the Network with GPD and GPS

To set up a network with a Green Power Device (GPD) and a Green Power Sink (GPS), you will need 3 devices:

  1. Green Power Device (gpd_switch or gpd_temperaturesensor)
  2. Green Power Sink (zc/zr_light_sink or zc/zr_thermostat_sink)
  3. Green Power Proxy (any other Zigbee 3.0 routing device, e.g. zc/zr_genericapp)

Select network channel

First, determine which channel you would like to use for your test. To change the channel mask of the Green Power Sink and Green Power Proxy, modify DEFAULT_CHANLIST in f8wconfig.h. To change the channel of the Green Power Device, change GPD_CHANNEL in the predefined symbols.

Create and open the network

Next, create a network with your coordinator. For example, use zc_light_sink to create a network, following the instructions in the Commissioning the Device Into the Network section of this readme:

Join the GPP Device

Next, join the Green Power Proxy (GPP). For example, we can use zr_genericapp as a GPP by simply joining it into the network, following the instructions Example Usage section of this readme:

Enable commissioning on the GPS

Next, enable GPS Commissioning on the zc_light_sink by following the instructions in the Interfacing with the GP On/Off Switch Example App section of this readme:

Commission the GPD into the network

Lastly, commission a GPD like the gpd_switch into the network by following the instructions in the Interfacing with the Light Sink Example App section of this readme:

Example Ubiqua Capture of Green Power Traffic

Here is an annotated Ubiqua capture of the expected behavior following the instructions above:

../../_images/green-power-network-example.png