Hide menu

TDDI07 Distributed embedded software and networks

Lab2, Communication


The main objective of this lab is to make you familiar with the wireless one-to-one communication using sensor nodes.

Preparatory questions


You are required to read lab 2 instructions and the additional resources on it in order to be able to answer the following questions before starting the lab. Some of the questions can be answered once you have completed lab 1.

  1. Regarding the sending and reception of messages:
    1. Which command is used to request the sending of a message?
    2. Which event notifies that the sending of a message is completed?
    3. Which event delivers received messages?
    4. Which component should implement the events mentioned in the previous questions? Is it the component that uses or the component that provides (implements) respective interface?
    5. You just received a message. What should be returned by your event handler? What will TinyOS do with the value you return?
    6. You just sent a message. When is it safe to use the message buffer again?
      Hint: There are two possible scenarios depending on success or failure of send.
  2. With the knowledge acquired from the previous lab about nesC programming:
    1. How can you generate a debug message?
    2. How do you change the address of a mote?
    3. How can you make the timer repeat at regular intervals? And at irregular intervals?

Lab 2


In the lab 2 you will implement an scenario where the road is under repairment process. Only traffic in one direction is allowed at the time. You will implement the synchronised traffic lights using the motes in order to allow a correct vehicular traffic.

You will simulate the lights using the leds on two motes. Use radio communication to synchronize the lights, one light being active while the other is inactive. As starting point you are given a basic application that sends messages from a mote to another. More information can be found in the lab instructions.

Additional resources for this lab:

To hand in:

You must demonstrate the application running in the sensor nodes to the lab assistant during lab hours. Moreover you should send a link to a branch (or tag in master) of your git repo to your assistant. In the repo you should have completed a report containing (use the report template):

  • Correct answers to the lab preparatory questions
  • Brief explanation of how your application works

The e-mail must contain the string
TDDI07 Lab X Group Y
where X is the lab number in the subject name and Y is the group number.

Lab 3


Page responsible: Mikael Asplund
Last updated: 2020-11-02