CSE466 Lab 5: “Introduction to TinyOS”

Objectives

The goal of this lab is to use tutorials to introduce the structure of TinyOS . In this lab you will learn the following:

Important Warnings

  1. DO NOT power the mote from the AC adapter and batteries at the same time. ALWAYS turn off the motes battery power before placing it in the programming board. Only one mote should be plugged into the MIB510 programmer. 
  2. Be careful when placing your mica2dot into your MIB510 programmer - do NOT bend the pins.
  3. Some instructors of CSE378 use software that changes your windows profile to point to a network copy of cygwin, not the local copy of cygwin. To complete the labs in CSE466 you will need to make sure to use the local copy of cygwin. If for some reason TinyOS is not working please inform a TA or lab staff member and we will attempt to undo the profile change. In a few extreme cases, students' profiles have had to be wiped clean by support staff.

Important Notes

Reading

Resources

TinyOS Tutorials
ATmega128 data sheet
avr-gcc manual
Application notes section for the AVR 8-bit RISC family

Suggested Steps

  1. Unzip apps.zip to your Z drive, creating Z:\apps\.
  2. CAREFULLY plug one mote into your MIB510 programmer. Then plug the power and serial cables into the programmer. Battery power must be OFF!
  3. Launch Cygwin and use the alias "cdapps" to navigate to the apps folder on your z: drive. Type 'alias' in cygwin to obtain a list of available aliases. The aliases are provided to make navigation around TinyOS easier.
  4. Complete the tutorial called Lesson 1: Getting Started with TinyOS and nesC including the exercises. You will need to hand in your solution to the exercises for Lesson 1.
Question 1: What is the flow of control through the modules of the Blink application?  Start with main.nc and list the files in the order of their execution (this should include only xxx.nc and xxxM.nc files, make sure to include Leds.nc and Timer.nc) for the first 2 seconds of operation.
  1. Make sure BOTH members of your group attempt to compile and install an application onto a mote using his/her login to clear up any Windows profile issues.
  2. Solder together a 10k ohm resistor and your photoresistor to produce an assembly that has only 3 pieces of wire. The photoresistor should be connected between TP3 and TP6 (VCC), with the 10K resistor connected between TP3 and ground (TP1). See the sample we've made. NOTE: Only one wire should plug into the TP connectors. Use your photoresistor assembly to complete the tutorial called Lesson 2: Event-Driven Sensor Aqcuisition. You do NOT need to complete the exercise from this lesson. NOTE: Lesson 2 states "Notice the use of the function rcombine() in the implementation of StdControl.init()." However the recently updated version of SenseM does NOT use rcombine( ). It is confusing that the Lesson refers to rcombine() even though the function is no longer demonstrated in SenseM. The function rcombine() is a special nesC combining function which returns the logical-and of two commands who result type is result_t.

    Question 2: What are the events generated during the execution of the Sense application?  For each basic event coming from the hardware, describe the fountain of execution that is triggered (list each of the events and commands that are issued from each hardware event and the interfaces they move across).
mote
  1. Complete the tutorial called Lesson 3: Introducing Tasks for Application Data Processing including the exercises. You will need to hand in your solution to the exercises for Lesson 3.
  2. Complete the tutorial called Lesson 4: Component Composition and Radio Communication including the exercises. You will need to hand in your solution to the exercises for Lesson 4.
  3. Complete the tutorial called Lesson 6: Displaying Data on PC including the exercises. The "extra credit" section is optional and will not be worth any extra credit in this class. You will need to team up with another group to get a third mote to attempt the "extra credit".
  4. You and your partner might want to complete the first part of Lesson 5: Simulating TinyOS Applications in TOSSIM  to learn how to debug with TOSSIM. TinyViz is not working as described in this tutorial and problems have been reported on the help list. Therefore we will not be using it in this class to avoid unnessary complications. Feel free to attempt to experiment with TinyViz but the course staff will NOT support TinyViz.

Deliverables

Turn in your code from the exercises in answers to the two questions above. All your files should contain comments that include: both partners' full name, login, student number, the lab number (e.g. “Lab 5, Lesson 1”), as well as important words about how your code works.

  1. Turn in your solutions for exercises in Lessons 1, 3, and 4.
  2. Turn in your diagrams for questions 1 and 2.