32
SWANN Open Platform for Ambient Environments based on UPnP and OSGi Olivier Liechti & Gen Suzuki University of Applied Sciences of Western Switzerland (HEIG-VD) 7221

Open Platform for Ambient Environments based on UPnP and OSGi€¦ · OSGi OVERVIEW > A container for Java applications / components. > Application life cycle management – Install,

  • Upload
    others

  • View
    0

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Open Platform for Ambient Environments based on UPnP and OSGi€¦ · OSGi OVERVIEW > A container for Java applications / components. > Application life cycle management – Install,

SWANNOpen Platform for Ambient Environments based on UPnP and OSGi

Olivier Liechti & Gen Suzuki

University of Applied Sciences of Western Switzerland (HEIG-VD)

7221

Page 2: Open Platform for Ambient Environments based on UPnP and OSGi€¦ · OSGi OVERVIEW > A container for Java applications / components. > Application life cycle management – Install,

2

AGENDA

> Background and motivations– Ubiquitous computing & calm technologies– Ambient user interfaces

> SWANN

– Vision & design objectives– System architecture

> Implementation

– UPnP– OSGi

> Demo> Conclusions, Q&A

Page 3: Open Platform for Ambient Environments based on UPnP and OSGi€¦ · OSGi OVERVIEW > A container for Java applications / components. > Application life cycle management – Install,

3

UBIQUITOUS COMPUTING

> "The Computer for the 21st Century"

– Mark Weiser, Xerox PARC

– Scientific American, 1991

> The third wave of computing

– 1 computer – many users

– 1 computer – 1 user

– 1 user – many computers

> Related concepts

– Pervasive computing, invisible computing, tangible user interfaces, ambient intelligence, Internet of Things, Web of Things

http://www.ubiq.com/weiser.html

Page 4: Open Platform for Ambient Environments based on UPnP and OSGi€¦ · OSGi OVERVIEW > A container for Java applications / components. > Application life cycle management – Install,

4

THE COMPUTER OF THE 21st CENTURY

"The most profound technologies are those that disappear.

They weave themselves into the fabric of everyday life until they are indistinguishable from it.

We are therefore trying to conceive a new way of thinking about computers, one that takes into account the human world and allows the computers themselves to vanish into the background."

Page 5: Open Platform for Ambient Environments based on UPnP and OSGi€¦ · OSGi OVERVIEW > A container for Java applications / components. > Application life cycle management – Install,

5

THE COMPUTER OF THE 21st CENTURY

"Indeed, the opposition between the notion of virtual reality and ubiquitous, invisible computing is so strong that some of us use the term "embodied virtuality" to refer to the process of drawing computers out of their electronic shells.

The "virtuality" of computer-readable data – all the different ways in which they can be altered, processed and analyzed – is brought into the physical world."

Page 6: Open Platform for Ambient Environments based on UPnP and OSGi€¦ · OSGi OVERVIEW > A container for Java applications / components. > Application life cycle management – Install,

6

TABS, PADS & BOARDS (Xerox PARC)"Ubiquitous computers will also come in different sizes, each suited to a particular task.

My colleagues and I have built what we call tabs, pads and boards: inch-scale machines that approximate active Post-it notes, foot-scale ones that behave something like a sheet of paper (or a book or a magazine) and yard-scale displays that are the equivalent of a blackboard or bulletin board."

Page 7: Open Platform for Ambient Environments based on UPnP and OSGi€¦ · OSGi OVERVIEW > A container for Java applications / components. > Application life cycle management – Install,

7

CALM TECHNOLOGY

"Calm technology engages both the center and the periphery of our attention, and in fact moves back and forth between the two.

We use "periphery" to name what we are attuned to without attending to explicitly.

Ordinarily when driving our attention is centered on the road, the radio, our passenger, but not the noise of the engine. But an unusual noise is noticed immediately, showing that we were attuned to the noise in the periphery, and could come quickly to attend to it."

addressinginfo overload!

http://sandbox.xerox.com/hypertext/weiser/calmtech/calmtech.htm

Page 8: Open Platform for Ambient Environments based on UPnP and OSGi€¦ · OSGi OVERVIEW > A container for Java applications / components. > Application life cycle management – Install,

8

AMBIENT USER INTERFACES

> Provides a continuous flow of subtle cues that are interpreted without requiring full attention

> Multi-modal: visual, auditory, tangible

> Abstract representations are very effective

Page 9: Open Platform for Ambient Environments based on UPnP and OSGi€¦ · OSGi OVERVIEW > A container for Java applications / components. > Application life cycle management – Install,

9

FROM THE WORKPLACE...

> Requirements for ubicomp applications

– Continuous network connection

– “Powerful” client devices

– Sensors & infrastructure (context awareness)

> In the mid 90's

– Immature and costly

– In general, not available outside the workplace (or the research lab...)

> Computer Supported Cooperative Work

– CSCW was the first application domain for ubicomp applications

– Support workers with a “smart” environment

– Create a sense of “who is around”

Page 10: Open Platform for Ambient Environments based on UPnP and OSGi€¦ · OSGi OVERVIEW > A container for Java applications / components. > Application life cycle management – Install,

10

...TO THE LIVING ROOM

> What has changed since then?

– Continuous broadband access has become the norm

– Explosion of Web 2.0 and social networks

– iPhone, Androïd and other Internet-enabled devices

– Sensors are widely used (GPS, accelerometers, etc.)

> Ubicomp in domestic settings

– Home automation (efficient use of energy, etc.)

– Entertainment (media access, gaming, etc.)

– Communication & social interactions (creating a sense of who is “around”)

Page 11: Open Platform for Ambient Environments based on UPnP and OSGi€¦ · OSGi OVERVIEW > A container for Java applications / components. > Application life cycle management – Install,

11

EXAMPLE: INTERACTIVE PHOTO CUBE

> Goals

– Create a sense of “being in touch” with one's family and friends.

– Offer a complement to explicit communication channels.

– Avoid the need for people to be in front of a screen.

> Physical artifact

– Photo prints are pasted on the faces of a cube.

– A different “emotion” is associated with each photo.

– Embedded sensors track the orientation of the cube.

> Usage

– The system knows when the user manipulates the cube.

– The system knows which photo is being looked at.

– The associated information is sent across the Internet and presented to another person.

Page 12: Open Platform for Ambient Environments based on UPnP and OSGi€¦ · OSGi OVERVIEW > A container for Java applications / components. > Application life cycle management – Install,

12

EXAMPLE: INTERACTIVE PHOTO CUBE

Page 13: Open Platform for Ambient Environments based on UPnP and OSGi€¦ · OSGi OVERVIEW > A container for Java applications / components. > Application life cycle management – Install,

13

Page 14: Open Platform for Ambient Environments based on UPnP and OSGi€¦ · OSGi OVERVIEW > A container for Java applications / components. > Application life cycle management – Install,

SWANN

Page 15: Open Platform for Ambient Environments based on UPnP and OSGi€¦ · OSGi OVERVIEW > A container for Java applications / components. > Application life cycle management – Install,

15

SWANN: DESIGN OBJECTIVES

> Ambient devices are already available on the market

– Nabaztag, Ambient orbs, etc.

– Initially, commercial offerings bundle one appliance with a small set of services (stock quote, weather forecast and a few)

– Publications and prototyping platforms for hobbyists, etc.

> Need for an open platform

– It should be possible to monitor different types of events with one device.

> Need for standards

– It should be possible to create ambient environments by assembling heterogeneous ambient devices and information services.

> SWANN aims to address this with an open middleware architecture

– Creates a dynamic bridge between devices and information sources

– Modular, pluggable architecture with dynamic discovery

Page 16: Open Platform for Ambient Environments based on UPnP and OSGi€¦ · OSGi OVERVIEW > A container for Java applications / components. > Application life cycle management – Install,

16

SWANN: GENERAL ARCHITECTURE

> Ambient box

– At home/office

– Connected to the local network

– Supports automatic ambient device discovery

– Accessible through a Web interface

> Ambient devices

– Physical artifacts distributed through the house

– Connected to the local network.

> Information sources & service proxies

– On-line services reachable through the Internet

– Examples: e-mail agent, blog monitoring agent, social network monitoring agent, photo sharing service, etc.

Page 17: Open Platform for Ambient Environments based on UPnP and OSGi€¦ · OSGi OVERVIEW > A container for Java applications / components. > Application life cycle management – Install,

17

SWANN: GENERAL ARCHITECTURE

Page 18: Open Platform for Ambient Environments based on UPnP and OSGi€¦ · OSGi OVERVIEW > A container for Java applications / components. > Application life cycle management – Install,

18

SOFTWARE ARCHITECTURE (INITIAL)

Page 19: Open Platform for Ambient Environments based on UPnP and OSGi€¦ · OSGi OVERVIEW > A container for Java applications / components. > Application life cycle management – Install,

19

UPnP: UNIVERSAL PLUG & PLAY

> Plug and Play for network devices.

– Discovery

– Description

– Control

– Event notification

> Used by:

– media centers

– video game consoles

– NAT routers

– etc.

> Also appropriate for simpler devices.

> Not a Java technology.

> Benefits for SWANN

– Ambient devices can be dynamically discovered

– Existing devices can be used off-the-shelf

Page 20: Open Platform for Ambient Environments based on UPnP and OSGi€¦ · OSGi OVERVIEW > A container for Java applications / components. > Application life cycle management – Install,

20

UPnP TOOLS> Intel UPnP tools (no longer

supported)

– A simple device

– Generic control point

– Device validator

– Etc.

> Many libraries, but few in Java.

> CyberLink for Java

– Open source

– Inactive...http://cgupnpjava.sourceforge.net/

Page 21: Open Platform for Ambient Environments based on UPnP and OSGi€¦ · OSGi OVERVIEW > A container for Java applications / components. > Application life cycle management – Install,

21

Apache Felix UPnP base driver> OSGi / UPnP bridge.

> Implements the OSGi specifications (UPnP™ Device Service Specification).

> Based on CyberLink for Java.

> The driver automatically imports and exports the devices:

– Discovery: local network → OSGi container

– Broadcasting: OSGi container → network local

> Well integrated with OSGi.

Page 22: Open Platform for Ambient Environments based on UPnP and OSGi€¦ · OSGi OVERVIEW > A container for Java applications / components. > Application life cycle management – Install,

22

OSGi OVERVIEW> A container for Java applications / components.

> Application life cycle management

– Install, start, stop, update, uninstall, etc.

– Programmatically and remotely

> Service platform

– Service registry

– Dynamic dependency resolution

Page 23: Open Platform for Ambient Environments based on UPnP and OSGi€¦ · OSGi OVERVIEW > A container for Java applications / components. > Application life cycle management – Install,

23

BENEFITS OF OSGi for SWANN> Extensibility

– Makes it easy to install new “service proxies” that provide information represented by ambient devices.

– Example: install a “Flickr activity monitor” in the home gateway.

– Device communication drivers (UPnP, Jini, etc.)

> Ability to update the whole application.

> Applications built from decoupled components.

Page 24: Open Platform for Ambient Environments based on UPnP and OSGi€¦ · OSGi OVERVIEW > A container for Java applications / components. > Application life cycle management – Install,

24

SERVICES: DECLARATIVE REGISTRATION<?xml version="1.0" encoding="UTF-8"?>

<component name="upnp-discoverer">

<implementation class="ch.iict.swann.core.impl.UPnPDiscoverer" />

<service>

<provide interface="ch.iict.swann.core.DeviceDiscoverer" />

</service>

<!-- Some references... -->

<reference

name="upnp-device"

interface="org.osgi.service.upnp.UPnPDevice"

bind="addDevice"

unbind="removeDevice"

cardinality="0..n"

policy="dynamic"

/>

</component>

Page 25: Open Platform for Ambient Environments based on UPnP and OSGi€¦ · OSGi OVERVIEW > A container for Java applications / components. > Application life cycle management – Install,

25

OSGI & UPnPpublic class UPnPDiscoverer extends DeviceDiscoverer {

/* … */

protected void addDevice(UPnPDevice dev) throws Exception {

AmbientDevice newUPnPDev = new UPnPDeviceAdapter(dev);

super.addDevice(newUPnPDev);

}

protected void removeDevice(UPnPDevice dev) throws Exception {

AmbientDevice temp = new UPnPDeviceAdapter(dev);

super.removeDevice(temp);

}

}

Page 26: Open Platform for Ambient Environments based on UPnP and OSGi€¦ · OSGi OVERVIEW > A container for Java applications / components. > Application life cycle management – Install,

26

MANIFEST.MFBundle-ManifestVersion: 2

Bundle-Version: 0.1.3

Bundle-SymbolicName: ch.iict.swann.UPnPDeviceCom

Bundle-Name: UPnP Device Communication (Swann)

Bundle-Description: This bundle uses UPnP to discover ambient devices on the network.

Import-Package: ch.iict.swann.core;version="[0.1.0,1.0.0)", ch.iict.swann.util.log;version="[0.1.0,1.0.0)", ch.iict.swann.persistence;version="[0.1.0,1.0.0)", org.osgi.service.upnp

Service-Component: OSGI-INF/upnp-discoverer.xml

Page 27: Open Platform for Ambient Environments based on UPnP and OSGi€¦ · OSGi OVERVIEW > A container for Java applications / components. > Application life cycle management – Install,

27

SOFTWARE ARCHITECTURE (INITIAL)

Page 28: Open Platform for Ambient Environments based on UPnP and OSGi€¦ · OSGi OVERVIEW > A container for Java applications / components. > Application life cycle management – Install,

28

SOFTWARE ARCHITECTURE (REFACTORED)

Page 29: Open Platform for Ambient Environments based on UPnP and OSGi€¦ · OSGi OVERVIEW > A container for Java applications / components. > Application life cycle management – Install,

29

WEB CONTAINER IN OSGi CONTAINER> Not a special case anymore.

> Could be updated, like any other component.

– While the rest of the application continues to run.

> Direct access to the OSGi services (no bridge).

Page 30: Open Platform for Ambient Environments based on UPnP and OSGi€¦ · OSGi OVERVIEW > A container for Java applications / components. > Application life cycle management – Install,

30

OUR EXPERIENCE WITH OSGi> Really modular applications: it just feels right.

> Small bundles, well defined interfaces.

– More manageable.

– But how many?

> Seems more complicated than it really is.

– Just a JAR with some required entries in the MANIFEST.MF file.

– Use the Declarative Services, or any alternative (Spring?).

> Lack of tools and support

– About to become a thing of the past.

– More and more libraries are made “OSGi compliant”.

Page 31: Open Platform for Ambient Environments based on UPnP and OSGi€¦ · OSGi OVERVIEW > A container for Java applications / components. > Application life cycle management – Install,

31

CONCLUSIONS> Ubiquitous computing

– is becoming a reality, both in the workplace and in the home

– mobile computing is only dimension of ubiquitous computing

> SWANN

– provides an infrastructure for building ambient environments

– uses OSGi as a core foundation

– uses UPnP as one device discovery & control technology

> Future work

– Improve the Web interface

– Alternatives to UPnP

– Deal with multiple users (sharing ambient devices?)

– Develop and evaluate audio-visual languages

Page 32: Open Platform for Ambient Environments based on UPnP and OSGi€¦ · OSGi OVERVIEW > A container for Java applications / components. > Application life cycle management – Install,

Olivier Liechti & Gen Suzuki

IICT / HEIG-VD [email protected]