
UM1454
Install and run the sink-sensor application
Doc ID 022085 Rev 2
21/28
3
Install and run the sink-sensor application
The sink-sensor application included in the IDZ3LIB is provided to allow the STEVAL user to
easily set up a ZigBee network by using the hardware included in the kit. The sink-sensor is
derived from the homonymous application included in the EmberZnet package libraries and
shows the basic features of a distributed sensor network for remote monitoring.
The sink-sensor application requires the use of at least two different STEVALs (or other
compatible hardware), respectively running sink and sensor applications in the same
network.
3.1
Sink-sensor sample application
The sensor-sink application is an example of a complete application that implements a
distributed sensor network with one or more data collection points (called “sensors”) and
one data storage point (called “sink”). This application uses a “push” style of communication,
where the sensor periodically sends reports to the sink without needing to be asked for this
data.
In this specific case, sensors capture temperature data measured by the sensor that is
integrated in the STEVAL and sends that data to a sink that is connected to a PC. Data
collected by the sink are then available at serial ports associated to the STEVAL when it is
connected to a PC and they can be used by every kind of application running on it.
The sink node is also set up to be the ZigBee coordinator device, and it forms the network
automatically on first startup, therefore retaining these settings across reboots. The sink
sends out advertisements (SINK_ADVERTISE) at regular intervals using a multicast (after
making a many-to-one route request). If the joining procedure is activated by pushing a
button on the board, a not joined sensor hearing a SINK_ADVERTISE sends a message
(SENSOR_SELECT_SINK) requesting to use that sink (after setting its address table entry
to the sink). If the sink has a free address table entry it responds with a sink ready message
(SINK_READY) and, at that point, the sensor is free to send data (DATA) to the sink at fixed
intervals (as set by SEND_DATA_RATE).
The sink sensor communication is set with the following network parameters:
CHANNEL - 26
PANID 0x01ff
APP_EXTENDED_PANID {'s','e','n','s','o','r',0,0}.
The payload of the packet sent by the sensor is 12 bytes long and it includes:
8 bytes corresponding to the 64-bit address of the sender
2 bytes corresponding to the temperature values as captured by the sensor integrated
in the STEVAL
2 bytes corresponding to the voltage level as measured on the voltage meter integrated
in the STEVAL.
The sensor-sink application allows the user to interact with STEVAL by sending commands
through a serial port (the COM associated to STEVAL when connected to the PC). Refer to
the sink and sensor source files for the list of supported commands and implementation.
www.BDTIC.com/ST