1 / 7

MUC Coursework

MUC Coursework. Deadline: 16 April Add all files to a folder, and send a compressed version of the folder (.zip or .tar) to niki@dcs.bbk.ac.uk by 26 March The compressed version should be named as follows: Name_Surname.zip or Name_Surname.tar

isanne
Download Presentation

MUC Coursework

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. MUC Coursework • Deadline: 16 April • Add all files to a folder, and send a compressed version of the folder (.zip or .tar) to niki@dcs.bbk.ac.uk by 26 March • The compressed version should be named as follows: Name_Surname.zip or Name_Surname.tar • Add any comments about your coursework (brief description of files, problems encountered, etc.) into a file called intro.txt

  2. Coursework (1/2) • Problem • 2n+1 nodes, one gateway (with an ID of 0), n nodes with odd IDs, n nodes with even IDs • Nodes with odd IDs collect light readings, those with even IDs collect temperature readings • At every period • the gateway asks the readings of the 2n nodes • the nodes collect the readings and send them back to the gateway • the gateway computes the average light and temperature

  3. Coursework (2/2) • The gateway • Computes the average light and temperature at the beginning of each period (of five seconds) • Sends the average light and temperature in a single packet to the UART • The other nodes • Send their readings after a random interval, so that the messages from different nodes are not sent at the same time

  4. Design • The gateway • has a PeriodTimer • sends BroadcastMsg • receives LightMsg and TempMsg • sends UartMsg • The other nodes • have a Light or Temp sensor • receive BroadcastMsg • have a DelayTimer • send LightMsg or TempMsg

  5. Architecture CourseworkC CourseworkM Makefile Leds Timer Random ADC SendMsg ReceiveMsg StdControl LedsC TimerC RandomLFSR DemoSensorC Temp GenericComm Main

  6. Hints (1/2) • if (TOS_LOCAL_ADDRESS%2==0) { /* even node */ } else { /* odd node */ } • You cannot pass parameters to tasks, you need to use global variables • Write a specific task for each message to send • You can send to the serial port using TOS_UART_ADDRESS (and you can see those messages using export DBG=uart)

  7. Hints (2/2) • The gateway needs four variables to compute the averages • sumLight • numberLight • sumTemp • numberTemp • The nodes need only one variable • lightValue or tempValue

More Related