SlideShare a Scribd company logo
1 of 94
Download to read offline
From the
Internet of
Things to the
Web of Things
Hello!
I am Dr. Dom Guinard
Co-invented the WoT, Co-Founded
EVRYTHNG & loves: Web technologies,
standards, startups, books and mountains!
@domguinard
2
If I tell you...
✗ NPM
✗ GPIOs
✗ PIR
✗ LPWAN
✗ MQTT
✗ WoT
✗ REST
✗ Websockets
✗ NodeRED
✗ IFTTT
✗ Ethereum
✗ Tensorflow
3
What’s in the course?
The IoT, the WoT
History, applications, ...
Getting started with
embedded devices
Sensors, actuators, devices, GPIOs,
...
The I in IoT
Networking layers and protocols,
Zigbee, Bluetooth, LPWAN, WiFi,
etc.
4
The W in IoT:
Web of Things!
Architecture, layers, API for Things
Layers of the WoT
Access, Find, Share, Compose
The Future of the IoT
From blockchain to AI and other
buzzwords & challenges ahead for
the IoT
The Web of Things Book!
Course largely based on the book
Books and kits options on:
http://book.webofthings.io
Use 39guinard
To get 39% discount on Manning
5
1. The IoT
“[...] the phrase "Internet of Things"
started life as the title of a
presentation I made at Procter &
Gamble (P&G) in 1999. Linking the
new idea of RFID in P&G's supply
chain to the then-red-hot topic of
the Internet [...]”
[@Kevin_Ashton]
7
8
9
1. (Unique) Identity
2. Connectivity to Internet
Protocols: directly or via a gateway
3. Sensing
4. and / or Actuation
Application Domains
Consumer IoT
Smart homes, quantified
self, wearables, consumer
marketing, assisted living,
etc.
Commercial IoT
Smart supply chains,
smart buildings,
connected medical
devices, connected cars,
etc.
Industrial IoT
Smart cities, smart grids,
Industry 4.0, smart
manufacturing
10
Examples @EVRYTHNG
11
More examples!
12
Remember IoT != smart home! @EVRYTHNG Examples
13
Lab: Setting up your Pi!
14
See also: Chapter 4, page 94
1. Install Etcher from https://etcher.io
2. Install your Pi:
https://webofthings.org/wot-book-pi-image/
2. Getting
started with
embedded
devices
16
VS
Multicores (ARM)
32-64 Bits
X GB of RAM
X GB of Flash
Microcontroller
8-16 Bits
X KB of RAM
X KB of ROM
17
18
Espruino
Edison
Tessle
Artik
Kinoma
Beaglebone
Raspberry Pi
(Pi Zero incl.)
19
Why JS & Node on embedded devices?
Lab 1: A Webserver on a Pi!
20
See also: Chapter 3 & Chapter 4, page 94
1. Connect your Pi to the network
a. ping raspberrypi.local and write
down your IP
2. Build your (first?) Node HTTP server on the Pi (page
64)
3. Bonus: Install NVM & Node.js on your computer
a. curl -o-
https://raw.githubusercontent.com/creationix/nvm
/v0.33.2/install.sh | bash
b. nvm install v4.9.1
4. Bonus: build a more advanced server, see Listing
3.2 page 66
Lab Notes: Headless setup
21
✗ Change MDNS hostname of your Pi:
✗ sudo nano /etc/hostname
✗ Headless SSH:
✗ Add: /boot/ssh
✗ Headless config of the wifi:
✗ Add: /boot/wpa_supplicant.conf
Some key points so far...
✗ IoT came from RFID in 1999
✗ The Things in the IoT typically have 4 properties:
✗ Identity
✗ Connectivity
✗ Sensing
✗ Actuating
✗ There are 2 world of embedded devices:
✗ Linux Devices (ARM, e.g., Pi)
✗ Microcontrollers (e.g., Marvell, TI)
✗ Javascript (Node) is taking over things for prototyping
22
3. Sensors &
Actuators
(via GPIOs)
24
1. Sensors:
a. Temperature / Humidity
b. PIR
2. Actuators:
a. LEDs
b. Screens
c. Relays (switches)
25
26
http://johnny-five.io
https://github.com/fivdi/onoff
https://github.com/intel-iot-devkit/mraa https://cylonjs.com/
http://ni-c.github.io/heimcontrol.js/
https://github.com/webofthings/webofthings.js
27
var Gpio = require('onoff').Gpio,
sensor = new Gpio(17, 'in', 'both'); //#A
sensor.watch(function (err, value) { //#B
if (err) exit(err);
console.log(value ? 'there is someone!' : 'not anymore!');
});
function exit(err) {
if (err) console.log('An error occurred: ' + err);
sensor.unexport();
console.log('Bye, bye!')
process.exit();
}
process.on('SIGINT', exit);
// #A Initialize pin 17 in input mode, 'both' means we want to handle both rising and falling interrupt edges
// #B Listen for state changes on pin 17, if a change is detected the anonymous callback function will be called with the
new value
28
Lab 2: GPIOs
29
See also: Chapter 4, from page 102
1. Setup the PIR sensor (see page 104)
2. Connect it to onoff.js code (see
chapter4-gpios/pir.js)
3. Bonus: setup the DHT sensor (see Chapter 4 from
page 105)
4. The I in IoT:
The Networks
Categories of protocols
PAN: Personal Area Net
WiFi, Zigbee, Enocean,
Thread, Bluetooth, etc.
Usually for consumer IoT:
Smart homes, smart
buildings, beacons, etc.
(LP)WAN: Low Power
Wide Area Net
SigFox, LoRA, 5G, NB-IoT,
CAT-M, etc.
Usually for industrial &
commercial IoT:
Smart cities, supply chain
tracking, smart meters,
etc.
31
32
Good reasons for no IP+Web end-to-end
Battery Powered Devices Deployment requires a mesh
33
34
The emergence of LPWANs
✗ New networks created for the IoT
✗ Smart meters, Supply chain
tracking
✗ LP = Low Power
✗ 3 big categories:
✗ SigFox (the first)
✗ LoRA (the more “open” - see
TheThingsNetwork)
✗ 5G IoT (the “operators”)
✗ CAT-M
✗ NB-IoT
35
Demo: LPWAN & TTN
36
✗ Using a TTN Node
✗ Communicating with EVRYTHNG
Some key points so far...
✗ Sensors and Actuators are integrated to IoT
prototypes (and products) via GPIOs
✗ There are a lot of networking technologies involved in
the IoT. In particular because of the energy
consumption of WiFi and need for mesh.
✗ Very low-power protocols are emerging (LPWAN)
37
5. The W in IoT:
The Web of
Things
“The IoT is a science primarily
focusing on creating the
most complex ways of
turning lights on.”
[@domguinard]
39
40
+
Pre IoT
41
+
Post IoT
42
Enters the Web of Things!
43
Great but it was 2007...
“The Web on Devices? Yeah,
sure… NOT!”
[@theEmbeddedCommunity,
2007]
44
45
46
And then… it clicked :)
47
5.1 Access:
The API of
Things
Dom Guinard
CTO & Co-founder
51
$(document).ready( //#A
function doPoll() {
$.getJSON('http://devices.webofthings.io/pi/sensors/temperature', //#B
function (data) { //#C
console.log(data);
$('#temp').html(data.value + ' ' + data.unit); //#D
setTimeout(doPoll, 5000); //#E
});
});
//#A Wait until the page is loaded and then call doPoll()
//#B Use the AJAX helper to get the JSON payload from the temperature sensor
//#C When the response arrives, this function is called
//#D Select the "temp" HTML element and update its content using the data.value (the value) and data.unit
(the unit) returned in the JSON payload
//#E The doPoll() function sets a timer to call itself again in 5 seconds (5000 milliseconds)
Lab 3: Talking Web to a Thing!
52
✗ Fork & Clone the book code on your machine
✗ git clone https://github.com/webofthings/wot-book
--recursive
✗ Browse the device as a Human on:
http://devices.webofthings.io/
✗ Install Postman and browse the device as an App
✗ URL: http://devices.webofthings.io/
✗ Accept: application/json
✗ Modify 2.2 code to get the humidity value every 5
seconds
✗ Bonus: change the type of graph in 2.2
Web API for Things: 5 Steps
A. Resource design—Identify the functionality or services
of a Thing, and organize the hierarchy of these services.
B. Representation design—Decide which representations
will be served for each resource.
C. Interface design—Decide which commands are possible for
each service, along with which error codes.
D. Resource linking design—Decide how the different
resources are linked to each other.
E. Integration strategy—Choose a pattern to integrate
Things to the internet and the web.
53
Resources,
Representations
& Links
55
Request:
GET /pi
Host:
devices.webofthings.io
Accept: application/json
Response:
200 OK
Content-Type:
application/json
{
"name" : "Pi"
...
} 1. Resource design
2. Representation design
3. Interface design
GET
PUT
4. Linking
Design
56
Resources on the WoT Pi
57
Beyond HTTP: Websocket for events
58
function subscribeToWs(url, msg) {
var socket = new WebSocket(url);
socket.onmessage = function (event) {
console.log(event.data);
};
socket.onerror = function (error) {
console.log('An error occurred while trying to connect to a Websocket!');
console.log(error);
};
socket.onopen = function (event) {
if (msg) {
socket.send(msg);
}
};
}
//subscribeToWs('ws://localhost:8484/pi/sensors/pir);
59
Software architecture on the WoT Pi
Lab 4: Designing the Pi API
60
✗ See also: Chapter 7
✗ Code deep-dive together
✗ chapter7-implementation/part1-2-direct-gateway
✗ Resources (add a noise sensor)
✗ Representation (see messagepack)
✗ Adding a representation
✗ Add CBOR support
✗ npm install --save cbor
✗ In converter.js
✗ Bind PIR sensor on your Pi
✗ Communication via WebSocket
✗ chapter2-hello-wot/client/pir-websockets.html
✗ Bonus: bind the DHT sensor of your Pi (see page 183)
Step 5:
Integration
Strategy
62
The Web on Devices!
63
But not all things can speak Web!
64
An Example with the EVRYTHNG Platform
65
The Web on Devices!
66
The Web on Devices!
Lab 5: Gateways
67
✗ See also: Chapter 7, page 195
✗ CoAP
✗ Start the CoAP server
✗ Look into the plugin
✗ Request a CoAP resource via HTTP:
✗ /things/coapDevice/sensors/co2
✗ EVRYTHNG Demo
✗ Bonus: connect your PIR sensor to EVRYTHNG
5.2 Find:
The Findability
of Things
70
The issues with Finding Things!
3 Challenges in IoT Findability
What’s the Bootstrap
URL?
mDNS
What’s the format I should
expect (syntax)?
REST, JSON, WoT Model
What does that mean
(semantics)?
W3C WoT, Schema.org
IoT
71
How to find the URL of a Thing? mDNS!
service up: {
interfaceIndex: 4,
type:
{ name: 'http',
protocol: 'tcp',
subtypes: [],
fullyQualified: true },
replyDomain: 'local.',
flags: 3,
name: 'Brother MFC-8520DN',
networkInterface: 'en0',
fullname:
'Brother032MFC-8520DN._http._tc
p.local.',
host: 'EVT-BW-BROTHER.local', The
service
port: 80, local IP address
addresses: [ '192.168.0.6' ]
}
72
✗ mDNS clients listen for mDNS
messages (on UDP)
✗ DNS tables are populated from
what they catch
✗ Your Pi broadcasts mDNS
messages as we speak!
73
http://model.webofthings.io
http://gateway.webofthings.io
74
The issues with Finding Things!
75
The Web Thing Model in a Nutshell
The WoT Model Continues @ W3C
{
"@context": ["http://www.w3.org/ns/td",
{"iot": "http://iotschema.org/"}],
"@type" : "Thing",
"id": "urn:dev:wot:com:example:servient:lamp",
...
"security": [{"scheme": "psk"}],
"properties": {
"status": {
"@type" : "iot:SwitchStatus",
"description" : "Shows the current status of the
lamp",
"writable": false,
"observable": false,
…
"actions": {
"toggle": {
"@type" : "iot:SwitchStatus",
"description" : "Turn on or off the lamp",
"forms": [{
"href": "coaps://mylamp.example.com/toggle",
"mediaType": "application/json"
76
✗ Model:
✗ Things
✗ Properties
✗ Actions
✗ Events
✗ Extensible via
SemanticWeb
✗ https://schema.org
https://w3c.github.io/wot-thing-description/
Lab 6: Semantic Web of Things
77
✗ See also: Chapter 8
✗ Experiment with the Web Thing Model in Action:
Automatic UI generation, use
✗ Use the wot.js server in chapter8-semantics
✗ http://IP:8484/model
✗ Test the client:
chapter10-mashups/UI/UI.html
✗ Bonus:
✗ Bind an LED on your Pi to react to Actions
✗ Play Mozilla Things Project, a modern
implementation of the Web Thing Model
5.3 Secure &
Share
Basic Principles of IoT Security
Over the air
updates
TLS
Communication
Device
Authentication
80
Securing Things (over simplified!)
81
✗ Problem 1:
✗ TLS Web Encryption
✗ Problem 2:
✗ SSL (TLS) certificates
✗ Problem 3:
✗ API keys (oAuth)
✗ TLS certificates on device
82
Sharing in the Web of Things!
Lab 7: Secure & Share Things
83
✗ See also: Chapter 9
✗ Securing our server
✗ Encryption:
✗ openssl req -sha256 -newkey rsa:4096
-keyout privateKey.pem -out caCert.pem
-days 1095 -x509
✗ Try: https://localhost:8484/pi/
✗ Secure proxy with Ngrok:
✗ Put your Pi on the Web with Ngrok
✗ wget
https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stabl
e-linux-arm.zip
✗ ./ngrok http 8484
✗ Bonus:
✗ Test the social WoT proxy (from page 260)
5.4 Compose:
Physical Mashups
86
Mashup for Things - Node-RED
87
IFTTT: Wizard based mashups
Lab 8: Composing Things
88
✗ See also: Chapter 10
✗ Create an IFTTT mashup that
✗ Sends a turn LED on Action to your WoT Pi
✗ Connect our PIR sensor to Node-RED (see page 293)
✗ Launch the unsecure version (chapter 8)
✗ Node-red
✗ Connect to:
ws://IP:8484/properties/pir
✗ Bonus:
✗ Implement the full Node-RED mashup (see page
292)
✗ Try the full JS mashup of chapter 2:
ex-5-mashup.html
Links
✗ Web of Things Community
✗ WoT @ W3C and WoT W3C Architecture
✗ Mozilla WoT
89
6. The Future of
Things
IoT’s challenges & the Future!
1. Interoperability
✗ The (semantic) Web can help!
2. Scalability
✗ Decentralization will be key (blockchain)
✗ Dealing with the data overload (machine learning)
3. Privacy
✗ GDPR, Data marketplace
4. Security
✗ Use Web security, prepare for Quantum computing!
5. Durability
✗ Regulation, IoT Mark
6. Usability
✗ The disappearing computer
91
Key takeaways
✗ The IoT is here and now, 20 billion connected objects
expected to join by 2022, enormous opportunity
but significant challenges
✗ Networks are evolving to support the special needs
of Things
✗ Interoperability is key, the Web can help at many levels
92
93
Thanks!
You can find me at:
✗ @domguinard
✗ dom@guinard.org
✗ http://dom.guinard.org
✗ https://webofthings.org
SlidesCarnival icons are editable shapes.
This means that you can:
● Resize them without losing quality.
● Change fill color and opacity.
Isn’t that nice? :)
Examples:
94

More Related Content

What's hot

Cut the Gordian Knot - The QIVICON Ecosystem for Smarthome - Jochen Hiller,Ca...
Cut the Gordian Knot - The QIVICON Ecosystem for Smarthome - Jochen Hiller,Ca...Cut the Gordian Knot - The QIVICON Ecosystem for Smarthome - Jochen Hiller,Ca...
Cut the Gordian Knot - The QIVICON Ecosystem for Smarthome - Jochen Hiller,Ca...
mfrancis
 
Webinar WebRTC HTML5 (english)
Webinar WebRTC HTML5 (english)Webinar WebRTC HTML5 (english)
Webinar WebRTC HTML5 (english)
Quobis
 

What's hot (20)

AllSeen Alliance Overview
AllSeen Alliance OverviewAllSeen Alliance Overview
AllSeen Alliance Overview
 
Outlook on mobile web standardization(MobileOK)
Outlook on mobile web standardization(MobileOK)Outlook on mobile web standardization(MobileOK)
Outlook on mobile web standardization(MobileOK)
 
Catching the Internet of Things (IoT) Wave
Catching the Internet of Things (IoT) WaveCatching the Internet of Things (IoT) Wave
Catching the Internet of Things (IoT) Wave
 
Kalay Platform Enhancing Multimedia on AllJoyn Devices
Kalay Platform Enhancing Multimedia on AllJoyn DevicesKalay Platform Enhancing Multimedia on AllJoyn Devices
Kalay Platform Enhancing Multimedia on AllJoyn Devices
 
Open Source IoT at Eclipse
Open Source IoT at EclipseOpen Source IoT at Eclipse
Open Source IoT at Eclipse
 
2014 Webrtc Summit & Cloud Expo, RealTime Interactions for IoT
2014 Webrtc Summit & Cloud Expo, RealTime Interactions for IoT2014 Webrtc Summit & Cloud Expo, RealTime Interactions for IoT
2014 Webrtc Summit & Cloud Expo, RealTime Interactions for IoT
 
Building the world’s biggest iBeacon living lab with WSO2
Building the world’s biggest iBeacon living lab with WSO2Building the world’s biggest iBeacon living lab with WSO2
Building the world’s biggest iBeacon living lab with WSO2
 
Twilio Signal 2016 Leading An Open Hardware Revolution
Twilio Signal 2016 Leading An Open Hardware RevolutionTwilio Signal 2016 Leading An Open Hardware Revolution
Twilio Signal 2016 Leading An Open Hardware Revolution
 
Cut the Gordian Knot - The QIVICON Ecosystem for Smarthome - Jochen Hiller,Ca...
Cut the Gordian Knot - The QIVICON Ecosystem for Smarthome - Jochen Hiller,Ca...Cut the Gordian Knot - The QIVICON Ecosystem for Smarthome - Jochen Hiller,Ca...
Cut the Gordian Knot - The QIVICON Ecosystem for Smarthome - Jochen Hiller,Ca...
 
Introduction to the AllJoyn Gateway Agent
Introduction to the AllJoyn Gateway Agent Introduction to the AllJoyn Gateway Agent
Introduction to the AllJoyn Gateway Agent
 
Far South Networks Vision
Far South Networks VisionFar South Networks Vision
Far South Networks Vision
 
The Social Home
The Social HomeThe Social Home
The Social Home
 
Mikael Falkvidd IoT - Stena AB Faster Forward
Mikael Falkvidd IoT - Stena AB Faster ForwardMikael Falkvidd IoT - Stena AB Faster Forward
Mikael Falkvidd IoT - Stena AB Faster Forward
 
Zig bee
Zig beeZig bee
Zig bee
 
Devoxx 2014 presentation
Devoxx 2014 presentationDevoxx 2014 presentation
Devoxx 2014 presentation
 
Raspberry Pi as IoT gateway
Raspberry Pi  as IoT gatewayRaspberry Pi  as IoT gateway
Raspberry Pi as IoT gateway
 
2449 rapid prototyping of innovative io t solutions
2449   rapid prototyping of innovative io t solutions2449   rapid prototyping of innovative io t solutions
2449 rapid prototyping of innovative io t solutions
 
FIWARE at LeWeb - Agenda
FIWARE at LeWeb - AgendaFIWARE at LeWeb - Agenda
FIWARE at LeWeb - Agenda
 
Open Source IoT Project Flogo - Building a Custom Apache Kafka Connector
Open Source IoT Project Flogo - Building a Custom Apache Kafka ConnectorOpen Source IoT Project Flogo - Building a Custom Apache Kafka Connector
Open Source IoT Project Flogo - Building a Custom Apache Kafka Connector
 
Webinar WebRTC HTML5 (english)
Webinar WebRTC HTML5 (english)Webinar WebRTC HTML5 (english)
Webinar WebRTC HTML5 (english)
 

Similar to From the internet of things to the web of things course

Similar to From the internet of things to the web of things course (20)

Raspberry pi and Azure
Raspberry pi and AzureRaspberry pi and Azure
Raspberry pi and Azure
 
Eclipse Kura Shoot a-pi
Eclipse Kura Shoot a-piEclipse Kura Shoot a-pi
Eclipse Kura Shoot a-pi
 
Raspbeery PI IoT
Raspbeery PI IoTRaspbeery PI IoT
Raspbeery PI IoT
 
IoT Workshop in Macao
IoT Workshop in MacaoIoT Workshop in Macao
IoT Workshop in Macao
 
IoT Workshop in Macao
IoT Workshop in MacaoIoT Workshop in Macao
IoT Workshop in Macao
 
Prototyping products for the Internet of Things using JavaScript
Prototyping products for the Internet of Things using JavaScriptPrototyping products for the Internet of Things using JavaScript
Prototyping products for the Internet of Things using JavaScript
 
FIWARE IoT Proposal & Community
FIWARE IoT Proposal & CommunityFIWARE IoT Proposal & Community
FIWARE IoT Proposal & Community
 
Internet of things the salesforce lego machine cloud
Internet of things   the salesforce lego machine cloudInternet of things   the salesforce lego machine cloud
Internet of things the salesforce lego machine cloud
 
mozilla-things-fosdem-2019
mozilla-things-fosdem-2019mozilla-things-fosdem-2019
mozilla-things-fosdem-2019
 
Python for IoT, A return of experience
Python for IoT, A return of experiencePython for IoT, A return of experience
Python for IoT, A return of experience
 
Using Python for IoT: a return of experience, Alexandre Abadie
Using Python for IoT: a return of experience, Alexandre AbadieUsing Python for IoT: a return of experience, Alexandre Abadie
Using Python for IoT: a return of experience, Alexandre Abadie
 
[Call for code] IBM 블록체인을 활용하여 투명하게 구호기금 관리하기 - Hyperledger Fabric v1.1 by 맹개발
[Call for code] IBM 블록체인을 활용하여 투명하게 구호기금 관리하기 - Hyperledger Fabric v1.1 by 맹개발 [Call for code] IBM 블록체인을 활용하여 투명하게 구호기금 관리하기 - Hyperledger Fabric v1.1 by 맹개발
[Call for code] IBM 블록체인을 활용하여 투명하게 구호기금 관리하기 - Hyperledger Fabric v1.1 by 맹개발
 
IoT: Internet of Things with Python
IoT: Internet of Things with PythonIoT: Internet of Things with Python
IoT: Internet of Things with Python
 
IoT-javascript-2019-fosdem
IoT-javascript-2019-fosdemIoT-javascript-2019-fosdem
IoT-javascript-2019-fosdem
 
FIWARE Primer - Learn FIWARE in 60 Minutes
FIWARE Primer - Learn FIWARE in 60 MinutesFIWARE Primer - Learn FIWARE in 60 Minutes
FIWARE Primer - Learn FIWARE in 60 Minutes
 
Federico Michele Facca - FIWARE Primer - Learn FIWARE in 60 Minutes
Federico Michele Facca - FIWARE Primer - Learn FIWARE in 60 MinutesFederico Michele Facca - FIWARE Primer - Learn FIWARE in 60 Minutes
Federico Michele Facca - FIWARE Primer - Learn FIWARE in 60 Minutes
 
The Considerations for Internet of Things @ 2017
The Considerations for Internet of Things @ 2017The Considerations for Internet of Things @ 2017
The Considerations for Internet of Things @ 2017
 
Devoxx 2015 - Building the Internet of Things with Eclipse IoT
Devoxx 2015 - Building the Internet of Things with Eclipse IoTDevoxx 2015 - Building the Internet of Things with Eclipse IoT
Devoxx 2015 - Building the Internet of Things with Eclipse IoT
 
End-to-end IoT solutions with Java and Eclipse IoT
End-to-end IoT solutions with Java and Eclipse IoTEnd-to-end IoT solutions with Java and Eclipse IoT
End-to-end IoT solutions with Java and Eclipse IoT
 
Enhancing drone application development using python and dronekit
Enhancing drone application development using python and dronekitEnhancing drone application development using python and dronekit
Enhancing drone application development using python and dronekit
 

More from Dominique Guinard

Activity Digital Identities in the Web of Things
Activity Digital Identities in the Web of ThingsActivity Digital Identities in the Web of Things
Activity Digital Identities in the Web of Things
Dominique Guinard
 
Comparing SOAs for the Internet of Things
Comparing SOAs for the Internet of ThingsComparing SOAs for the Internet of Things
Comparing SOAs for the Internet of Things
Dominique Guinard
 

More from Dominique Guinard (20)

1 billion thngs at a time
1 billion thngs at a time1 billion thngs at a time
1 billion thngs at a time
 
5 Years of Web of Things Workshops
5 Years of Web of Things Workshops5 Years of Web of Things Workshops
5 Years of Web of Things Workshops
 
The Art of API Crafting for the IoT
The Art of API Crafting for the IoTThe Art of API Crafting for the IoT
The Art of API Crafting for the IoT
 
Dumb Products can be Smart Too!
Dumb Products can be Smart Too!Dumb Products can be Smart Too!
Dumb Products can be Smart Too!
 
3 Cups of Java Drivers with a Slice of MongoDB
3 Cups of Java Drivers with a Slice of MongoDB3 Cups of Java Drivers with a Slice of MongoDB
3 Cups of Java Drivers with a Slice of MongoDB
 
If Spock had an Android phone: QRs, 1D, NFC, BLE, Arduinos & the Web of Things
If Spock had an Android phone: QRs, 1D, NFC, BLE, Arduinos & the Web of ThingsIf Spock had an Android phone: QRs, 1D, NFC, BLE, Arduinos & the Web of Things
If Spock had an Android phone: QRs, 1D, NFC, BLE, Arduinos & the Web of Things
 
Business Aspects of the IoT: Making Products Smart
Business Aspects of the IoT: Making Products SmartBusiness Aspects of the IoT: Making Products Smart
Business Aspects of the IoT: Making Products Smart
 
Android and the Web of Things: NFC, QR, BLE, Bluetooth, EPC, Arduino
Android and the Web of Things: NFC, QR, BLE, Bluetooth, EPC, ArduinoAndroid and the Web of Things: NFC, QR, BLE, Bluetooth, EPC, Arduino
Android and the Web of Things: NFC, QR, BLE, Bluetooth, EPC, Arduino
 
Evrythng @ Web of Things
Evrythng @ Web of ThingsEvrythng @ Web of Things
Evrythng @ Web of Things
 
Activity Digital Identities in the Web of Things
Activity Digital Identities in the Web of ThingsActivity Digital Identities in the Web of Things
Activity Digital Identities in the Web of Things
 
A Universal Application Platform for Sensors, RFID, NFC and Embedded Devices
A Universal Application Platform for Sensors, RFID, NFC and Embedded DevicesA Universal Application Platform for Sensors, RFID, NFC and Embedded Devices
A Universal Application Platform for Sensors, RFID, NFC and Embedded Devices
 
Tourism and the Web of Things
Tourism and the Web of ThingsTourism and the Web of Things
Tourism and the Web of Things
 
Web of Things Application Architecture
Web of Things Application ArchitectureWeb of Things Application Architecture
Web of Things Application Architecture
 
HTML5, Websockets & the Mobile Web
HTML5, Websockets & the Mobile WebHTML5, Websockets & the Mobile Web
HTML5, Websockets & the Mobile Web
 
Cloud Computing, REST and Mashups to Simplify RFID Application Development an...
Cloud Computing, REST and Mashups to Simplify RFID Application Development an...Cloud Computing, REST and Mashups to Simplify RFID Application Development an...
Cloud Computing, REST and Mashups to Simplify RFID Application Development an...
 
Comparing SOAs for the Internet of Things
Comparing SOAs for the Internet of ThingsComparing SOAs for the Internet of Things
Comparing SOAs for the Internet of Things
 
WoT Tutorial @ Cisco
WoT Tutorial @ CiscoWoT Tutorial @ Cisco
WoT Tutorial @ Cisco
 
EPC Cloud: Using the Web to Simplify the Global RFID Network
EPC Cloud: Using the Web to Simplify the Global RFID NetworkEPC Cloud: Using the Web to Simplify the Global RFID Network
EPC Cloud: Using the Web to Simplify the Global RFID Network
 
WoT @ Oracle-Labs
WoT @ Oracle-LabsWoT @ Oracle-Labs
WoT @ Oracle-Labs
 
Giving RFID a REST: Web-enabled EPCIS
Giving RFID a REST: Web-enabled EPCISGiving RFID a REST: Web-enabled EPCIS
Giving RFID a REST: Web-enabled EPCIS
 

Recently uploaded

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Recently uploaded (20)

Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 

From the internet of things to the web of things course

  • 1. From the Internet of Things to the Web of Things
  • 2. Hello! I am Dr. Dom Guinard Co-invented the WoT, Co-Founded EVRYTHNG & loves: Web technologies, standards, startups, books and mountains! @domguinard 2
  • 3. If I tell you... ✗ NPM ✗ GPIOs ✗ PIR ✗ LPWAN ✗ MQTT ✗ WoT ✗ REST ✗ Websockets ✗ NodeRED ✗ IFTTT ✗ Ethereum ✗ Tensorflow 3
  • 4. What’s in the course? The IoT, the WoT History, applications, ... Getting started with embedded devices Sensors, actuators, devices, GPIOs, ... The I in IoT Networking layers and protocols, Zigbee, Bluetooth, LPWAN, WiFi, etc. 4 The W in IoT: Web of Things! Architecture, layers, API for Things Layers of the WoT Access, Find, Share, Compose The Future of the IoT From blockchain to AI and other buzzwords & challenges ahead for the IoT
  • 5. The Web of Things Book! Course largely based on the book Books and kits options on: http://book.webofthings.io Use 39guinard To get 39% discount on Manning 5
  • 7. “[...] the phrase "Internet of Things" started life as the title of a presentation I made at Procter & Gamble (P&G) in 1999. Linking the new idea of RFID in P&G's supply chain to the then-red-hot topic of the Internet [...]” [@Kevin_Ashton] 7
  • 8. 8
  • 9. 9 1. (Unique) Identity 2. Connectivity to Internet Protocols: directly or via a gateway 3. Sensing 4. and / or Actuation
  • 10. Application Domains Consumer IoT Smart homes, quantified self, wearables, consumer marketing, assisted living, etc. Commercial IoT Smart supply chains, smart buildings, connected medical devices, connected cars, etc. Industrial IoT Smart cities, smart grids, Industry 4.0, smart manufacturing 10
  • 13. Remember IoT != smart home! @EVRYTHNG Examples 13
  • 14. Lab: Setting up your Pi! 14 See also: Chapter 4, page 94 1. Install Etcher from https://etcher.io 2. Install your Pi: https://webofthings.org/wot-book-pi-image/
  • 16. 16 VS Multicores (ARM) 32-64 Bits X GB of RAM X GB of Flash Microcontroller 8-16 Bits X KB of RAM X KB of ROM
  • 17. 17
  • 19. 19 Why JS & Node on embedded devices?
  • 20. Lab 1: A Webserver on a Pi! 20 See also: Chapter 3 & Chapter 4, page 94 1. Connect your Pi to the network a. ping raspberrypi.local and write down your IP 2. Build your (first?) Node HTTP server on the Pi (page 64) 3. Bonus: Install NVM & Node.js on your computer a. curl -o- https://raw.githubusercontent.com/creationix/nvm /v0.33.2/install.sh | bash b. nvm install v4.9.1 4. Bonus: build a more advanced server, see Listing 3.2 page 66
  • 21. Lab Notes: Headless setup 21 ✗ Change MDNS hostname of your Pi: ✗ sudo nano /etc/hostname ✗ Headless SSH: ✗ Add: /boot/ssh ✗ Headless config of the wifi: ✗ Add: /boot/wpa_supplicant.conf
  • 22. Some key points so far... ✗ IoT came from RFID in 1999 ✗ The Things in the IoT typically have 4 properties: ✗ Identity ✗ Connectivity ✗ Sensing ✗ Actuating ✗ There are 2 world of embedded devices: ✗ Linux Devices (ARM, e.g., Pi) ✗ Microcontrollers (e.g., Marvell, TI) ✗ Javascript (Node) is taking over things for prototyping 22
  • 24. 24 1. Sensors: a. Temperature / Humidity b. PIR 2. Actuators: a. LEDs b. Screens c. Relays (switches)
  • 25. 25
  • 27. 27 var Gpio = require('onoff').Gpio, sensor = new Gpio(17, 'in', 'both'); //#A sensor.watch(function (err, value) { //#B if (err) exit(err); console.log(value ? 'there is someone!' : 'not anymore!'); }); function exit(err) { if (err) console.log('An error occurred: ' + err); sensor.unexport(); console.log('Bye, bye!') process.exit(); } process.on('SIGINT', exit); // #A Initialize pin 17 in input mode, 'both' means we want to handle both rising and falling interrupt edges // #B Listen for state changes on pin 17, if a change is detected the anonymous callback function will be called with the new value
  • 28. 28
  • 29. Lab 2: GPIOs 29 See also: Chapter 4, from page 102 1. Setup the PIR sensor (see page 104) 2. Connect it to onoff.js code (see chapter4-gpios/pir.js) 3. Bonus: setup the DHT sensor (see Chapter 4 from page 105)
  • 30. 4. The I in IoT: The Networks
  • 31. Categories of protocols PAN: Personal Area Net WiFi, Zigbee, Enocean, Thread, Bluetooth, etc. Usually for consumer IoT: Smart homes, smart buildings, beacons, etc. (LP)WAN: Low Power Wide Area Net SigFox, LoRA, 5G, NB-IoT, CAT-M, etc. Usually for industrial & commercial IoT: Smart cities, supply chain tracking, smart meters, etc. 31
  • 32. 32 Good reasons for no IP+Web end-to-end Battery Powered Devices Deployment requires a mesh
  • 33. 33
  • 34. 34
  • 35. The emergence of LPWANs ✗ New networks created for the IoT ✗ Smart meters, Supply chain tracking ✗ LP = Low Power ✗ 3 big categories: ✗ SigFox (the first) ✗ LoRA (the more “open” - see TheThingsNetwork) ✗ 5G IoT (the “operators”) ✗ CAT-M ✗ NB-IoT 35
  • 36. Demo: LPWAN & TTN 36 ✗ Using a TTN Node ✗ Communicating with EVRYTHNG
  • 37. Some key points so far... ✗ Sensors and Actuators are integrated to IoT prototypes (and products) via GPIOs ✗ There are a lot of networking technologies involved in the IoT. In particular because of the energy consumption of WiFi and need for mesh. ✗ Very low-power protocols are emerging (LPWAN) 37
  • 38. 5. The W in IoT: The Web of Things
  • 39. “The IoT is a science primarily focusing on creating the most complex ways of turning lights on.” [@domguinard] 39
  • 42. 42 Enters the Web of Things!
  • 43. 43 Great but it was 2007...
  • 44. “The Web on Devices? Yeah, sure… NOT!” [@theEmbeddedCommunity, 2007] 44
  • 45. 45
  • 46. 46 And then… it clicked :)
  • 47. 47
  • 48. 5.1 Access: The API of Things
  • 49.
  • 50. Dom Guinard CTO & Co-founder
  • 51. 51 $(document).ready( //#A function doPoll() { $.getJSON('http://devices.webofthings.io/pi/sensors/temperature', //#B function (data) { //#C console.log(data); $('#temp').html(data.value + ' ' + data.unit); //#D setTimeout(doPoll, 5000); //#E }); }); //#A Wait until the page is loaded and then call doPoll() //#B Use the AJAX helper to get the JSON payload from the temperature sensor //#C When the response arrives, this function is called //#D Select the "temp" HTML element and update its content using the data.value (the value) and data.unit (the unit) returned in the JSON payload //#E The doPoll() function sets a timer to call itself again in 5 seconds (5000 milliseconds)
  • 52. Lab 3: Talking Web to a Thing! 52 ✗ Fork & Clone the book code on your machine ✗ git clone https://github.com/webofthings/wot-book --recursive ✗ Browse the device as a Human on: http://devices.webofthings.io/ ✗ Install Postman and browse the device as an App ✗ URL: http://devices.webofthings.io/ ✗ Accept: application/json ✗ Modify 2.2 code to get the humidity value every 5 seconds ✗ Bonus: change the type of graph in 2.2
  • 53. Web API for Things: 5 Steps A. Resource design—Identify the functionality or services of a Thing, and organize the hierarchy of these services. B. Representation design—Decide which representations will be served for each resource. C. Interface design—Decide which commands are possible for each service, along with which error codes. D. Resource linking design—Decide how the different resources are linked to each other. E. Integration strategy—Choose a pattern to integrate Things to the internet and the web. 53
  • 55. 55 Request: GET /pi Host: devices.webofthings.io Accept: application/json Response: 200 OK Content-Type: application/json { "name" : "Pi" ... } 1. Resource design 2. Representation design 3. Interface design GET PUT 4. Linking Design
  • 58. 58 function subscribeToWs(url, msg) { var socket = new WebSocket(url); socket.onmessage = function (event) { console.log(event.data); }; socket.onerror = function (error) { console.log('An error occurred while trying to connect to a Websocket!'); console.log(error); }; socket.onopen = function (event) { if (msg) { socket.send(msg); } }; } //subscribeToWs('ws://localhost:8484/pi/sensors/pir);
  • 60. Lab 4: Designing the Pi API 60 ✗ See also: Chapter 7 ✗ Code deep-dive together ✗ chapter7-implementation/part1-2-direct-gateway ✗ Resources (add a noise sensor) ✗ Representation (see messagepack) ✗ Adding a representation ✗ Add CBOR support ✗ npm install --save cbor ✗ In converter.js ✗ Bind PIR sensor on your Pi ✗ Communication via WebSocket ✗ chapter2-hello-wot/client/pir-websockets.html ✗ Bonus: bind the DHT sensor of your Pi (see page 183)
  • 62. 62 The Web on Devices!
  • 63. 63 But not all things can speak Web!
  • 64. 64 An Example with the EVRYTHNG Platform
  • 65. 65 The Web on Devices!
  • 66. 66 The Web on Devices!
  • 67. Lab 5: Gateways 67 ✗ See also: Chapter 7, page 195 ✗ CoAP ✗ Start the CoAP server ✗ Look into the plugin ✗ Request a CoAP resource via HTTP: ✗ /things/coapDevice/sensors/co2 ✗ EVRYTHNG Demo ✗ Bonus: connect your PIR sensor to EVRYTHNG
  • 69.
  • 70. 70 The issues with Finding Things!
  • 71. 3 Challenges in IoT Findability What’s the Bootstrap URL? mDNS What’s the format I should expect (syntax)? REST, JSON, WoT Model What does that mean (semantics)? W3C WoT, Schema.org IoT 71
  • 72. How to find the URL of a Thing? mDNS! service up: { interfaceIndex: 4, type: { name: 'http', protocol: 'tcp', subtypes: [], fullyQualified: true }, replyDomain: 'local.', flags: 3, name: 'Brother MFC-8520DN', networkInterface: 'en0', fullname: 'Brother032MFC-8520DN._http._tc p.local.', host: 'EVT-BW-BROTHER.local', The service port: 80, local IP address addresses: [ '192.168.0.6' ] } 72 ✗ mDNS clients listen for mDNS messages (on UDP) ✗ DNS tables are populated from what they catch ✗ Your Pi broadcasts mDNS messages as we speak!
  • 74. 74 The issues with Finding Things!
  • 75. 75 The Web Thing Model in a Nutshell
  • 76. The WoT Model Continues @ W3C { "@context": ["http://www.w3.org/ns/td", {"iot": "http://iotschema.org/"}], "@type" : "Thing", "id": "urn:dev:wot:com:example:servient:lamp", ... "security": [{"scheme": "psk"}], "properties": { "status": { "@type" : "iot:SwitchStatus", "description" : "Shows the current status of the lamp", "writable": false, "observable": false, … "actions": { "toggle": { "@type" : "iot:SwitchStatus", "description" : "Turn on or off the lamp", "forms": [{ "href": "coaps://mylamp.example.com/toggle", "mediaType": "application/json" 76 ✗ Model: ✗ Things ✗ Properties ✗ Actions ✗ Events ✗ Extensible via SemanticWeb ✗ https://schema.org https://w3c.github.io/wot-thing-description/
  • 77. Lab 6: Semantic Web of Things 77 ✗ See also: Chapter 8 ✗ Experiment with the Web Thing Model in Action: Automatic UI generation, use ✗ Use the wot.js server in chapter8-semantics ✗ http://IP:8484/model ✗ Test the client: chapter10-mashups/UI/UI.html ✗ Bonus: ✗ Bind an LED on your Pi to react to Actions ✗ Play Mozilla Things Project, a modern implementation of the Web Thing Model
  • 79.
  • 80. Basic Principles of IoT Security Over the air updates TLS Communication Device Authentication 80
  • 81. Securing Things (over simplified!) 81 ✗ Problem 1: ✗ TLS Web Encryption ✗ Problem 2: ✗ SSL (TLS) certificates ✗ Problem 3: ✗ API keys (oAuth) ✗ TLS certificates on device
  • 82. 82 Sharing in the Web of Things!
  • 83. Lab 7: Secure & Share Things 83 ✗ See also: Chapter 9 ✗ Securing our server ✗ Encryption: ✗ openssl req -sha256 -newkey rsa:4096 -keyout privateKey.pem -out caCert.pem -days 1095 -x509 ✗ Try: https://localhost:8484/pi/ ✗ Secure proxy with Ngrok: ✗ Put your Pi on the Web with Ngrok ✗ wget https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stabl e-linux-arm.zip ✗ ./ngrok http 8484 ✗ Bonus: ✗ Test the social WoT proxy (from page 260)
  • 85.
  • 86. 86 Mashup for Things - Node-RED
  • 88. Lab 8: Composing Things 88 ✗ See also: Chapter 10 ✗ Create an IFTTT mashup that ✗ Sends a turn LED on Action to your WoT Pi ✗ Connect our PIR sensor to Node-RED (see page 293) ✗ Launch the unsecure version (chapter 8) ✗ Node-red ✗ Connect to: ws://IP:8484/properties/pir ✗ Bonus: ✗ Implement the full Node-RED mashup (see page 292) ✗ Try the full JS mashup of chapter 2: ex-5-mashup.html
  • 89. Links ✗ Web of Things Community ✗ WoT @ W3C and WoT W3C Architecture ✗ Mozilla WoT 89
  • 90. 6. The Future of Things
  • 91. IoT’s challenges & the Future! 1. Interoperability ✗ The (semantic) Web can help! 2. Scalability ✗ Decentralization will be key (blockchain) ✗ Dealing with the data overload (machine learning) 3. Privacy ✗ GDPR, Data marketplace 4. Security ✗ Use Web security, prepare for Quantum computing! 5. Durability ✗ Regulation, IoT Mark 6. Usability ✗ The disappearing computer 91
  • 92. Key takeaways ✗ The IoT is here and now, 20 billion connected objects expected to join by 2022, enormous opportunity but significant challenges ✗ Networks are evolving to support the special needs of Things ✗ Interoperability is key, the Web can help at many levels 92
  • 93. 93 Thanks! You can find me at: ✗ @domguinard ✗ dom@guinard.org ✗ http://dom.guinard.org ✗ https://webofthings.org
  • 94. SlidesCarnival icons are editable shapes. This means that you can: ● Resize them without losing quality. ● Change fill color and opacity. Isn’t that nice? :) Examples: 94