Building the Web of Things: frameworks and tools for fast prototyping Web-based physical mashupsSketching in Hardware 2011Vlad Trifa & Dominique Guinard - ETH Zurich
Vlad Trifa - ETH Zurich - webofthings.comSketching in Hardware 2011
Context
2
■ Embedded computers, sensors, actuators are omnipresent■ Increasingly powerful CPU and bandwidth■ Tremendous benefits in ad-hoc connectivity
■ Challenges: incompatible protocols, functionalities, interfaces, etc.
Vlad Trifa - ETH Zurich - webofthings.comSketching in Hardware 2011
Context
2
■ Embedded computers, sensors, actuators are omnipresent■ Increasingly powerful CPU and bandwidth■ Tremendous benefits in ad-hoc connectivity
■ Challenges: incompatible protocols, functionalities, interfaces, etc.
How to combine heterogeneous, mobile devices to create
interactive, ad-hoc applications?
We need an universal protocol that is:
simple, lightweight, loosely-coupled, scalable, flexible
and hopefully... standard
Vlad Trifa - ETH Zurich - webofthings.comSketching in Hardware 2011
Sounds like the Web...
■ TCP/IP & Web granted, Wi-Fi routers ubiquitous■ Prototyping of simple Web apps: cheaper & faster■ Integrate real-world data on the Web■ Get features of the Web for free
Use Web standards to develop applications for networked devices - Web of Things(HTTP, HTML, XML, JSON, RSS, ATOM, MIME,...)
4
Vlad Trifa - ETH Zurich - webofthings.comSketching in Hardware 2011
Web-enabled Devices
■ Devices run Web server ■ services RESTful resources
■ URI for each component■ hierarchy
■ Uniform Interface■ HTTP verbs & codes
■ Representations■ HTML: humans■ JSON/XML/CSV: machines
■ Stateless (hateoas)
5
GET fire/alerts.xml
PUTtv/channel/4
GET fridge/food.html
Vlad Trifa - ETH Zurich - webofthings.comSketching in Hardware 2011
Gateways
6
Web HTTP
ZigBee
Bluetooth
X10
IEEE802.9
DPWS
HTTP
HTTP
Flickr
Gateway
DRV
1
DRV
2
...DT1
...DT2
device
services
device layer
control layer
presentation layer
REST
engine
HTTP
server
proxy application
user
services
application
services
templating
engine
messaging
services
device
drivers
device
threads pool
../devices/1
../devices/2
devices
DB
Vlad Trifa - ETH Zurich - webofthings.comSketching in Hardware 2011
Smart Gateway
7
0 50 100 150 200 250 300 350 4000
50
100
150
200
250
300
350R
esp
on
se t
ime
[m
s]
Request number
EmbeddedSynchronization
Vlad Trifa - ETH Zurich - webofthings.comSketching in Hardware 2011 8
distributedscalableinfrastructures
/ethz
../CNB
../CNB/FloorD
../southWing/D48.1
../CNB/FloorEvirt
ual g
atew
ays
(can
run
anyw
here
)ph
ysic
al g
atew
ays
(mus
t be
embo
died
)
../southWing/D48.2
../floorD/southWing
Vlad Trifa - ETH Zurich - webofthings.comSketching in Hardware 2011
InfraWoT - location-aware infrastructure for WoT
10
errr, what about eventing & streaming ?
the web wasn’t quite made for this...
Vlad Trifa - ETH Zurich - webofthings.comSketching in Hardware 2011
Web Streams
■ Sensor data represented as sequence of messages ■ Publish/subscribe paradigm
■ Web push via Real-time Web■ Web Hooks, WebSockets, Comet, XMPP, ATOM, etc.
■ Parameterized■ devices■ sensors■ filter data■ sampling frequency
■ Messaging: bi-directional glue between components
12
end-to-end applications framework for sensor data collection, processing, sharing, and storage
MCDCvarious data
acquisition protocols
1. raw
2. raw data
Client SC
QC
2'. processed
5. raw & processed
Client
3. raw 4. processed
Sensors 1. Device Connector
2. Messaging Connector
3. Query Connector
4. Storage Connector
Vlad Trifa - ETH Zurich - webofthings.comSketching in Hardware 2011
WISSPR - Web Infrastructure for Sensor Stream PRocessing
14
Vlad Trifa - ETH Zurich - webofthings.comSketching in Hardware 2011
Complete Request
15
POST streams/ HTTP/1.1Host: wisspr.net/Content-Type: application/x-www-form-urlencodedContent:devices=http://devices.wisspr.net/spot11 &data=temperature,light &frequency=2Hz &filter=light < 200 && temperature > 19 &wms.cbk=http://store.wisspr.net/stores/31
Vlad Trifa - ETH Zurich - webofthings.comSketching in Hardware 2011
ClickScript - Physical mashup editor
16
Try it!!webofthings.com/clickscript
Vlad Trifa - ETH Zurich - webofthings.comSketching in Hardware 2011
Conclusions
■ Huge opportunities ahead for WoT■ The Web of Things is hard because ■ People are good Web developers
XOR■ Good embedded systems developers
■ Tradeoff between performance and features■ Tools & best practices for Web-enabled things are needed■ Deployment support, runtime debugging, patterns & toolkits, etc.
■ Prototyping large-scale applications■ Stop talking, start hacking
17