Maker of Things - the open IoT cloud for makers chapter.
1. 2015.9.7
Taipei
Maker of Things
Open IoT Cloud for Makers
Innovation of Things
Mokoversity
姓名標示-非商
業性 4.0 國際
2. Lecturer
Jollen, Founder of WoT.City
!
Jollen is a passionate software
developer with a breadth of technical
experience with software
engineering, web technologies,
embedded systems, operating
systems and distributed systems.
!
Jollen specializes in open source
software business model and its
strategy planning. He is also the
founder of Mokoversity and WoT.City.
!
Please Email Jollen through
jollen@jollen.org
11. Web of Things
《ARM mbed Practice: RTOS, IoT Client & IoT Cloud》 Copyright (C) 2015 Moko365 Inc. 僅供 QUALCOMM 內部使⽤用.
12. the Web of Things reuses existing and well-known
Web standards[1][2] used in the programmable Web
(e.g., REST, HTTP, JSON), semantic Web (e.g., JSON-LD,
Microdata, etc.), the real-time Web (e.g., Websockets)
and the social Web (e.g., oauth or social networks).
!
—Wikipedia
Web of Things
《ARM mbed Practice: RTOS, IoT Client & IoT Cloud》 Copyright (C) 2015 Moko365 Inc. 僅供 QUALCOMM 內部使⽤用.
16. IoT WoT
連結⽅方式 Bluetooth HTTP
數據管理 Centerlized Decenterlized
Things Objects RESTful Objects
應⽤用開發模式 Native Web (SPA)
硬件概念 Sensor Device
Physical Web
(Sensor Fusion)
Figure: Thinking in WoT. Copyright (C) 2014 Mokoversity Inc.
IoT vs WoT: Methdology
17. IoT WoT
Connectivity Machine to Machine
LWM2M
Machine to Web
Networking TCP / UDP HTTP / REST / CoAP
Things Sensor Device RESTful Objects
Data Streaming Data Time-Series Data
Discover MQTT Publish / Subscribe
IoT vs WoT: Connectivity
22. ARM mbed
mbed OS
We are creating a modern full-stack operating
system that is designed specifically for ARM
Cortex®-M-based MCUs; the worlds leading 32-
bit microcontrollers that already sell in the
billions.
!
mbed Device Server
Analogous to a Web Server that accepts
connections from mobile phones or web browsers,
a Device Server handles the connections from IoT
devices.
!
mbed Tools
online compiler (Web IDE), SDK, HDK and etc.
23. mbed OS
mbed Device Server
mbed Tools
《ARM mbed Practice: RTOS, IoT Client & IoT Cloud》 Copyright (C) 2015 Moko365 Inc. 僅供 QUALCOMM 內部使⽤用.
29. mbed Threads
RAM
Flash
RW Data
ZI: Timer Stack
ZI: Idle Stack
ZI
Scheduler Stack
Main Thread Stack
Head
When you use the RTOS, before explicitly
initializing any additional thread, you will
have 4 separate stacks:
!
• The stack of the Main Thread (executing
the main function).
!
• The Idle Thread executed each time all
the other threads are waiting for external,
or scheduled events. This is particularly
useful to implement energy saving
strategies. (ie sleep).
!
• The Timer Thread that executes all the
time scheduled tasks (periodic and non
periodic).
!
• The stack of OS Scheduler itself (also
used by the ISRs).
30. mbed Timer
#include "mbed.h"
Timer t;
int main() {
t.start();
printf("Hello World!n");
t.stop();
printf("The time taken was %f secondsn", t.read());
}
See: https://developer.mbed.org/handbook/Timer
39. CoAP over UDP
UDP
IP
CoAP
WoT Server
IoT over the Web
Ethernet MAC
Ethernet PHY
Application
Transport
Network
Data Link
Physical
TLS (optional) Presentation / Session
41. HTTP over TCP
TCP
IP
HTTP 1.1/2.0
WoT Server
the Web
Ethernet MAC
Ethernet PHY
Application
Transport
Network
Data Link
Physical
TLS (optional) Presentation / Session
43. HTTP/1.1 over SPDY+TCP
TCP
IP
HTTP
WoT Server
the Web
Ethernet MAC
Ethernet PHY
Application
Transport
Network
Data Link
Physical
SPDY + TLS Presentation / Session
46. UDP + QUIC
IP
HTTP
WoT Server
IoT over the Web
Ethernet MAC
Ethernet PHY
Application
Transport
Network
Data Link
Physical
SPDY + QUIC Presentation / Session
HTTP over QUIC+UDP
UDP + QUIC
IP
HTTP
WoT Server
IoT over the Web
Ethernet MAC
Ethernet PHY
QUIC
48. IP
HTTP/2
WoT Server
IoT over the Web
Ethernet MAC
Ethernet PHY
Application
Transport
Network
Data Link
Physical
QUIC + UDP
Presentation / Session
HTTP/2 over QUIC
50. CoAP-HTTP
UDP
IP
CoAP
WoT Server
Ethernet MAC
Ethernet PHY
Application
Transport
Network
Data Link
Physical
TLS (optional) Presentation / Session
TCP
IP
HTTP
WoT Client
the Web
Ethernet MAC
Ethernet PHY
TLS (optional)
IoT over the Web
56. 6LoWPAN
IPv6 over Low power Wireless Personal
Area Networks.
For constrained IoT devices.
UDP
6LoWPAN
CoAP
EXI
TCP
IP
HTTP
HTML
the Web IoT + the Web
57. TCP/IP Protocol Stack
UDP
6LoWPAN (IPv6)
CoAP
WoT Application
TCP
IP
HTTP
HTML
the Web IoT + the Web
UDP
Ethernet MAC
Ethernet PHY
IEEE 802.15.4 MAC
IEEE 802.15.4 PHY
Application
Transport
Network
Data Link
Physical
58.
59. Source: http://coap.technology
REST model for small
devices
!
Like HTTP, CoAP is based on the wildly
successful REST model: Servers make
resources available under a URL, and
clients access these resources using
methods such as GET, PUT, POST, and
DELETE.
60. Source: http://coap.technology
Made for billions of
nodes
!
The Internet of Things will need billions of
nodes, many of which will need to be
inexpensive. CoAP has been designed to
work on microcontrollers with as low as 10
KiB of RAM and 100 KiB of code space (RFC
7228).
62. Source: http://coap.technology
ARM IoT Tutorial
https://www.youtube.com/watch?v=4bSr5x5gKvA
Ready for
integration
!
Since HTTP and CoAP share the REST
model, they can easily be connected using
application-agnostic cross-protocol
proxies. A Web client may not even notice
that it just accessed a sensor resource!
63. ARM mbed Priactice: CoAP
CoapPDU *pdu = new CoapPDU();
!
pdu->setType(CoapPDU::COAP_CONFIRMABLE);
pdu->setCode(CoapPDU::COAP_GET);
pdu->setToken((uint8_t*)"3210",4);
pdu->setMessageID(0x0005);
pdu->setURI((char*)"test",4);
!
// send packet
ret = send(sockfd,pdu->getPDUPointer(),pdu->getPDULength(),0);
66. Analogous to a Web Server that accepts connections from
mobile phones or web browsers, a Device Server handles
the connections from Internet of Things (IoT) devices.
A Device Server is a key enabler for cloud service providers, operators and
enterprises to access the IoT growth market with production deployments,
bringing end node devices in to the world of web services.
《ARM mbed Practice: RTOS, IoT Client & IoT Cloud》 Copyright (C) 2015 Moko365 Inc. 僅供 QUALCOMM 內部使⽤用.
72. IoT Device Mobile
HTTP 1.1/2.0
Streaming Data
Physical Object
Web
Frontend
Real-Time Data
Broker
ws://wot.city/object/jollenchen/sensor/dust/a
Device Server: WebSocket