Recent Changes - Search:

Wiki

Documentation

Tutorials

Example Code

Exercise

Editing Tutorials.Exercise

Must enter valid code


Summary:
Author: This is a minor edit
Enter confirmation code before saving:

Basic editing - Text formatting rules - Documentation index

Tables: simple - advanced

Paragraphs: for a new paragraph, use a blank line;

Line break: \\ or [[<<]]

-> to indent text, -< hanging text

Join line: \

Lists: * for bulleted, # for numbered, :term:definition for definition lists

Emphasis: ''italics''   '''bold'''   '''''bold italics'''''   @@monospaced@@

References: [[another page]], [[http://example.com/]], [[another page | link text]], [[#anchor]], [[#anchor | link text]]

Groups: [[Group/Page]] displays Page, [[Group.Page]] displays Group.Page, [[Group(.Page)]] displays Group, [[Group/]] links Group homepage

Separators: !!, !!! for headings, ---- for horizontal line

Prevent formatting: [=...=]

Other: [+big+]   [++bigger++]   [-small-]   [--smaller--]   '^superscript^'   '_subscript_'   {+inserted+}   {-deleted-}

Preformatted: [@...@] or >>pre<<...>><<

Preview Tutorials.Exercise

Page is unsaved

In this exercise you are to build an emulated house with sensor an actuators connected to the platform. This exercises requires two computers with Internet access. In overview, this will be the architecture of the final application:

BILD

1. Study

Read trough this excercise to understand what to do.
Read and understand the latest presentation slides on how the platform works. See Presentation Slides
Download the development kit and the source/sink examples.

Step 2.

Start building the house side code.
Use the source example as a base for the code of the house.
Register the following uci's to the house. Where NAME should be replaced with your own name.
NAME@miun.se/house/kitchen/temperature
NAME@miun.se/house/garage/temperature
NAME@miun.se/house/kitchen/light
NAME@miun.se/house/garage/light
NAME@miun.se/house/door
NAME@miun.se/house/garage/door

Step 2 Make the logic for each of the sensors and actuators.

The temperatures are only a sensors Kitchen temperature should return a random value between 20-23.G Garage temperature should return a random value between 10-15.

The lights are both sensors and actuators Kitchen light should return On or Off, depending on the light state Garage light should return On or Off, depending on the light state Kitchen light should changes upon receiving On or Off from a set Event to its UCI. Garage light should changes upon receiving On or Off from a set Event to its UCI.

The house door is both a sensor and an actuator House door should return Locked or Unlocked , depending on the door state The house door should changes upon receiving Lock or Unlock from a set Event to its UCI.

The garage door is also both a sensor and an actuator Garage door should return either Open, opening, Closed, or closing, depending on the state. When receiving an Open set event to its UCI, the door should go into opening state for 5 seconds, and then go to the Open. When receiving an Close set event to its UCI, the door should go into closing state for 5 seconds, and then go to the Open.

Step 3 Start building the client side code. Use the sink example as a base for the application Create a simple console application which can: Resolve the names to get access to the sensors. Read the kitchen temperature Read the garage temperature Turn On/Off the kitchen lights Turn On/Off the garage light Read the kitchen lights Read the garage lights Lock/Unlock the house door Read the house door state Open/Close the garage door Read the garage door state

Step 4 Make an Android app that can read the sensors and control the actuators as well. Base it on the Android sink example code


End of preview -- remember to save
Top

Edit - History - Print - Recent Changes - Search
Page last modified on September 18, 2013, at 04:26 PM