alexandruradovici
9,261 views
39 slides
Jun 27, 2015
Slide 1 of 39
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
About This Presentation
We servers for the Internet of things
Size: 2.83 MB
Language: en
Added: Jun 27, 2015
Slides: 39 pages
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
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
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