web of things - connecting people and objects on the web

44
Web of Things - Connecting People and Objects on the Web Workshop @ SXSW10, Austin, 14 March 2010 Vlad Trifa & Dominique Guinard http://www.webofthings.com

Upload: guest53dda1

Post on 12-May-2015

5.354 views

Category:

Technology


1 download

DESCRIPTION

Talk at SXSW 2010, Austin, Texas about our current research in the Web of Things with a focus on integration of Things with Javascript.

TRANSCRIPT

Page 1: Web of Things - Connecting People and Objects on the Web

Web of Things - Connecting People and Objects on the

WebWorkshop @ SXSW10, Austin, 14 March 2010

Vlad Trifa & Dominique Guinard http://www.webofthings.com

Page 2: Web of Things - Connecting People and Objects on the Web

WoT@SXSW10

Virtual doggy bag online:

Disclaimer: We are going to demo undergoing research, so please bear with us.

http://www.webofthings.com/sxsw

Page 3: Web of Things - Connecting People and Objects on the Web

WoT@SXSW10

Electronic things are invading us...• Increasingly powerful CPUs• Sensors & actuators• Web connectivity

• Cheap

• Ubiquitous

Page 4: Web of Things - Connecting People and Objects on the Web

Translation for geeks:An infinite playground.

YAAAY!

Page 5: Web of Things - Connecting People and Objects on the Web

WoT@SXSW10

Problem is...

• Tons of different devices: • Capabilities/functions

• Applications/middlewares

• Networking protocols

That is, without a PhD in Computer

Science

How to create easily interactive applications that combine various

heterogeneous devices???

Page 6: Web of Things - Connecting People and Objects on the Web

We need an universal protocol that is:

simple, lightweight, loosely-coupled, scalable, flexible

and hopefully... standard

Page 7: Web of Things - Connecting People and Objects on the Web

Sounds like the Web

Page 8: Web of Things - Connecting People and Objects on the Web

WoT@SXSW10

So let’s leverage it!

• TCP/IP & Web granted, WiFi routers ubiquitous• Development of simple Web apps: cheap & quick• Integrate real-world data on the Web• Get features of the Web for free

Use Web standards to develop applications for networked devices.

HTTP, HTML, XML, JSON, RSS, ATOM, MIME,...

Page 9: Web of Things - Connecting People and Objects on the Web

RESTifyingThings

Page 10: Web of Things - Connecting People and Objects on the Web

WoT@SXSW10

The Web of Things in a nutshell

3 steps to create a basic Web of Things:• Connecting things to the Internet (IPv4/IPv6)• Embedded Web servers • Make devices part of the Web (using REST)

• Model their function as RESTful resources

Page 11: Web of Things - Connecting People and Objects on the Web

WoT@SXSW10

RESTful SunSPOTs

• Properties and functions are RESTful resources

• Devices/services become Web resources

• URI-addressed

• Links between them (hateoas)

• Different representations (content negotiation)

• Uniform interface (HTTP verbs, status codes)

Page 12: Web of Things - Connecting People and Objects on the Web

WoT@SXSW10

Sunspots resources modeling

• Services on embedded devices are adapted for resource oriented architectures

• root: www.spotshost.com

• spots list: www.spotshost.com/sunspots

• spot #1: www.spotshost.com/sunspots/1

• sensors list: www.spotshost.com/sunspots/1/sensors

• LEDs : www.spotshost.com/sunspots/1/actuators/leds

• LED #1 : www.spotshost.com/sunspots/1/actuators/leds/led1

Page 13: Web of Things - Connecting People and Objects on the Web

WoT@SXSW10

Representations

• XHTML ideal for browsinghttp://webofthings.com/spots

• JSON ideal for parsing (& lightweight for device)http://webofthings.com/spots.json

• XML ideal for business integrationhttp://webofthings.com/spots.xml

Page 14: Web of Things - Connecting People and Objects on the Web

