ECE 6615: Sensor Networks
Homework 1: Lab Project
Part 1
This assignment is aimed to familiarize you with the basic working of the MicaZ motes. For any sensor application, the ability to send and receive data in a usable form is very important. Additionally, there are constraints on when the data should be sent, how much information to include in a packet and the way in which it is displayed to the end user. There are three tasks in the assignment.
Task 1: Tiny OS Introduction
The first task is to set up a TinyOS environment on one of your laptops and to program one sensor node.
Installation Method 1
One method to set up your TinyOS environment is to use the preconfigured virtual machine available here:
ECE-6615-15-TinyOS-VM.zip [2.2 GB,
MD5] according to the following steps:
- Install VirtualBox on your laptop.
- Unzip the virtual machine file.
- Start the virtual machine on VirtualBox by opening the .vbox file, and log in with the password gojackets.
- Connect the USB sensor board and click Crossbow MIB5.. under Devices > USB Devices > from Virtual Box menu bar.
- Check that you have two new devices /dev/ttyUSB0 (for programming) and /dev/ttyUSB1 (for communicating) in your virtual machine by typing in the terminal ls /dev/ttyUSB* .
Installation Method 2
Another method is to install TinyOS version 2.x (currently 2.1.2) in your machine according to the following steps:
- If you are using Windows (Vista and later versions) or Linux:
- Install Java 1.6 JDK (32-bit).
- Install Cygwin (only if you are using Windows). Include the Python, Perl, RPM, and gcc packages.
- Install the native compiler for the MicaZ processor family (Atmel AVR Tools only).
- Install the nesC 1.3.1 compiler.
- Install the TinyOS source tree. When setting your global variables in Windows, please write always the full path in all of them (avoid pointers between variables, Windows Vista and the later versions do not interpret them properly).
- If you are using the USB Programming Board, you need to download the drivers for the FTDI drivers from here.
A detailed explanation can be found here.
- If you are using Mac OS X:
- Install XCode from your Mac OS X DVD or download it from here.
- Install Darwin Ports from here.
- Install nesC 1.3.1 compiler. Use this patched version.
- Install the native compiler for the MicaZ processor family (Atmel AVR Tools only).
- Install the FTDI drivers.
- Install Tinyos-2.x and set up the global variables.
A detailed explanation can be found here. Please use the patched version above of nesC 1.3.1. Ignore the last make command in the instructions when installing TinyOs.
Sensor Programming
Now we will program the sensor board to run the Blink application where the all the three LEDs on the sensor board blinks with different frequencies.
Compiling the application:
The TinyOS files are located in
/opt/tinyos-2.1.2/ directory under
Computer at
Places.
Open this directory and copy the
Blink directory to your home directory.
Then open the terminal and go to Blink directory by typing
cd Blink in your home directory. Type
make micaz in the
Blink directory. This instruction compiles the Blink application code. You should not see any error.
Downloading the application to the sensor board:
Plug the micaz node on the programming board. Please make sure the sensor node is switched off. You can even take the batteries out. To program the node:
- If you are using an USB board, type make micaz install, 1 mib520,SERIAL_PORT, where SERIAL_PORT refers to the name that your OS has assigned to the USB port where you have plugged the sensor programming board (in Windows, use the device manager to find this out, in Linux or Mac OS X look for it in /dev/tty). If you are using the Virtual Box Machine instead of SERIAL_PORT you should type /dev/ttyUSB0. Be careful with the spaces in this command.
- If you are using the Ethernet board, type make micaz install eprb,192.168.0.2. Note that you will have to manually set up the IP address of your ethernet adapter to 192.168.0.1.
Now observe the effect on the three LEDs. You can now also unplug the node and power it using the batteries.
Task 2: Understanding of Sensor Applications
The Blink application displays a counter with the LED2 'blinking' at .5Hz, LED1 at 1Hz, and LED0 at 2Hz. Change the blink rate for LED2, LED1 and LED0 to 0.5Hz so that they now 'blink' together. You should modify the
BlinkC.nc in the
Blink directory.
Task 3: Changing the System Timers
The Blink program depends on using three separate timers, one for each of the LEDs. What change will you do to trigger all the three LEDs from a single system timer? Modify the Blink code (
BlinkC.nc and
BlinkAppC.nc) to implement your solution.
Change the blinking rate for the LED2 to 0.5Hz, LED1 at 1Hz, and LED0 at 2Hz but this time all the three should be triggered by a single timer.
Deliverables
- A visual demonstration of tasks 1, 2 and 3 to one of the TAs is required.
- Soft-copy of code for Tasks 2 and 3 to be submitted to infocom@ece.gatech.edu.
Due Date
- Sunday, March 08, 2015, 11:59pm.
Questions? E-mail: infocom@ece.gatech.edu