RSSI Monitoring - mszczodrak/swift-fox GitHub Wiki

To study wireless communication between two motes, one can use the Swift Fox rssi.sfp example programs. These programs compile into a firmware that exchanges beacon radio messages between the motes, and lights up each mote's LEDs according to the received message RSSI value. The first LED lights up when a mote receives a beacon; second LED lights up when a mote receives a beacon with the rssi strenght greater than the first threshold parameter value threshold_1 ; and the third mote's LED lights up when the beacon's rssi signal strength is greater than the second threshold parameter value threshold_2.

Depending on the mote platform, there is a different Swift Fox program for each of them:

Each of the Swift Fox programs uses the Rssi Fennec Fox application module, which source code can be found in fennec-fox/src/apps/tests/Rssi. The Rssi Fennec Fox module takes 5 parameters from the Swift Fox program:

use application rssi $(FENNEC_FOX_LIB)/apps/tests/Rssi (
		uint16_t tx_delay = 200,
		float rssi_scale = 1,
		int8_t rssi_offset = -45,
		int8_t threshold_1 = -80,
		int8_t threshold_2 = -50)

These parameters specify:

  • tx_delay - how often a rssi test beacon message is sent
  • rssi_scale - radio-chip specific RSSI scaling calibration value
  • rssi_offset - radio-chip specific RSSI offset calibration value
  • threshold_1 - the RSSI value when the second LED lights up
  • threshold_2 - the RSSI value when the third LED lights up

To run the RSSI Monitoring application example, go to the Swift Fox application examples directory for your mote platform. For example, for Telosb and Zolertia Z1, go to swift-fox/examples/cc2420/rssi.sfp. Then compile the Swift Fox program as follows:

$ sfc rssi.sfp

and compile Fennec Fox to your platform firmware; for example, to compile for Z1 do:

$ fennec z1

See Fennec Fox Compilation Wiki for the details about compiling and installing Fennec Fox firmware.

After installing the firmware on 2 or more motes, their LEDs will light-up according to the rssi value of the received beacon messages.

READING RSSI AND LQI ON A PC

It is also possible to read the beacon messages' RSSI (Received signal strength indication) and LQI (link quality indicator) values on a PC. To do this, enable serial printf debugging. To enable printf support, edit Fennec Fox Makefile, located in $(FENNEC_FOX_LIB)/Makefile, and un-comment the following lines:

CFLAGS += -I$(TOSDIR)/lib/printf
...
CFLAGS += -DFENNEC_TOS_PRINTF

After the Makefile modification, recompile the fennec and re-install on one mote that will stay attached to a PC through a USB interface. Then, from the shell, run the following serial parser library that comes with TinyOS:

$ java net.tinyos.tools.PrintfClient -comm serial@/dev/ttyUSB0:115200

The last arguments specify the USB port and the serial baudrate. More information about the TinyOS printf support and the java parser library can be found at TinyOS printf wiki.

After running the serial printf parser, one should see on the shell the non-calibrated RSSI and LQI values read from the beacon messages received from other motes. To calibrate the RSSI measurement, multiply it by a rssi_scale and add rssi_offset values, both specified in the rssi.sfp program, and both radio chip dependent. The motes' LEDs lights up with respect to the calibrated RSSI value, whereas the printf debugging interface prints the raw, uncalibrated RSSI).