10
JN-AN-1135 (v1.1) 27-Apr-2010 © Jennic 2010 1 Application Note: JN-AN-1135 ZigBee PRO Smart Energy Demo This Application Note introduces the Jennic ZigBee PRO Smart Energy (SE) solution. The key topics covered are: ZigBee PRO Smart Energy profile ZigBee PRO Smart Energy clusters Jennic SE Demonstration overview The accompanying software uses the Simple Metering cluster to exchange data between a Metering Device and an In Premise Display (IPD). This application was developed using the Jennic ZigBee PRO, JenOS and Smart Energy APIs. 1 Application Overview This Application Note demonstrates how the Jennic ZigBee PRO Smart Energy (SE) solution can be used to transfer data between a utility meter and customer display device. The data is transferred using the Smart Energy profile clusters. The ZigBee PRO and JenOS APIs, used in this demonstration, are supplied as part of the Jennic JN5148 Software Developer’s Kit (SDK). The Smart Energy API is available is as an upgrade/overlay for this SDK. Both components are available free-of-charge from the Support section of the Jennic web site (www.jennic.com/support). 2 ZigBee PRO Smart Energy Overview The ZigBee Alliance has specified a Smart Energy profile. ZigBee Smart Energy offers utility companies secure, easy-to-use wireless Home Area Networks (HANs) for managing energy distribution and consumption. Smart Energy gives utility companies and their customers the ability to directly communicate with thermostats and other smart appliances. This profile defines clusters, which are groups of information with a similar function. These clusters consist of attributes and commands. Attributes store a single value, e.g. the power source of the device. The application can query and manipulate these attributes using the standard command set provided by the ZigBee Cluster Library (ZCL). Before commencing a Smart Energy development, you are recommended to familiarise yourself with the following documents: [R1] Jennic ZigBee PRO Stack User Guide [JN-UG-3048] [R2] Jennic ZigBee PRO APIs Reference Manual [JN-RM-2041] [R3] Jennic ZigBee PRO Smart Energy User Guide [JN-UG-3059] [R4] Jennic ZigBee PRO Smart Energy API Reference Manual [JN-RM-2046] [R5] ZigBee Smart Energy Profile Specification [R6] ZigBee Cluster Library Specification (ZCL)

JN an 1135 ZigBee Pro Smart Energy Demo 1v1

Embed Size (px)

Citation preview

Page 1: JN an 1135 ZigBee Pro Smart Energy Demo 1v1

JN-AN-1135 (v1.1) 27-Apr-2010 © Jennic 2010 1

Application Note: JN-AN-1135 ZigBee PRO Smart Energy Demo

This Application Note introduces the Jennic ZigBee PRO Smart Energy (SE) solution. The key topics covered are:

• ZigBee PRO Smart Energy profile • ZigBee PRO Smart Energy clusters • Jennic SE Demonstration overview

The accompanying software uses the Simple Metering cluster to exchange data between a Metering Device and an In Premise Display (IPD). This application was developed using the Jennic ZigBee PRO, JenOS and Smart Energy APIs.

1 Application Overview This Application Note demonstrates how the Jennic ZigBee PRO Smart Energy (SE) solution can be used to transfer data between a utility meter and customer display device. The data is transferred using the Smart Energy profile clusters.

The ZigBee PRO and JenOS APIs, used in this demonstration, are supplied as part of the Jennic JN5148 Software Developer’s Kit (SDK). The Smart Energy API is available is as an upgrade/overlay for this SDK. Both components are available free-of-charge from the Support section of the Jennic web site (www.jennic.com/support).

2 ZigBee PRO Smart Energy Overview The ZigBee Alliance has specified a Smart Energy profile. ZigBee Smart Energy offers utility companies secure, easy-to-use wireless Home Area Networks (HANs) for managing energy distribution and consumption. Smart Energy gives utility companies and their customers the ability to directly communicate with thermostats and other smart appliances. This profile defines clusters, which are groups of information with a similar function. These clusters consist of attributes and commands. Attributes store a single value, e.g. the power source of the device. The application can query and manipulate these attributes using the standard command set provided by the ZigBee Cluster Library (ZCL).

Before commencing a Smart Energy development, you are recommended to familiarise yourself with the following documents:

[R1] Jennic ZigBee PRO Stack User Guide [JN-UG-3048] [R2] Jennic ZigBee PRO APIs Reference Manual [JN-RM-2041] [R3] Jennic ZigBee PRO Smart Energy User Guide [JN-UG-3059] [R4] Jennic ZigBee PRO Smart Energy API Reference Manual [JN-RM-2046] [R5] ZigBee Smart Energy Profile Specification [R6] ZigBee Cluster Library Specification (ZCL)