WoT@SXSW10

Uniform interface

• HTTP verbs• GET: current temperature

• POST: add a timer

• PUT: turn a device on/off

• DELETE: delete a timer on a device

• HTTP headers• Accept header for MIME types

• Status codes (200 ok, 401 unauthorized)

Page 15: Web of Things - Connecting People and Objects on the Web

WoT@SXSW10

DEMO - RESTful spots

• Browsing the spot manager• Poster with content negotiation• Javascript app to change LEDs colors

Page 16: Web of Things - Connecting People and Objects on the Web

Gateways toWeb-enable things

Page 17: Web of Things - Connecting People and Objects on the Web

WoT@SXSW10

Embedded REST is not always possible

NonIP

devices

Page 18: Web of Things - Connecting People and Objects on the Web

WoT@SXSW10

For Wireless Sensor Networks (WSN)...

Page 19: Web of Things - Connecting People and Objects on the Web

WoT@SXSW10

Example application: Energie Visible

Gateway (IP:10.1.1.5)

Sensors(Ploggs)

Electric appliances

Web / Mobile Interface GET http://10.1.1.5:8080/energievisible/ploggs/all

[{ "deviceName": "ComputerAndScreen", "currentWatts": 50.52, "KWh": 5.835, "maxWattage": 100.56}, "deviceName": "Fridge", "currentWatts": 86.28., "KWh": 4.421, "maxWattage": 288.92}, {...}]

Page 20: Web of Things - Connecting People and Objects on the Web

WoT@SXSW10

More? Webofthings.com/energievisible

DEMO - Energie Visible

Page 21: Web of Things - Connecting People and Objects on the Web

Devices goneWeb

Page 22: Web of Things - Connecting People and Objects on the Web

Devices goneSocial

Page 23: Web of Things - Connecting People and Objects on the Web

WoT@SXSW10

SAC: Social Access Controller

• Access Control Lists not suited for real-world sharing

• Leverage social networks for sharing devices

• OAuth for delegated authentication

Page 24: Web of Things - Connecting People and Objects on the Web

WoT@SXSW10

FAT: Friends and Things

• GWT application on top of SAC• Log in using your social networks.• Discover, share, and advertise devices with friends.• Serves ATOM feeds of aggregated device data.

Page 25: Web of Things - Connecting People and Objects on the Web

WoT@SXSW10

DEMO - FAT

More? tinyurl.com/ygy2kwb

Page 26: Web of Things - Connecting People and Objects on the Web

The era of physicalMashups

Page 27: Web of Things - Connecting People and Objects on the Web

WoT@SXSW10

Real-world Web applications

REST

REST

URL

PHP

REST

API

