Advanced Distributed Systems Course: 320571 Jacobs University Bremen Date: 2007-11-05 Dr. J¨urgen Sch¨onw¨alder Deadline: 2007-11-12

Problem Sheet #4

Problem 4.1: TinyOS 2.x (8+2+3+2+3 = 18 points)

In this homework, you are expected to install a working TinyOS development environment on your computer and to get familiar with compiling and running TinyOS applications on the motes we have (telosb and micaz with mts300 sensorboards and mib510 programming boards).

You first task is to install a working environment for programming TinyOS on your computer. You need the plus cross compiler that can produce for the target . You may also need a working Java installation. The TinyOS sources should be picked from the tinyos-2.x branch in the CVS repository.

Then work through at least the first six lessons of the TinyOS 2.x online tutorial and try to compile and run some of the sample applications. After you have familiarized yourself with the TinyOS environment, try to answer the following questions:

a) Very concisely (1-2 sentences each) describe the TinyOS terms module, interface, command, event, component, wiring, task, and split phase.

b) What is the make command that installs the Blink application on the telosb and the micaz platforms?

) What is the make command that installs the Oscilloscope application on our telosb and micaz platforms? How do you distinguish data coming from multiple different motes?

d) What does the TinyOS DemoSensor produce as data for our hardware configuration?

e) What is the max. communication distance of a mote running the Oscilloscope application and a mote running the BaseStation application (i) without any obstacles between them, (ii) with glass between them, and (iii) with walls between them (describe the walls you have tested)?

Problem 4.2: TinyOS 2.x Light Indicator (5+2+5 = 12 points)

Your task is to program motes to indicate the ambient light using their LEDs. In addition, you should familiarize yourself with the printf of TinyOS (lesson 15 of the tutorial) and use it to send debugging messages over the network.

a) Write a simple TinyOS application that senses the ambient light intensity. The light intensity should be classified into dark, light, medium, and strong light. A mote should use the three LEDs to indicate whether it is dark (all LEDs turned on), there is light light (two LEDs turned on), medium light (one LED turned on) or strong light (no LED turned on).

b) Extend the light indicator such that it sends measured data and any action taken over the wireless link using the printf library of TinyOS.

c) Make the sounder on the micaz board produce noise similar to an xray measurement devices. If it is dark, then there should be no sound. With some light light, you should produce some clicks that turn into a steady sound if light intensity increases to full light.