Web servers for the Internet of Things

alexandruradovici 9,261 views 39 slides Jun 27, 2015
Slide 1
Slide 1 of 39
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26
Slide 27
27
Slide 28
28
Slide 29
29
Slide 30
30
Slide 31
31
Slide 32
32
Slide 33
33
Slide 34
34
Slide 35
35
Slide 36
36
Slide 37
37
Slide 38
38
Slide 39
39

About This Presentation

We servers for the Internet of things


Slide Content

Web servers for the Internet of Things Summer School

Outline Web server HTTP Gadgets IoT Webserver Web templates Web services Web socket Questions 2

Web server 3

What is a web server Software that implements HTTP/HTTPS Mainframes Computers Gadgets 4

Gadgets?! 5

What HTTP? Widely used Easy to implement Text based HTML Simple and flexible UI JavaScript runs in almost any browser Replace displays 6

UI Gadgets prefer HTML UI Accessible from the tablet Wireless “display” Web language Gadgets are using less displays Expensive Fixed Special software 7

HTTP 8

HTTP 9 Image from https ://www3.ntu.edu.sg/home/ ehchua /programming/ webprogramming / HTTP_Basics.html

HTTP Request Headers Method URL Query String Upload body Response Status Headers Data 10

Query http://address[:port] URL?querystring http://wyliodrin.cs.pub.ro/ projects?show =true Address? Port? URL? q uerystring ? 11

Query http://address[:port] URL?querystring http://wyliodrin.cs.pub.ro/ projects?show =true Address? w yliodrin.cs.pub.ro Port? 80 URL? /projects querystring ? show=true 12

Methods GET Request objects without sending data POST Modify objects with data that you are sending PUT Create new objects with data that your are sending DELETE Delete objects without sending data 13

HTTP 14 Image from https ://www3.ntu.edu.sg/home/ ehchua /programming/ webprogramming / HTTP_Basics.html

Gadgets 15

Webserver for the gadgets 16

Web Web request Starts a webserver Sets up static folder Stores Html Javascript Css http:// address:port /static/ index.html 17

Web Web request Route Method Port Message { payload : query string / upload data req : request res: response next: } 18

Web response 19 Web response Input from a web request Sends the payload Redirect http:// address:port / redirects to http:// address:port /static/ index.html

Run the server Get the IP of the board Shell ifconfig In the same network http://172.17.0.82:5000/ 20

IoT Server 21

IoT Server Server with public IP address A gadget without pin access Good for web server Web pages API 22

IoT Server 23

Web templates 24

Web template Web template Loads a templates Fills it with variables From value From payload Sends it 25

Web template 26 Values are available Payload variables are available

Web template 27 Value is refreshed only on a page reload

Web service 28

Web service is API Expose functions for apps Mobile Applications Refresh the value without reloading the page Use multiple UI 29 Image from http :// blogs.msdn.com /b/ martinkearn /archive/2015/01/05/introduction-to-rest-and-net-web- api.aspx

Web response 30 Web response Input from a web request Sends the payload Redirect

Web response 31 /sensor returns { “sensor”: “0” }

JQuery API 32

Web socket 33

Websocket Allows asynchronous communication with the server Like a socket Uses HTTP or HTTPS Problems with proxies Socket.IO Has a solution with HTTP or HTTPS if the websocket is unavailable 34

Websocket 35 Image from https :// warmcat.com / libwebsockets /2010/11/01/libwebsockets-html5-websocket-server-library-in-c.html

Web starter app Streams Web starter app Angular JS 36

Angular JS static/ w eb.html 37

Javascript 38

Questions? 39