FlockLab Tutorial 6: A Real World Example
This tutorial mainly provides the source code for the test cases described in 1(#references). It differs from the previous tutorials in the sense that it is not necessarily meant to work through it in a serial manner but more to provide a reference on how measurements can be done.
Comparative Multi-Platform Analysis
This example provides the source code for the TinyOS collection tree protocol (CTP) on top of the LPL MAC layer for two different platforms: Tmote Sky and Tinynode184 (compare 1(#references), Sec. 5.1). The files are located in 'flocklab_tinyos/apps/tutorials/6_RealWorldExamples/MultiPlatform'
in the tutorial package.
Each node generates 100 packets. Every packet includes the source node ID and a sequence number in order to calculate the data yield at the sink. GPIO tracing is used to measure the end-to-end latency for each packet. GPIO pin 'INT2'
is set when a packet is generated and pin 'INT1'
is set at the source when a packet is received. The test configuration also enables power profiling. Be aware that this test generates a lot of data (> 1GB), especially power profiling samples. In order to evaluate the data it is beneficial to first fetch the 'results_nopower.tar.gz'
archive available through WebDAV which contains the test results without the bulky power profiling results.
Finding and Fixing Bugs
In this example, the code from the [#comparativeCTPLPL previous application] is additionally instrumented with GPIO instructions in the radio stack for Tmote Sky nodes:
GPIO Pin | Description |
---|---|
LED1 | Radio on |
LED2 | Radio TX |
LED3 | Radio RX |
When running this test, the acquired GPIO traces provide quite a good understanding of the communication protocol behavior. Although we use this instrumentation in 1(#references) to find a bug, this very example here should be bug-free. More details are available in 1(#references), Sec. 5.2.
Measuring Clock Drift
The speed of a node's clock is not constant. It varies with temperature, voltage and age of the crystal oscillator. In this example, the drift of the clock is measured twice, once using GPIO traces and once with a time synchronization protocol (FTSP, available in TinyOS). At the same time, temperature measurements are taken with the onboard temperature sensor of the Tmote Sky nodes.
All files for this example are located in 'flocklab_tinyos/apps/tutorials/6_RealWorldExamples/ClockDrift'
. The provided test configuration can be used without modification. In order to get some reasonable observations on this slowly changing phenomenon, the test duration needs to be rather long. The selected subset of nodes contains all the available outdoor nodes. Those will experience the biggest temperature variations. Example data from a 24 hours experiment can be found in 1(#references), Sec. 5.4.
Included in the source file package is a Python script which can be used to print out the measurements after the test is done. When called like this
./evalClockDrift.py your_test_results.tar.gz
it should print out temperature, FTSP drift and drift measured by FlockLab for all the involved nodes. Drift values are in ppm (parts per million) and indicate the drift relative to the root node.
References
-
FlockLab: A Testbed for Distributed, Synchronized Tracing and Profiling of Wireless Embedded Systems
R. Lim, F. Ferrari, M. Zimmerling, C. Walser, P. Sommer, J. Beutel
IPSN '13, Philadelphia, Pennsylvania, USA