Page 2: JN an 1135 ZigBee Pro Smart Energy Demo 1v1

ZigBee PRO Smart Energy Demo

2 © Jennic 2010 JN-AN-1135 (v1.1) 27-Apr-2010

Jennic The latest versions of [R1] to [R4] can be found in the Support area of the Jennic web site, while [R5] and [R6] can be found on the ZigBee Alliance web site (www.ZigBee.org).

3 ZigBee PRO Smart Energy Clusters The Jennic Smart Energy clusters provide both the client-side and server-side functionality. In the demonstration software, the IPD is the client and the Metering Device is the server of the following clusters:

• Key Establishment

• Simple Metering

• Time

• Price

• Message

Note: Key Establishment, Price, Time and Messaging clusters can be added or removed at compilation by defining the relevant macros in zcl_options.h.

3.1 Key Establishment ZigBee PRO SE devices are required to use application link keys for encrypted communbetween pairs of nodes. The SE profile provides a Key Establishment cluster (which is mandatory for all devices) to establish unique application link keys. After joining a network thIPD executes a service discovery to find the endpoint where the Key Establishment clust

ication

e er

resides. Once found, the IPD initiates key establishment with the network Trust Centre.

e ity,

t or water. The IPD periodically requests the consumption data from the Metering Device.

in

ly a customer private HAN). The IPD will request pricing information from the

Metering Device.

3.2 Simple Metering Cluster The Simple Metering cluster is defined in the ZigBee Smart Energy profile and is used to handlinformation relating to the measured consumption of some resource, which may be electricgas, hea

