TDDI07 Distributed embedded software and networks Department of Computer and Information Science Lab 3 – Energy aware wireless communication Learning objectives The main objective of this lab is to make the student understand the challenges and trade-offs of energy efficient wireless communication using sensor nodes. Specifically, after completing the lab the student shall be able to: • • • Explain the concepts of low power listening and duty cycle. Program an application that sends data via serial port. Program an application that uses the wireless communication capabilities of real sensor nodes considering energy consumption. Assignment 1: Duty Cycle The power consumption of a low-power wireless radio is roughly similar whether the mote is sending, receiving or idle. In the previous assignment the motes were listening all the time in idle to receive and do not miss any packet sent by the other motes. This is very energy consuming. In order to reduce the energy consumption, a mote can switch off the radio interface for a while and listen for very short intervals to detect transmissions. The duty cycle is an indicator of the energy consumption of a mote by measuring the time that the mote has the radio switched on in percentage. In this assignment you are required to measure the duty cycle varying the sleeping time and plot it in a graph where the x-axis represent the sleeping time and the y-axis the duty cycle. A table with the values of the graph has to be handed in as well. The sleeping times are 10, 100, 500 and 1000 milliseconds. How is the duty cycle calculated? How is the energy consumption affected using the duty cycle? Does the channel impact the energy consumption? Measure the duty cycle for two different channels. It takes some time until the value of the duty cycle is stabilized. Therefore, wait until you get a reasonably stable value (it can take more than a minute). Skeleton: In order to study the duty cycle you are provided with a lab skeleton. Your task is to study the RadioStats interface (which can be found in EnergyLPL/tos/chips/cc2420/interfaces) and send the needed information in an EnergyLPLMsg via serial port. Remember to change the radio channel that is assigned to your group. Changing the sleeping time: In the makefile you can find the parameters to change the sleep interval. In particular, you will change the DLPL_DEF_LOCAL_WAKEUP and DLPL_DEF_REMOTE_WAKEUP maintaining the same value for both. The first indicates the sleep interval and the second the long preamble time, explained in the second assignment. TDDI07 Distributed embedded software and networks Department of Computer and Information Science SerialSend: With the skeleton you are provided a simple Java application (SerialParser) that prints the duty cycle when a mote sends an EnergyLPLMsg via serial port. In order to use it you have to export once the MOTECOM variable and launch the application from the command line: export MOTECOM=serial@/dev/ttyUSBX:telosb (X is your USB number) java SerialParser You are required to add the needed components and interfaces to send the EnergyLPLMsg with the duty cycle data via the serial port when the timer triggers. Remember to initialise the serial interface at startup. Set the timer to trigger every 2 seconds. Set the transmitters duty cycle to 0 (TxOn and TxOff). Assignment 2: Energy efficient communication When a mote wants to send a packet to a mote that is sleeping, the transmission is done for longer period in order to make sure that it will catch the receiver in a period when it is listening the medium. The Figure below shows it. In this assignment you are required to study the impact of the communication and the different configurations of sleeping intervals in the duty cycle of a sender and receiver. You will use two motes, one as receiver and one as sender. The sender will send a packet every 5 seconds, that is, the inter-packet interval (IPI) is 5 seconds. In the EnergyLPLMsg packet, the sender sends its counters (TxOn and TxOff) in order to calculate its duty cycle later on. The receiver adds its values and sends everything via serial port. You are required to modify your previous application to calculate the duty cycle of the receiver and sender using the SerialParser application. The result of this assignment is a graph where the x-axis is the sleeping interval and the y-axis is the duty cycle as in the assignment 1. However, this time you TDDI07 Distributed embedded software and networks Department of Computer and Information Science will have 2 curves representing the duty cycle of the sender and the receiver. Give the values of the graph in a table as well. When is the communication more energy efficient? Which are the parameters impacting the duty cycle? If we change the IPI, will we get the same results? Which are the affecting variables? To hand in: Once the lab is finished, the student has to show the application running in the sensor nodes to the lab assistant. After showing the application, the student must send a zip file containing a written report answering correctly to the lab preparatory questions and the final source code of the applications. The report must contain the obtained graphs and tables as well as the answer to the questions formulated in the lab. 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. Additional resources for this lab: TinyOS programming: http://www.tinyos.net/tinyos-2.x/doc/pdf/tinyos-programming.pdf TinyOS tutorials: http://docs.tinyos.net/tinywiki/index.php/TinyOS_Tutorials Serial port communication: http://docs.tinyos.net/tinywiki/index.php/MotePC_serial_communication_and_SerialForwarder#Sending_a_packet_to_the_serial_port_in_TinyOS Mote-to-mote communication: http://docs.tinyos.net/tinywiki/index.php/Mote-mote_radio_communication