Programming Assignment 2

Assigned :   01st Mar
Code Due  :   15th Mar
Demo      :   22ndMar


Querying the motes:

In this assignment we will get data from sensors based on queries submitted by a java program on a PC.

Prerequisite:
  • You should know how to program the motes and should have completed programming assignment 1.
  • Read through lessons 6 and 7 of tinyos tutorial.
  • Upload the applications onto the motes that are connected to the machine in BY517BB.
There will be a sign-up sheet for using the machine to test the application in lesson 6 and 7.

This assignment will involve writing a tinyos application that will retrieve sensor data whenever it receives a request. Requests will be transmitted by a base station node (a node with TOSBase program) connected to a PC. The requests will be in the following format SenseMsg.h. The SenseMsg AM message will be used by the basestation to send a request to the motes and it will be used by the motes to send the data back to the base station.

Requests will be initiated by a java program that takes queries from the user. It prompts the user to enter the type of data to request and the id of the mote. Types of data that can be requested are 1) temperature 2) light reading 3) microphone input. The sensed data is returned as voltage values. The temperature voltage value can be converted into degrees Celsius, but this is not required for this programming assignment. (Hint: to sense data you will have to use some of the components that are in /opt/tinyos-1.x/tos/sensorboards/micasb directory.)

Sample prompt:

Please enter the data typei followed by the mote id or 'q' to exit:
Valid data types
t ------------- temperature
l ------------- light
m ------------- microphone

t 1 <--------------------------------User Input

The temperature value at mote 1 is : 167

Please enter the data typei followed by the mote id or 'q' to exit:
Valid data types
t ------------- temperature
l ------------- light
m ------------- microphone

l 2 <--------------------------------User Input

The light reading at mote 2 is : 238

Please enter the data typei followed by the mote id or 'q' to exit:
Valid data types
t ------------- temperature
l ------------- light
m ------------- microphone

m 2 <--------------------------------User Input

The microphone reading at mote 2 is : 210

Please enter the data typei followed by the mote id or 'q' to exit:
Valid data types
t ------------- temperature
l ------------- light
m ------------- microphone

quit <--------------------------------User Input

Good Bye


Deliverables
  • Java program code that takes queries and displays sensed values
  • NesC code for the sensing application
  • Application code (nesc files and java files) should be e-mailed to TA before the 15th of Mar
  • Demo of the application (Signup Sheet)

If you have any doubts you can contact valliappan@asu.edu (BY 517 BA).
Good Luck!



Home | Projects | People | Publications | Courses | Calendar | Resources