Project 1

Deadline extended until Friday 3/12 - DEMO REQUIRED

Due Monday 3/8 - 3:30pm

The goal of this assignment is to give you experience with coordination in a sensor environment. For this assignment, you will extend your program from Lab 3 in two ways:

    1. Movement Detection - In addition to periodically sampling the temperature your SPOTs will also detect movement, for example shaking of the SPOT. If a SPOT detects movement, it will immediately report the event to the base station. You should use the IAccelerometer3DThresholdListener to determine whether movement has occurred.
    2. Duty Cycling and Synchronization - To conserve energy, you will implement a duty cycling algorithm that will allow your SPOTs to cycle between an on state during which they will collect data (temperature and movement), send messages, and route packets, and a deep sleep state. In order for the sensors to communicate and route messages for one another, the on periods will need to be synchronized.

Synchronization Algorithm

The basestation will control the active/idle periods of the SPOTs. During the 5 second active period, the basestation will send 5 synchronization messages, spaced 1 second apart. The synchronization messages will contain an integer to represent the relative time before the SPOTs will return to a deep sleep state. SPOTs should remain in the idle period for 5 seconds.

Other Requirements

    1. A SPOT should be able to join the network at any time and eventually synchronize its on period with the remaining SPOTs. You will likely want to modify the SPOT startup procedure such that it does not begin the duty cycle until it has synchronized.
    2. The SPOTs may need to adjust their sleep/wake times every cycle to stay synchronized.
    3. The SPOTs are very picky about when the decide to go into deep sleep. When a SPOT is not in the on state, it must be in deep sleep mode. In order to enable the deep sleep mode, all threads must be idle. This can be very tricky and will require that any threads blocked on network i/o (listening on a socket) be put into an idle state.

Submission

    1. For full credit, you must upload your code to your SVN repository. Upload your code into directories using the following naming convention. Failure to use this exact naming scheme may result in deduction of points.
      1. <username>/cs685/proj1/DutyCycleSPOT
      2. <username>/cs685/proj1/DutyCycleBaseStation
    2. For full credit, you must demonstrate your program during class on the due date.
    3. See this SVN How-to for more information on using SVN.