Recent Changes - Search:

Wiki

Documentation

Tutorials

Example Code

Exercise

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:

1. Study and Download

Read trough this whole exercise to understand what you will 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.

2. Build the House

Start building the house side code. Use the source example as a base for the code.
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

3. Make the House Logic

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.

3. Build the Client Application

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

4. Build an Android App

Make an Android app that can read the sensors and control the actuators as well.
Base it on the Android sink example code.
Edit - History - Print - Recent Changes - Search
Page last modified on September 18, 2013, at 04:26 PM