3.3 Price Cluster The Price cluster provides the mechanism for sending and receiving pricing information withan SE network. The pricing information is sent by the utility company to the Energy Service Portal (ESP), which passes the information to SE devices in the utility private HAN (and possibto other devices in

Page 3: JN an 1135 ZigBee Pro Smart Energy Demo 1v1

ZigBee PRO Smart Energy Demo

JN-AN-1135 (v1.1) 27-Apr-2010 © Jennic 2010 3

Jennic3.4 Messaging Cluster The Messaging cluster provides an interface for passing text messages between ZigBee SE devices. These are likely to be messages from the utility company received by the ESP, which unicasts a received message to all registered SE devices that implement the Messaging cluster (or makes the message available to all devices for later collection). Only one message can be handled at a time and the current message is replaced when the next message arrives. The IPD can request message updates from the Metering Device.

3.5 Time Cluster The Time cluster provides an interface to the real-time clock on a device, allowing the clock time to be read and written in order to synchronise the clock to a time standard - the number of seconds since midnight on 1st January 2000, UTC (Universal Coordinated Time). This cluster includes functionality for local time-zone and daylight saving time. The IPD synchronises its time with the Metering Device using this cluster.

4 Jennic Smart Energy Demonstration This section describes different aspects of the Jennic SE demonstration.

4.1 Network Architecture The network consists of two ZigBee PRO nodes - a Co-ordinator and an End Device. The Metering Device is the Co-ordinator - when started, it will form a ZigBee PRO network. The IPD is an End Device - when started, it will execute a scan to find a compatible ZigBee PRO network to join.

4.2 Smart Energy Network Architecture The Metering Device will also be the ESP. This enables the Metering Device to be the Co-ordinator and to form the ZigBee network.

S

ESP with integrated Metering Device

C

In Premise Display

S C = Client = Server

Page 4: JN an 1135 ZigBee Pro Smart Energy Demo 1v1

ZigBee PRO Smart Energy Demo

4 © Jennic 2010 JN-AN-1135 (v1.1) 27-Apr-2010

Jennic

y pressing the Reset button on both

4.3 Shared Structures In each SE device, attribute values are exchanged between the application and the SE library by means of a shared structure. This structure is protected by a mutex. The structure for a particular SE device contains structures for the clusters supported by that device. The available device structures are detailed in the ZigBee PRO Smart Energy API Reference Manual (JN-RM-2046).

4.4 Test Certificates The SE demonstration uses test certificates from the ZigBee SE Profile Specification. These certificates are paired with MAC addresses 0x01 (IPD) and 0x02 (Metering Device). Therefore, the sensor board and controller board must be programmed with these addresses to enable the nodes to complete key establishment.

4.5 Metering Device Software The Metering Device software is designed to run on a Jennic JN5148-EK010 Evaluation Kit sensor board.

The Metering Device forms a network on the radio channel and with the Extended PAN ID that were configured in the JenOS Configuration Editor. When the IPD joins the network, the Metering Device software will respond to the IPD’s key establishment requests and will authenticate this device. Once authentication is complete, the Metering Device will allow the IPD to read the cluster attributes of the registered shared structures. The values in these structures are initialised and modified by the Metering Device application.

4.6 IPD Software The IPD software is designed to run on the Jennic JN5148-EK010 Evaluation Kit controller board.

The IPD node joins the network and then implements a service discovery for the Key Establishment cluster. After a successful discovery, the IPD initiates key establishment to authenticate with the Metering Device. Once authentication is complete, the IPD will synchronise its time with the Metering Device, then periodically (every 10 seconds) query the Simple Metering cluster. The IPD can also query the attributes of the Price and Messaging clusters by navigating to the relevant screens.

4.7 Network Context Saving Both the IPD and ESP are protected from power failure by means of context saving. The required network parameters are automatically preserved in Flash memory by the ZigBee stack. On restart, the Metering Device node does not attempt to form a new network and the IPD node does not attempt to join a new network. The radio channel, Extended PAN ID and security keys are restored from Flash memory, so the power failure is transparent to the user.

Note: Power failures can be simulated bthe controller board and sensor board.

Page 5: JN an 1135 ZigBee Pro Smart Energy Demo 1v1

ZigBee PRO Smart Energy Demo

JN-AN-1135 (v1.1) 27-Apr-2010 © Jennic 2010 5

Jennic

5 Operating Instructions 1. Program a Jennic controller board with the binary file IPD_NODE.bin (the IPD will be a

ZigBee End Device) and with MAC address 0x01.

2. Program a Jennic sensor board with the binary file METER_NODE.bin (the Metering Device will be the ZigBee Co-ordinator) and with MAC address 0x02.

3. Reset the IPD - LED D1 will now flash every second and the LCD panel will display the Jennic logo and “ZigBee Pro SE IPD”.

4. Reset the Metering Device - LED D1 will now flash every second.

5. Press SW1 on the Metering Device - this will enable the Co-ordinator to accept children for 5 seconds (LED D1 will stop flashing).

6. Within the 5-second period, press SW1 on the IPD - the IPD will attempt to join the network and the LCD panel will display “Joining Network” (LED D1 will stop flashing).

• If the IPD joins the network within the 5-second period, the LCD panel will display “Joined Network”.

• If the IPD does not find a network, the LCD panel will display “Network Join Failed”. In this case, repeat Steps 5 and 6 until the IPD joins the network.

7. On the IPD, when the LCD panel is displaying “Joined Network “, press SW1 to prompt the IPD to start requesting SE data from the Metering Device.

The LCD panel will now display the Main screen. The IPD will query the Metering Device using the SE ‘Read Attributes’ command every 10 seconds, and the summation value will increment on the LCD panel. A further three screens can be accessed using the buttons below the LCD panel (Tiers, Time, Price).

Main Screen

ZigBee Pro

Smart Energy IPD

Demand: 00000000 Kw

Summation: 00000063 Kw

12:00:07

Tiers Time Price

Sw1 Sw2 Sw3 Sw4

Pressing Sw1 or Sw3 will navigate to the Tier or Price screen, respectively, while pressing Sw2 will resynchronise the time with the Metering Device.

Page 6: JN an 1135 ZigBee Pro Smart Energy Demo 1v1

ZigBee PRO Smart Energy Demo Jennic

6 © Jennic 2010 JN-AN-1135 (v1.1) 27-Apr-2010

Tier Screen

ZigBee Pro

Smart Energy IPD

Tier 1: 00000063 Kw

Tier 2: 00000000 Kw

Tier 3: 00000000 Kw

Back

Sw1 Sw2 Sw3 Sw4

The Tier screen displays the summation that has been delivered on each pricing tier. The total summation (from the Main screen) and Tier 1 summation are identical, as the Demo increments both simultaneously. Pressing Sw2 will return you to the Main screen.

Price Screen

ZigBee Pro SE IPD

Price Start Duration

0013 12:02 0010

0023 12:20 0020

Prices Back Message

Sw1 Sw2 Sw3 Sw4

The Price screen displays the current price and the next upcoming price. The ‘Price’ column shows the price per consumed unit (the formatting of this can be configured, as well as the currency, decimal point, etc – refer to the ZigBee PRO Smart Energy API Reference Manual (JN-RM-2046)). The ‘Start’ column shows the start-time for the price and the ‘Duration’ column shows duration of the price, in minutes.

Pressing Sw1 will refresh the prices, Sw2 will return you to the Main screen and Sw3 will take you to the Message screen.

Page 7: JN an 1135 ZigBee Pro Smart Energy Demo 1v1

ZigBee PRO Smart Energy Demo

JN-AN-1135 (v1.1) 27-Apr-2010 © Jennic 2010 7

Jennic

Message Screen

ZigBee Pro

Smart Energy IPD

SE Messages

Test Message

Msg back

Sw1 Sw2 Sw3 Sw4

The Message screen displays the last received message from the Metering Device. Pressing the Msg button (Sw1) will query the Metering Device for the latest message.

Page 8: JN an 1135 ZigBee Pro Smart Energy Demo 1v1

ZigBee PRO Smart Energy Demo Jennic

8 © Jennic 2010 JN-AN-1135 (v1.1) 27-Apr-2010

6 Compatibility The software provided with this Application Note has been tested with the following Jennic kits and SDK (Software Developer’s Kit) versions:

Product Types Part Numbers Version Supported Networking Protocols Evaluation Kit JN5148-EK010 1.0 ZigBee PRO JN5148 SDK Libraries JN-SW-4040 1.3 ZigBee PRO JN5148 SDK Toolchain JN-SW-4041 1.1 ZigBee PRO

7 Building and Downloading the Application In order to build the software provided with this Application Note, the application’s folder must be placed directly under <JENNIC_SDK_ROOT>\Application\, where <JENNIC_SDK_ROOT> is the path into which the JN5148 SDK was installed (by default, this is C:\Jennic). The Application directory is automatically created when you install the SDK. You can obtain the latest versions of the JN5148 SDK libraries and toolchain from the Support area of the Jennic web site (http://www.jennic.com/support). The relevant part codes are JN-SW-4040 for the libraries and JN-SW-4041 for the toolchain.

Note: This application uses the ZigBee PRO wireless network protocol, which is only supported on the JN5148 wireless microcontroller. Eclipse project files for the JN5148 device are provided.

To build the application and load it into the JN5148

Ensure that the project directory is located in <JENNIC_SDK_ROOT>\Application

boards, follow the instructions below:

1.

2. Eclipse platform and import the relevant project files (.project and .cproject) as

ace.

Application directory.

d) In the Projects box, select the project to be imported.

3.

where <JENNIC_SDK_ROOT> is the path into which the SDK was installed.

Start thefollows:

a) In Eclipse, follow the menu path File>Import to display the Import dialogue box.

