The goal of this assignment is to give you experience with coordination in a sensor environment. For this assignment, you will extend your Movement Detection program from Project 2 such that the sensors duty cycle. The sensors will be on, communicating and detecting movement, for 5 seconds. followed by a deep sleeping period of 15 seconds. In order for the sensors to communicate and route messages for one another, the on periods will need to be synchronized.
The basic operation of the SPOTs will be to deep sleep for 15 seconds, wake, idle for 5 seconds, and return to deep sleep. During the idle period, a SPOT may detect movement. Whenever movement is detected during the idle period, the SPOT will send a movement detected message to the base station. During the idle period the SPOT may also gather and report neighbor information to the base station.
To enable this, the base station program from Project 2 will be modified to facilitate coordination in the network. The base station will also follow the 5 seconds active/15 seconds idle cycle. During the active 5 seconds, the base station will send 5 synchronization messages, spaced 1 second apart. The synchronization messages will contain an integer to represent the message type followed by an integer to represent the relative time before the base station will return to idle state (recall: the base station will not go into deep sleep mode since it is connected to the USB interface). Use 53 as the message type.
Upon receipt of a synchronization message, a SPOT can determine whether it is synchronized with the rest of the network. It should adjust the length of its awake cycle to ensure that it returns to deep sleep, and subsequently wakes again, at the same time as the base station. It is strongly recommended that you read the paper An Energy-Efficient MAC Protocol for Wireless Sensor Networks as you implement your algorithm.
plmeCCARequest()
).
Compare the results in the broadcast network from project 1 to
the unicast network from project 2. In addition, vary the network
configuration. For example, you might try two configurations: one
where all SPOTs are within range of all other SPOTs and one where some
SPOTs only hear a subset of the others.