[hCp://www.pachube.com] [hCp://www.webothings.com/energievisible] [hCp://www.clickscript.ch]

JavaScript

Page 28: Web of Things - Connecting People and Objects on the Web

WoT@SXSW10

Clickscript

• Javascript-based visual mashup editor

• Firefox plugin/Web app• Based on DOJO/jQuery

www.clickscript.ch

Page 29: Web of Things - Connecting People and Objects on the Web

WoT@SXSW10

Clickscript component

csComponentContainer.push({ name : "cs.web.things.switch", description : "switch on or off", inputs : [{name: "IP",type: "cs.type.String"}, {name: "on/off",type: "cs.type.Boolean"}], outputs: [ ], image: "web/things/plogg.png", exec : function(state){ this.setAsync(); var ip = state.inputs.item(0).getValue(); var aurl = "http://"+ip+":8082/EnergieVisible/ploggs/008098e7cb71/status.html"; var onoff = state.inputs.item(1).getValue() ? "on" : "off"; var component = this;

Page 30: Web of Things - Connecting People and Objects on the Web

WoT@SXSW10

jQuery HTTP request

$.ajax({ url: aurl, type: "PUT", data: ({status : onoff}), success: function(html){ alert("status of Plogg : " +onoff); component.finishAsync(); }, error: function(msg){ alert("Error on: "+aurl); } });

Demo

Page 31: Web of Things - Connecting People and Objects on the Web

AdvancedWeb of Things

Page 32: Web of Things - Connecting People and Objects on the Web

Err, what about eventing & streaming ?The web wasn’t quite made for that...

And querying & search?

Page 33: Web of Things - Connecting People and Objects on the Web

WoT@SXSW10

Here comes Real-Time Web

• Scalable pub/sub for devices is needed• Many solutions (XMPP, etc....)

• None really integrate with the Web

• ATOM/ATOMpub is RESTful, but not push

• Push Web technologies • Apply Web PUSH on devices

• Comet & Web hooks

• Bi-directional Web messaging (Websockets)

Page 34: Web of Things - Connecting People and Objects on the Web

WoT@SXSW10

Device Discovery

• Devices serve semantic metadata: Microformats• Similar to headers metadata for Web robots

• Machine-readable user manual

• Human-readable documentation

• MF describe• Available resources and sub-resources

• Accepted methods and their input/output

• Keywords/tags

• Eventing, rules, channels

Page 35: Web of Things - Connecting People and Objects on the Web

WoT@SXSW10

<span class="service"> <span class="mftitle">Label: </span><span class="label"></span><br/> <span class="mftitle">Data Format: </span><span class="data-format">Integer</span><br/> <span class="mftitle">Operation: </span><span class="operation"><br/> <span class="mftitle">Method: </span><span class="method">POST</span><br/> <span class="mftitle">Address: </span><span class="address">http://spotmanager:8081/sunspots/Core2TestSpot/actuators/leds/led1</span><br/> <span class="mftitle">Input: </span><span class="input">Red</span><br/> <span class="mftitle">Output: </span><span class="output">The updated Resource</span><br/></span>

Page 36: Web of Things - Connecting People and Objects on the Web

Does that scale?

Page 37: Web of Things - Connecting People and Objects on the Web

WoT@SXSW10

Hierarchic gateways binding: InfraWoT

• Gateways find and integrate mf-enabled devices• Gateways bind to each other and form geographical

hierarchieshttp://europe.eu/switzerland/zurich/eth/building4

http://usa.com/texas/austin/sxsw/ballroom/e

• Based on OSGi and RESTlet

Page 38: Web of Things - Connecting People and Objects on the Web

WoT@SXSW10

DEMO - InfraWoT

Page 39: Web of Things - Connecting People and Objects on the Web

EnterpriseWeb of Things

Page 40: Web of Things - Connecting People and Objects on the Web

WoT@SXSW10

Browsable EPC Network

• Standards for Supply Chain Management

• EPC Network set of RFID standards

• Global (closed?) network• EPCIS is the information server• WS-* interface• RESTful EPCIS

Tag

Reader

EPCIS

EPCstandardized

identifiers

ReaderProtocolStandard

Page 41: Web of Things - Connecting People and Objects on the Web

WoT@SXSW10

RESTful EPCIS in a Nutshell

• On top of Fosstrak EPCIS• Based on Jersey• Apache Abdera for Feeds• Faster than the original EPCIS (Duh!)

Page 42: Web of Things - Connecting People and Objects on the Web

WoT@SXSW10

Widgets on top!

• Business intelligence dashboard

• Implemented in Javascript (GWT)

• Integrating loads of Web resources:

• Google Viz/Maps/Cal• Wikipedia

• Twitter, etc.

Demo

Page 43: Web of Things - Connecting People and Objects on the Web

WoT@SXSW10

Take home notes

• It’s time for devices to join the Web• Tradeoff features/performance• Huge opportunities for the Web of Things

• Tools & best practices for Web-enabled things are needed

• Web developers need to apply their skills to build a programmable world

Page 44: Web of Things - Connecting People and Objects on the Web

Thanks for your attention !ありがとうございました!

www.webofthings.com