b) In the dialogue box, expand General and select Existing Projects into Workspc) Enable Select root directory and browse to the Jennic

Build the project. To do this, use the drop-down list associated with the hammer icon in the Eclipse toolbar to lect the relevant build co se nfiguration – once selected, the project will

4. tion

Programmer (described in the JN51xx Flash Programmer User Guide (JN-UG-3007)).

automatically build.

The binary files will be created in the relevant build configuration directory.

Load the resulting binary files into the boards from the appropriate build configuradirectory. You can do this directly from Eclipse or using the Jennic JN51xx Flash

Page 9: JN an 1135 ZigBee Pro Smart Energy Demo 1v1

ZigBee PRO Smart Energy Demo

JN-AN-1135 (v1.1) 27-Apr-2010 © Jennic 2010 9

Jennic

Revision History Version Notes

1.0 First release 1.1 Updated to include Price, Time, Key Establishment and Messaging

Page 10: JN an 1135 ZigBee Pro Smart Energy Demo 1v1

ZigBee PRO Smart Energy Demo Jennic

10 © Jennic 2010 JN-AN-1135 (v1.1) 27-Apr-2010

Important Notice Jennic reserves the right to make corrections, modifications, enhancements, improvements and other changes to its products and services at any time, and to discontinue any product or service without notice. Customers should obtain the latest relevant information before placing orders, and should verify that such information is current and complete. All products are sold subject to Jennic’s terms and conditions of sale, supplied at the time of order acknowledgment. Information relating to device applications, and the like, is intended as suggestion only and may be superseded by updates. It is the customer’s responsibility to ensure that their application meets their own specifications. Jennic makes no representation and gives no warranty relating to advice, support or customer product design.

Jennic assumes no responsibility or liability for the use of any of its products, conveys no license or title under any patent, copyright or mask work rights to these products, and makes no representations or warranties that these products are free from patent, copyright or mask work infringement, unless otherwise specified.

Jennic products are not intended for use in life support systems/appliances or any systems where product malfunction can reasonably be expected to result in personal injury, death, severe property damage or environmental damage. Jennic customers using or selling Jennic products for use in such applications do so at their own risk and agree to fully indemnify Jennic for any damages resulting from such use.

All trademarks are the property of their respective owners.

Jennic Ltd Furnival Street

Sheffield S1 4QT

United Kingdom

Tel: +44 (0)114 281 2655 Fax: +44 (0)114 281 2951 E-mail: [email protected]

For the contact details of your local Jennic office or distributor, refer to the Jennic web site: