In the context of the FP7 EAR-IT
project on acoustic surveillance in smart environments, this page
describes and provides links to various tools for benchmarking
low-resource device test-beds based on IEEE 802.15.4 connectivity.
last update: July 17th, 2014.
We developped in collaboration with INRIA CAIRNS and Feichter
Electronics a daughter audio board with speex compression
capability. The audio board is connected to a low-resource device,
allowing real-time audio capture and compression. You actually don't need the audio board for the
benchmark, but if you want to test real audio streaming on your
test-bed, we can provide you with the audio mote, see the "Contact" section at the end of
this page.
Figures below show the developped audio board that was initially
designed to be connected to an AdvanticSys
CM3000 mote (or CM3300 or CM4000), that will be referred to
as the TelosB audio mote.
The control software for the Telosb audio mote gets the compressed data from the audio board and sends them to the next hop (a BaseStation or a relay node). The BaseStation is another TelosB mote that is connected to a Linux computer to act as a Sink. The BaseStation is not mandatory in the benchmark procedure but we can use it to listen in real-time to the audio stream. The archive for the source code of the TelosB audio and the BaseStation can be obtained here, all source code are under the TinyOS 2.1.2 operating system. Please refer to TinyOS installation instructions for setting up the TinyOS environment.
The TelosB audio mote can be used to benchmark the test-bed for
acoustic data. speex handles audio data in FRAME_SIZE. The value
of FRAME_SIZE on the audio board is 160 bytes. Then encoding takes
FRAME_SIZE bytes and compresses them is a number of encoded bytes.
For 8000 bps rate, the encoded packet size is 20 bytes and the
periodicity is 20ms. The BaseStation receives packets from the
audio board. Each packet has frame delimiters (0xFF 0x55 SN) prior
to the number of bytes (0x14=20) per packet in the output stream.
SN will store an 8-bit sequence number. An example is shown below:
0xFF 0x55 0x00 0x14 .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
.. .. .. .. ..
0xFF 0x55 0x01 0x14 .. .. .. .. .. .. .. ..
.. .. .. .. .. .. .. .. .. .. .. ..
0xFF 0x55 0x02 0x14 .. .. .. .. .. .. .. ..
.. .. .. .. .. .. .. .. .. .. .. ..
To build the TelosB audio mote with IEEE 802.15.4 16-bit address
of 0x0090:
AudioBoard_modif> CFLAGS="-DNODE_SHORT_ADDRESS=0x0090 -DDEST_SHORT_ADDRESS=0x0100" make telosb
Then install with:
AudioBoard_modif> make telosb reinstall bsl,/dev/ttyUSB0
To build and install the BaseStation mote with IEEE 802.15.4 16-bit address of 0x0100:
BaseStation> CFLAGS=-DNODE_SHORT_ADDRESS=0x0100 make telosb
BaseStation> make telosb reinstall bsl,/dev/ttyUSB0
Then refer to "WP1
Acoustic Test-bed Qualification/Benchmarking procedure for other
test-beds" to see how the TelosB audio mote can be
controlled wirelessly with the XBeeSendCmd tool.
We use an XBee S1 from Digi (802.15.4, not ZigBee) as a radio gateway to send control messages. We provide the XBeeSendCmd tool that uses such gateway to send ASCII command. However, you can use any similar tools (or the X-CTU program provided by Digi) to send pure ASCII command sequence with an IEEE 802.15.4 radio module. Please refer to "WP1 Acoustic Test-bed Qualification/Benchmarking procedure for other test-beds" for a list of ASCII control sequence used to control the TelosB mote.
The source code for XBeeSendCmd is available here:
To compile:
> g++ -Wno-write-strings -o XBeeSendCmd XBeeSendCmd.c -lrt
Example (trigger audio
capture and transmission at the TelosB audio mote):
> XBeeSendCmd -p /dev/ttyUSB0 -addr 0090 "@/C1#"
We also provide a simple speex decoder that waits for frame delimiters (0xFF 0x55) and that will decompress the audio stream into raw format to Linux's stdout. The source code for speex_sampledec_wframing is available here:
To compile:
> gcc -DWITH_PKT_FRAMING -o speex_sampledec_wframing
speex_sampledec.c -lspeex -lspeexdsp
See below for an example of usage
Once you have the TelosB audio mote and the BaseSation mote, you can test by triggering the audio capture and listen in real-time to the audio stream. Here are the procedure:
We provide a promiscuous packet sniffer under TinyOS to be
connected to the wireshark
packet analyser. It's usage for the benchmark of test-bed is
described in "WP1
Acoustic Test-bed Qualification/Benchmarking procedure for other
test-beds". The promiscuous packet sniffer is based on the
TKN154 protocol stack and the TestPromiscuous or packetsniffer example. We improved TestPromiscuous to
build a sniffer node. The source code is available here:
> CFLAGS="-DSNIFFER_CONF -DPCAP_SERIAL_OUTPUT" make telosb
> make telosb reinstall bsl,/dev/ttyUSB0
Then there is a simple python program that will continuously read
the serial port and send data to wireshark. The mote will capture
packets and will send pcap-formatted data to the serial port. More
information on pcap format can be found here.
The python program is TelosbToStdoutPcap.py
Then you can run the following command with your TelosB mote
plugged in your computer on /dev/ttyUSB0:
> python TelosbToStdoutPcap.py | wireshark -k -i -
you may need to give sudo permission:
> python TelosbToStdoutPcap.py | sudo wireshark -k -i -
If running on /dev/ttyUSB1, just specifiy it in the command:
> python
TelosbToStdoutPcap.py /dev/ttyUSB1 | wireshark -k -i -
You can see the graphical result below:
If you use a recent version of wireshark with 6LowPan/CoAP dissector, you
will be able to see RPL messages and CoAP exchanges as in the
CoapBlip example of TinyOS.
Limitations:
Acknowledgments:
The original development tool for
plugging a mote to wireshark has
been provided by Pierre-Yves Lucas from University of Brest.
He wrote a simple program to translate XBee API format to pcap
format in order to be able to use wireshark with XBee module. We improved
this idea by porting it to TelosB and MicaZ and CC2420 radio
using TinyOS and TKN154 which is a much more powerful
environment.
As described in "WP1
Acoustic Test-bed Qualification/Benchmarking procedure for
other test-beds" here are:
The audio board communicates with the host sensor mote with an
UART line. The communication speed is normally 115200 baud on the
TelosB, but this can be changed. We successfully connected the
developed audio board to a Libelium WaspMote sensor board at the
speed of 38400 baud. Please contact us for more information.
The TelosB audio board
can be borrowed if you are willing to benchmark your test-bed.
Please contact Philippe Cousin (EGM) from EAR-IT project.
C. Pham
University of Pau, France & EGM