Skip to content

ZigBee Integration

Alvaro Fides edited this page Jun 26, 2015 · 7 revisions

Table of Contents

Description

ZigBee is a specification for a suite of high level communication protocols used to create wireless personal area networks (WPANs) operating at 868 MHz, 902-928 MHz, and 2.4 GHz, built from small, low-power digital radios. ZigBee is based on the 802.15 specification approved by the Institute of Electrical and Electronics Engineers Standards Association (IEEE-SA). ZigBee is used in applications that require a low data rate, long battery life, and secure networking. Applications well suited to ZigBee include healthcare sensing and management, heating, ventilation, and air conditioning (HVAC), lighting systems, intrusion detection, fire sensing, and the detection and notification of unusual occurrences. It is best suited for periodic or intermittent data or a single signal transmission from a sensor or input device. The technology defined by the ZigBee specification is intended to be simpler and less expensive than other WPANs, such as Bluetooth or Wi-Fi. This bundle suite integrates ZigBee components in universAAL through ZB4Osgi, implementation of a set of OSGi bundles which allows the interaction with a ZigBee network at varius level.

The core components (Access and Abstraction layers) are provided by the ZB4OSGi project. The integration of the ZigBee protocol with the OSGi platform is of general interest for many application domains and its development will be separated from the specific artifacts adapted for the universAAL projects. The LDDI repository ZB projects are linked with the ZB4OSGi repository so that development, building and testing of ZB4OSGi components can be easily shared with universAAL.

Features

  • ZigBee Commissioning: Simulated Device to bind on cluster and configure reporting
  • ZigBee Exporter: Implements universAAL wrappers for ZB Home Automation devices
    • Sends context events for incoming sensor events to the universAAL context bus.
    • Provides services on the universAAL service bus for querying devices.

Artifacts

The following Maven artifacts, bundles and libraries from the LDDI repository are all related to the ZigBee Integration module.

Installation

ZigBee 4 OSGi requires a PC with a compatible ZigBee dongle plugged. The "Officially Supported" ones are:

The following ZigBee devices (sensors and actuators) should be compatible:
  • Any device compliant with the CC2480 Interface Specification
  • Any device compliant with the CC2530 Interface Specification
  • For the case of CC2531 and EZ430-RF2480 it is necessary also to install the right driver in order to install the USB dongle as virtual COM driver. Please refer to the Texas Instruments web site.
Also take into account that the computer where the ZB Inteegration will be run has to support Java RXTX (usually Windows, Linux and Mac).

In OSGi you will have to install the following bundles (you can find the ZB4O ones at the AALOA repository):

  • ...Middleware bundles...
  • org.universAAL.ontology/ont.phWorld/x.y.z
  • org.universAAL.ontology/ont.device/x.y.z
  • org.universAAL.ontology/ont.activityhub/x.y.z
  • net.sf.trove4j/trove4j/2.1.0 (Not a bundle, use wrap: prefix)
  • org.aaloa.zb4osgi/org.aaloa.zb4osgi.zigbee.common/0.5.0
  • org.aaloa.zb4osgi/org.aaloa.zb4osgi.zigbee.basedriver.api/a.b.c
  • org.aaloa.zb4osgi/org.aaloa.zb4osgi.zigbee.basedriver/a.b.c
  • org.aaloa.zb4osgi/org.aaloa.zb4osgi.zigbee.ha.driver/a.b.c
  • org.aaloa.zb4osgi/org.aaloa.zb4osgi.zigbee.zcl.library/a.b.c
  • org.aaloa.zb4osgi/org.aaloa.zb4osgi.zigbee.cc2480.datalink/a.b.c
  • org.aaloa.zb4osgi/org.aaloa.zb4osgi.zigbee.dongle.api/a.b.c
  • org.aaloa.zb4osgi.bundle/org.aaloa.zb4osgi.bundle.rxtx/2.1.7-3
  • org.aaloa.zb4osgi/org.aaloa.zb4osgi.zigbee.CC2530.driver/0.2.0 (Do not start until everything is set up)
  • org.universAAL.lddi/lddi.zigbee.exporter/x.y.z
  • org.universAAL.lddi/lddi.zigbee.commissioning.adapter/x.y.z
Notice that the version of universAAL components (represented with x.y.z) will be different than that of the ZB4O components (represented with a.b.c). In both cases, you can use the latest version (Latest versions of ZB4O bundles may vary from one another). For convenience with version handling, we recommend installing all the above by simply installing the ZB Karaf feature (uAAL-LDDI-ZigBee) from the LDDI repository.

Configuration

ZigBee Driver

You must apply some configuration to ZB4O. You can find an exhaustive description on the wiki about the meaning of the parameters. In order to configure these parameters you can edit the files it.cnr.isti.zigbee.driver.configuration.properties and it.cnr.isti.zigbee.ha.configuration.properties, which must be located in the "services" configuration folder (e.g. /etc/services in Karaf). This is how the files should look like:

it.cnr.isti.zigbee.driver.configuration.properties

 it.cnr.isti.zigbee.driver.serial.portname=COM4 (change in accordance to your OS)
 it.cnr.isti.zigbee.pan.channel=22
 it.cnr.isti.zigbee.driver.serial.boudrate=115200
 it.cnr.isti.zigbee.driver.mode=Coordinator

it.cnr.isti.zigbee.ha.configuration.properties

 it.isti.cnr.zigbee.ha.driver.cluster.discovery.mode=HomeAutomationProfileStrict
 it.cnr.isti.zigbee.ha.reporting.min=60
 it.cnr.isti.zigbee.ha.reporting.max=0
 it.cnr.isti.zigbee.ha.reporting.change=0
 it.cnr.isti.zigbee.ha.reporting.overwrite=true

ZigBee Commissioning

Configuration properties for setting up connection and required parameters are stored in the configuration folder (/etc in Karaf) and are provided by OSGi ConfigurationAdmin. The name of the config file is lddi.zigbee.commissioning.configuration.properties. Most important parameters are scan timeout and delay settings of PIR devices. You can find an example of the file here: https://github.com/universAAL/lddi/blob/master/lddi.zigbee/lddi.zigbee.commissioning.adapter/configurationFile/lddi.zigbee.commissioning.configuration.properties

ZigBee Exporter

The exporter works "out of the box" without need for configuration, but you can set up some very basic customization to the devices data. In particular, you can configure the location of the devices. Just put/edit a file named ZB.properties in the configuration folder (/etc in Karaf) with each line assigning a ZB address to a location, for instance:

 260\:770\:0\:118@00\:12\:4B\:00\:00\:03\:14\:D4=Kitchen

(The character "\" is for Java. Just put it before every character ":") You can put an entry for each device address. Don't worry if you don't know the address: the Exporter generates an entry for each discovered device, assigning them a blank location.

This way, each registered device will be "placed" in a room, by setting its ontological representation property http://ontology.universaal.org/PhThing.owl#hasLocation to an instance of type http://ontology.universAAL.org/Location.owl#Room.