SlideShare una empresa de Scribd logo
1 de 45
Descargar para leer sin conexión
Aloha
Peculiarities of web interfaces for
resource constrained embedded systems
IoT connects the physical
world to the Internet
Hallo
Goddag
Shalom
Vitayu Salut
Ola Hello Cześć
Xin chào
Ciao!
HTTP
Peculiarities of web interfaces for
resource constrained embedded systems
WoT enables the physical world
to speak the same language
HTTP
HTTP
HTTP
HTTP HTTP
HTTP HTTP HTTP
HTTP
HTTP
Peculiarities of web interfaces for resource constrained embedded systems
Better Embedded 2014, Firenze
Outline
Introduction
Providing static content
Providing dynamic
content
Dynamic web interfaces
WoT things to be done
Peculiarities of web interfaces for resource constrained embedded systems
Better Embedded 2014, Firenze
Burgeoning market
Global IoT market expected
to grow by more than
US$ 5,000,000,000,000
over the next six years.
IDC study, Worldwide and Regional Internet of Things (IoT)
2014 –2020 Forecast: A Virtuous Circle of Proven Value and
Demand
Peculiarities of web interfaces for resource constrained embedded systems
Better Embedded 2014, Firenze
How to connect constrained
things?
●
Two mainstream architectures
 WS-*
➔ Based on WSDL, SOAP, XML...
➔ HTTP/HTTPU used for transport
 REST
➔ HTTP as application protocol
"The Web of Things: A Survey" by Deze Zeng, Song
Guo, and Zixue Cheng, The University of Aizu, Japan
Peculiarities of web interfaces for resource constrained embedded systems
Better Embedded 2014, Firenze
HTTP
●
HTTP
 Major communication platform of the Internet
●
REST (REpresentational State Transfer) is the true
architecture of the Web
 One resource – one URI
 Resources separated from representation
➔ Human interfaces
➔ M2M communication
 Details: Roy Fielding's doctoral dissertation
Peculiarities of web interfaces for resource constrained embedded systems
Better Embedded 2014, Firenze
Whats possible with WoT?
Embedded
HTTP
Sensor node
Cloud services
Web interface
Sensor node
Peculiarities of web interfaces for resource constrained embedded systems
Better Embedded 2014, Firenze
Mashup Technology
●
Physical / Physical Mashup
 Interoperability between devices
 Highly distributed architecture
●
Physical / Virtual Mashup
 Integration of physical data into geographic
maps
 Augmented reality, e.g. Google glasses
Peculiarities of web interfaces for resource constrained embedded systems
Better Embedded 2014, Firenze
Va bene!
We need to support HTTP.
But can we?
Peculiarities of web interfaces for resource constrained embedded systems
Better Embedded 2014, Firenze
Traditional web servers are not designed
for embedded systems
●
Minimum requirements for embedded
Webservers
 CPU with network interface
 TCP/IP Stack with HTTP support
 Non-volatile storage for static web
content
 Some software for generating dynamic
content
Peculiarities of web interfaces for resource constrained embedded systems
Better Embedded 2014, Firenze
Typical classes of embedded systems in 2014
Class CPU Memory OS Support Example TCP/IP
Support
Webserver
Support
A 32/64-bit,
several
100 MHz
Up to some GB
RAMand Flash
Running full
operating
system
Raspberry
Pi
Internal,
full stack
Direct
integration
via detached
process
B 8/32-bit, up
to a few
100 MHz
More than 32kB
RAMand 64kB
Flash
Running small
RTOS
Ethernut Internal,
reduced
stack
Direct
integration
via linked
library
C 8/32-bit, up
to a few
100 MHz
Fewkilobytes of
RAM/ Flash
Libraries Arduino External Directly
integrated in
application
code
D 8-bit, a few
MHz
Some hundred
bytes of RAM/
Flash or even less
Bare metal
only
8051,
ATtiny
External Indirect
integration
Peculiarities of web interfaces for resource constrained embedded systems
Better Embedded 2014, Firenze
Open Source TCP/IP Stacks
Product Available ports Data RAM Code space License First
release
Latest
stable
Comment
CycloneTCP AVR32, AT91SAM3/4,
Coldfire, Kinetis,
LPC17XX, PIC32,
STM32F1-4, many more...
GPLv2 +
Commercial
02/2013 06/2014 Initially
commercial?
fNet Coldfire, Kinetis,
LPC17XX
LGPLv3 03/2009 06/2014 By Freescale
lwIP Too many to list here 10s of kB 40kB BSD 10/2002 12/2012 Easy to port to
new platforms
Nut/Net AVR/32, AT91SAM3/7/9,
Coldfire, Gameboy, LM3S,
LPC17XX, STM32L1/F1-4
10s of kB 30 to 120kB BSD 02/2001 12/2012 Part of Nut/OS,
may be difficult to
port
uIP 6502, AVR, CC2530x,
LM3S, MSP430, MC1322x,
STM32, many more...
few 100
bytes
4 to 5kB BSD 10/2001 Now part of
Contiki
Peculiarities of web interfaces for resource constrained embedded systems
Better Embedded 2014, Firenze
support HTTP.
But how to get started?
Yes, we can
Peculiarities of web interfaces for resource constrained embedded systems
Better Embedded 2014, Firenze
Outline
Introduction
Providing static content
Providing dynamic
content
Dynamic web interfaces
WoT things to be done
Peculiarities of web interfaces for resource constrained embedded systems
Better Embedded 2014, Firenze
Providing static content
PNG
HTML
CSS
Peculiarities of web interfaces for resource constrained embedded systems
Better Embedded 2014, Firenze
Providing static content
Read and parse
request, line by line
Determine content
length
while () {
tcpread(buffer);
if (strncmp(buffer, "GET"...
Locate requested
resource
for (i = 0; i < NFILES; i++) {
if (strcmp(aof[i].name, ...
len = sizeof(aof[i].content);
...
tcpwrite(aof[i].content);
...
Send response
header
Send content
tcpwrite("HTTP/1.1 200 OKrn");
tcpwrite("Content-Length: ");
tcpwrite(itoa(len));
...
const struct files {
char *name;
uint8_t content[];
} aof[] = {
{ "index.html",
{ '<', 'H', 'T', 'M'...
GET /index.html HTTP/1.1
HTTP/1.1 200 OK
Content-Length: 1872
If no file systemis available, it
can be imitated by a constant
array in Flash memory.
Peculiarities of web interfaces for resource constrained embedded systems
Better Embedded 2014, Firenze
Providing static content
Nut/OS provides a tool named crurom, which converts
all files in a subdirectory to a C source file.
const char file1data[] PROGMEM = {
'<','H','T','M','L','>','<','H','E','A'...
'A','D','>','<','B','O','D','Y','>','<'...
'C','=','"','n','u','t','o','s','.','p'...
};
const char file1name[] PROGMEM = "index.html";
const char file2data[] PROGMEM = {
137,'P','N','G', 13, 10, 26, 10, 0...
};
const char file2name[] PROGMEM = "nutos.png";
const char file1data[] PROGMEM = {
'<','H','T','M','L','>','<','H','E','A'...
'A','D','>','<','B','O','D','Y','>','<'...
'C','=','"','n','u','t','o','s','.','p'...
};
const char file1name[] PROGMEM = "index.html";
const char file2data[] PROGMEM = {
137,'P','N','G', 13, 10, 26, 10, 0...
};
const char file2name[] PROGMEM = "nutos.png";C:ethernutnutappuhttpd_tiny> make burn
avr-gcc -c -I../include … httpd_tiny.c
crurom -r -ohtdocs.c htdocs
avr-gcc -c -I../include … htdocs.c
avr-gcc httpd_tiny.o htdocs.o -mmcu=...
avrdude -p m128 -c stk -U
flash:w:httpd_tiny.hex
…
Simply type 'make burn'...
...to upload new content.
Peculiarities of web interfaces for resource constrained embedded systems
Better Embedded 2014, Firenze
File Systems
●
If available, use a real file system
 Single files can be replaced during runtime
e.g via FTP or HTTP upload
 Content can be placed on cheap external
memories (Flash, SD-cards)
●
C array method as a fallback
 Simple and robust
 In case of file system failures the device is able
to provide a minimal rescue interface
Peculiarities of web interfaces for resource constrained embedded systems
Better Embedded 2014, Firenze
File Systems
●
Most file systems for resource constrained devices
are deeply integrated into the underlying OS and
difficult to port to other platforms
 Check file system support when selecting an OS
●
Portable Open Source projects
 FatFS at http://elm-chan.org
➔ Use with memory cards
 Coffee, part of Contiki-OS
➔ Use with Flash / EEPROM memory chips
Peculiarities of web interfaces for resource constrained embedded systems
Better Embedded 2014, Firenze
Compression
●
Data compression saves memory space and bandwidth
●
Use of compressed image formats (jpeg, png) is today's
standard
 Consider UTF-8 characters and webfonts for pictograms
●
HTTP compression is not recommended for tiny systems
 On-the-fly compression requires too much CPU power
 Most browsers accept gzip-compressed documents, so it
may seem attractive to store static content in this format
 Problem: Browsers may not always accept it
Peculiarities of web interfaces for resource constrained embedded systems
Better Embedded 2014, Firenze
...but
●
Syntax-aware text compressors may decrease
HTML or CSS code by 10 to 30%, even more when
applied to JavaScript
●
Example: https://htmlcompressor.com/
Peculiarities of web interfaces for resource constrained embedded systems
Better Embedded 2014, Firenze
Fino a qui, tutto bene!
Static web pages are lousy!
Peculiarities of web interfaces for resource constrained embedded systems
Better Embedded 2014, Firenze
Outline
Introduction
Providing static content
Providing dynamic
content
Dynamic web interfaces
WoT things to be done
Peculiarities of web interfaces for resource constrained embedded systems
Better Embedded 2014, Firenze
Types of dynamic content
Server-side
scripting:
Values inserted
at document
generation
Client-side scripting:
Values dynamically
updated without
refreshing document
Peculiarities of web interfaces for resource constrained embedded systems
Better Embedded 2014, Firenze
Providing dynamic content
Server-side
scripting:
Values inserted
at document
generation
Peculiarities of web interfaces for resource constrained embedded systems
Better Embedded 2014, Firenze
Providing dynamic content
Read and parse
request, line by line
Howto determine
the content length
in advance?
while () {
tcpread(buffer);
if (strncmp(buffer, "GET"...
Detect URIs with
variable content
void SendIndex()
{
len = ?
...
tcpwrite("<HTML>rn");
tcpwrite(timestr);
Send response
header
Send static and
variable content
tcpwrite("HTTP/1.1 200 OK...
...
for (i = 0; i < NFUNCS; i++) {
if (strcmp(fnc[i].name, …
SendIndex();
...
GET /index.html HTTP/1.1
…
HTTP/1.1 200 OK
Content-Length: ?
CGI way: Call a C function
instead of locating static
data.
Peculiarities of web interfaces for resource constrained embedded systems
Better Embedded 2014, Firenze
Providing dynamic content
●
First problem
 Calculating the content length in advance
often requires too much RAM space
●
Second problem
 Maintaining hard coded static content mixed
with variable content can become quite
painful
Peculiarities of web interfaces for resource constrained embedded systems
Better Embedded 2014, Firenze
Content length problem
●
First solution
 Do not send content length header and close
connection after sending the last character
➔ Sometimes some browsers hang on open
connections
➔ Reconnections are costly on slow lines
(GSM/GPRS)
●
Second solution
 Implement chunked transfer encoding
Peculiarities of web interfaces for resource constrained embedded systems
Better Embedded 2014, Firenze
Chunked Transfer Encoding
HTTP/1.1 200 OK
Transfer-Encoding: chunked
GET /index.html HTTP/1.1
8rn
Ethernutrn
Arn
goes Italyrn
Peculiarities of web interfaces for resource constrained embedded systems
Better Embedded 2014, Firenze
Maintenance problem
●
First solution: Server Side Includes (SSI)
➔ Stored as static content
➔ Variable parts can be replaced on-the-fly during
transmission
●
Second solution: Template system
➔ Similar to SSI, but less verbose
➔ Can be combined with SSI
➔ Fully separates content from coding (wishful thinking)
➔ Suitable for many document formats, not just
HTML/XML
Peculiarities of web interfaces for resource constrained embedded systems
Better Embedded 2014, Firenze
Nut/OS template system
Syntax Element Function Example
{{ expression }} Replaced with
expression result
<div>Current temperature is
{{ temp }}°C</div>
{% command %} Executes commands
if, for and use
{% if ip == '127.0.0.1' %}
<p>localhost</p>
{% elif ip == '255.255.255.255' %}
<p>broadcast</p>
{% else %}
<p>other</p>
{% endif %}
{# comment #} Simply removed {# Revision 1.2.3 #}
●
Subset of Django Template Language
●
Developed for LPC1768 platform
(100MHz Cortex-M3, 64kB RAM, 512kB Flash)
●
Good maintainability
Peculiarities of web interfaces for resource constrained embedded systems
Better Embedded 2014, Firenze
Dynamic data updates
Read and parse
request, line by line
Call template
processor
while () {
tcpread(buffer);
if (strncmp(buffer, "GET"...
Locate requested
resource
for (i = 0; i < NFILES; i++) {
if (strcmp(aof[i].name, …
ProcTempl(aof[i].cont...
...
void ProcTempl(char *cp) {
...
Send HttpHeader();
...
nxt = GetNextTag(cp);
if (NextTagIsExpr()) {
r = EvalExpr(nxt);
tcpwritechunked(r);
}
else if (NextTagIsCmd(nxt)) {
...
}
else {
tcpwritechunked(nxt);...
Send response
header
Send chunked
content
GET /sensor.tpl HTTP/1.1
…
HTTP/1.1 200 OK
Transfer-Encoding: chunked
...
Peculiarities of web interfaces for resource constrained embedded systems
Better Embedded 2014, Firenze
Outline
Introduction
Providing static content
Providing dynamic
content
Dynamic web interfaces
WoT things to be done
Peculiarities of web interfaces for resource constrained embedded systems
Better Embedded 2014, Firenze
Dynamic web interfaces
●
Fat client and thin server
●
Let the browser do the job
 HTML5 patterns to verify user input
 JavaScript for CPU-intensive tasks
e.g. floating point calculations or graphics
➔ Scripts may be blocked, non-obstrusive Javascript
is prefered
 CSS3 transitions for catchy animations
Peculiarities of web interfaces for resource constrained embedded systems
Better Embedded 2014, Firenze
HTML5 patterns for validation
●
Example: Check IPv4 address
 ((^|.)((25[0-5])|(2[0-4]d)|(1dd)|([1-9]?d))){4}$
Peculiarities of web interfaces for resource constrained embedded systems
Better Embedded 2014, Firenze
JavaScript calculations
●
User selects temperature unit
●
JavaScript does the conversion
 Webserver is not involved until
user presses “submit”
Peculiarities of web interfaces for resource constrained embedded systems
Better Embedded 2014, Firenze
Providing dynamic content
Client-side scripting:
Dynamically updated
by JavaScript without
refreshing document
Peculiarities of web interfaces for resource constrained embedded systems
Better Embedded 2014, Firenze
JSON vs XML
●
Less overhead than XML, therefore
preferred format for constraint systems
●
JSON is becoming the first choice for web
based applications
Peculiarities of web interfaces for resource constrained embedded systems
Better Embedded 2014, Firenze
JSON templates
{
"timestamp": "{{timestamp}}",
"value": "{{temperature}}"
...
}
●
Template stored as static data
●
Tags replaced on the fly
{
"timestamp": "1404229980",
"value": "22.3"
...
}
Peculiarities of web interfaces for resource constrained embedded systems
Better Embedded 2014, Firenze
Graphical user interface demo
JavaScript
● Queries JSON-data from the web
server
● Manipulates SVG images
Peculiarities of web interfaces for resource constrained embedded systems
Better Embedded 2014, Firenze
JSON gives wings to things
●
Well suited for M2M communication
●
Supported by major cloud services
Peculiarities of web interfaces for resource constrained embedded systems
Better Embedded 2014, Firenze
Outline
Introduction
Providing static content
Providing dynamic
content
Dynamic web interfaces
WoT things to be done
Peculiarities of web interfaces for resource constrained embedded systems
Better Embedded 2014, Firenze
Web of Things Things To Be
Done (WoTTTBD)
●
Lack of service description standards
 Required, but difficult to define in the early
stage of a fast growing environment
●
Security, trust and privacy
 Most challenging for constraint systems
●
Probably more
Peculiarities of web interfaces for resource constrained embedded systems
Better Embedded 2014, Firenze
Thank you for
your attention.
Any questions?
Mille grazie!
plus.google.com/+EgniteDewww.youtube.com/user/egniteGmbH
www.facebook.de/egniteDewww.twitter.com/egniteEmbedded
Peculiarities of web interfaces for resource constrained embedded systems
Better Embedded 2014, Firenze
Credits and References
References
● IDC study, Worldwide and Regional Internet
of Things (IoT) 2014 –2020 Forecast: A
Virtuous Circle of Proven Value and Demand
● "The Web of Things: A Survey" by Deze
Zeng, Song Guo, and Zixue Cheng, The
University of Aizu, Japan
● Fielding, Roy Thomas (2000), Architectural
Styles and the Design of Network-based
Software Architectures, Doctoral
dissertation, University of California, Irvine
Thanks to
●
Elegant Themes and Freepik from
www.flaticon.com
for the icons

Más contenido relacionado

Similar a Peculiarities of web interfaces for resource constrained embedded systems / Better Embedded 2014

Thin Server Architecture
Thin Server ArchitectureThin Server Architecture
Thin Server ArchitectureMitch Pirtle
 
Westhawk integration
Westhawk integrationWesthawk integration
Westhawk integrationTim Panton
 
HTML5 - The Python Angle (PyCon Ireland 2010)
HTML5 - The Python Angle (PyCon Ireland 2010)HTML5 - The Python Angle (PyCon Ireland 2010)
HTML5 - The Python Angle (PyCon Ireland 2010)Kevin Gill
 
.NET Core Today and Tomorrow
.NET Core Today and Tomorrow.NET Core Today and Tomorrow
.NET Core Today and TomorrowJon Galloway
 
Nt1310 Final Exam Questions And Answers
Nt1310 Final Exam Questions And AnswersNt1310 Final Exam Questions And Answers
Nt1310 Final Exam Questions And AnswersLisa Williams
 
Cloud-Native .Net des applications containerisées .Net sur Linux, Windows e...
 Cloud-Native .Net des applications containerisées .Net sur Linux, Windows e... Cloud-Native .Net des applications containerisées .Net sur Linux, Windows e...
Cloud-Native .Net des applications containerisées .Net sur Linux, Windows e...VMware Tanzu
 
Basic html5 and javascript
Basic html5 and javascriptBasic html5 and javascript
Basic html5 and javascriptwendy017
 
WebRTC Tutorial by Dean Bubley of Disruptive Analysis & Tim Panton of Westhaw...
WebRTC Tutorial by Dean Bubley of Disruptive Analysis & Tim Panton of Westhaw...WebRTC Tutorial by Dean Bubley of Disruptive Analysis & Tim Panton of Westhaw...
WebRTC Tutorial by Dean Bubley of Disruptive Analysis & Tim Panton of Westhaw...Dean Bubley
 
WebRTC Integration from Tim Panton
WebRTC Integration from Tim PantonWebRTC Integration from Tim Panton
WebRTC Integration from Tim PantonAlan Quayle
 
Hello 1 2 3, can you see me now?
Hello 1 2 3, can you see me now?Hello 1 2 3, can you see me now?
Hello 1 2 3, can you see me now?Kundan Singh
 
Web Architecture and Technologies
Web Architecture and TechnologiesWeb Architecture and Technologies
Web Architecture and TechnologiesFulvio Corno
 
Reducing latency on the web with the Azure CDN - DevSum - SWAG
Reducing latency on the web with the Azure CDN - DevSum - SWAGReducing latency on the web with the Azure CDN - DevSum - SWAG
Reducing latency on the web with the Azure CDN - DevSum - SWAGMaarten Balliauw
 
HTTP/2 and a Faster Web
HTTP/2 and a Faster WebHTTP/2 and a Faster Web
HTTP/2 and a Faster WebC4Media
 
RESTful applications: The why and how by Maikel Mardjan
RESTful applications: The why and how by Maikel MardjanRESTful applications: The why and how by Maikel Mardjan
RESTful applications: The why and how by Maikel MardjanJexia
 
Normalizing x pages web development
Normalizing x pages web development Normalizing x pages web development
Normalizing x pages web development Shean McManus
 
From nothing to Prometheus : one year after
From nothing to Prometheus : one year afterFrom nothing to Prometheus : one year after
From nothing to Prometheus : one year afterAntoine Leroyer
 
Delivering High Performance Websites with NGINX
Delivering High Performance Websites with NGINXDelivering High Performance Websites with NGINX
Delivering High Performance Websites with NGINXNGINX, Inc.
 

Similar a Peculiarities of web interfaces for resource constrained embedded systems / Better Embedded 2014 (20)

Thin Server Architecture
Thin Server ArchitectureThin Server Architecture
Thin Server Architecture
 
World Wide Web(WWW)
World Wide Web(WWW)World Wide Web(WWW)
World Wide Web(WWW)
 
Web Fundamentals
Web FundamentalsWeb Fundamentals
Web Fundamentals
 
Westhawk integration
Westhawk integrationWesthawk integration
Westhawk integration
 
HTML5 - The Python Angle (PyCon Ireland 2010)
HTML5 - The Python Angle (PyCon Ireland 2010)HTML5 - The Python Angle (PyCon Ireland 2010)
HTML5 - The Python Angle (PyCon Ireland 2010)
 
.NET Core Today and Tomorrow
.NET Core Today and Tomorrow.NET Core Today and Tomorrow
.NET Core Today and Tomorrow
 
Nt1310 Final Exam Questions And Answers
Nt1310 Final Exam Questions And AnswersNt1310 Final Exam Questions And Answers
Nt1310 Final Exam Questions And Answers
 
Cloud-Native .Net des applications containerisées .Net sur Linux, Windows e...
 Cloud-Native .Net des applications containerisées .Net sur Linux, Windows e... Cloud-Native .Net des applications containerisées .Net sur Linux, Windows e...
Cloud-Native .Net des applications containerisées .Net sur Linux, Windows e...
 
Basic html5 and javascript
Basic html5 and javascriptBasic html5 and javascript
Basic html5 and javascript
 
WebRTC Tutorial by Dean Bubley of Disruptive Analysis & Tim Panton of Westhaw...
WebRTC Tutorial by Dean Bubley of Disruptive Analysis & Tim Panton of Westhaw...WebRTC Tutorial by Dean Bubley of Disruptive Analysis & Tim Panton of Westhaw...
WebRTC Tutorial by Dean Bubley of Disruptive Analysis & Tim Panton of Westhaw...
 
Zenoh: The Genesis
Zenoh: The GenesisZenoh: The Genesis
Zenoh: The Genesis
 
WebRTC Integration from Tim Panton
WebRTC Integration from Tim PantonWebRTC Integration from Tim Panton
WebRTC Integration from Tim Panton
 
Hello 1 2 3, can you see me now?
Hello 1 2 3, can you see me now?Hello 1 2 3, can you see me now?
Hello 1 2 3, can you see me now?
 
Web Architecture and Technologies
Web Architecture and TechnologiesWeb Architecture and Technologies
Web Architecture and Technologies
 
Reducing latency on the web with the Azure CDN - DevSum - SWAG
Reducing latency on the web with the Azure CDN - DevSum - SWAGReducing latency on the web with the Azure CDN - DevSum - SWAG
Reducing latency on the web with the Azure CDN - DevSum - SWAG
 
HTTP/2 and a Faster Web
HTTP/2 and a Faster WebHTTP/2 and a Faster Web
HTTP/2 and a Faster Web
 
RESTful applications: The why and how by Maikel Mardjan
RESTful applications: The why and how by Maikel MardjanRESTful applications: The why and how by Maikel Mardjan
RESTful applications: The why and how by Maikel Mardjan
 
Normalizing x pages web development
Normalizing x pages web development Normalizing x pages web development
Normalizing x pages web development
 
From nothing to Prometheus : one year after
From nothing to Prometheus : one year afterFrom nothing to Prometheus : one year after
From nothing to Prometheus : one year after
 
Delivering High Performance Websites with NGINX
Delivering High Performance Websites with NGINXDelivering High Performance Websites with NGINX
Delivering High Performance Websites with NGINX
 

Último

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...Martijn de Jong
 
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 productivityPrincipled Technologies
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
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 MenDelhi Call girls
 
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 DevelopmentsTrustArc
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
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.pdfsudhanshuwaghmare1
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
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.pdfEnterprise Knowledge
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
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 Scriptwesley chun
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 

Último (20)

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...
 
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
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
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
 
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
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
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
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
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
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
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
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 

Peculiarities of web interfaces for resource constrained embedded systems / Better Embedded 2014

  • 1. Aloha Peculiarities of web interfaces for resource constrained embedded systems IoT connects the physical world to the Internet Hallo Goddag Shalom Vitayu Salut Ola Hello Cześć Xin chào Ciao!
  • 2. HTTP Peculiarities of web interfaces for resource constrained embedded systems WoT enables the physical world to speak the same language HTTP HTTP HTTP HTTP HTTP HTTP HTTP HTTP HTTP HTTP
  • 3. Peculiarities of web interfaces for resource constrained embedded systems Better Embedded 2014, Firenze Outline Introduction Providing static content Providing dynamic content Dynamic web interfaces WoT things to be done
  • 4. Peculiarities of web interfaces for resource constrained embedded systems Better Embedded 2014, Firenze Burgeoning market Global IoT market expected to grow by more than US$ 5,000,000,000,000 over the next six years. IDC study, Worldwide and Regional Internet of Things (IoT) 2014 –2020 Forecast: A Virtuous Circle of Proven Value and Demand
  • 5. Peculiarities of web interfaces for resource constrained embedded systems Better Embedded 2014, Firenze How to connect constrained things? ● Two mainstream architectures  WS-* ➔ Based on WSDL, SOAP, XML... ➔ HTTP/HTTPU used for transport  REST ➔ HTTP as application protocol "The Web of Things: A Survey" by Deze Zeng, Song Guo, and Zixue Cheng, The University of Aizu, Japan
  • 6. Peculiarities of web interfaces for resource constrained embedded systems Better Embedded 2014, Firenze HTTP ● HTTP  Major communication platform of the Internet ● REST (REpresentational State Transfer) is the true architecture of the Web  One resource – one URI  Resources separated from representation ➔ Human interfaces ➔ M2M communication  Details: Roy Fielding's doctoral dissertation
  • 7. Peculiarities of web interfaces for resource constrained embedded systems Better Embedded 2014, Firenze Whats possible with WoT? Embedded HTTP Sensor node Cloud services Web interface Sensor node
  • 8. Peculiarities of web interfaces for resource constrained embedded systems Better Embedded 2014, Firenze Mashup Technology ● Physical / Physical Mashup  Interoperability between devices  Highly distributed architecture ● Physical / Virtual Mashup  Integration of physical data into geographic maps  Augmented reality, e.g. Google glasses
  • 9. Peculiarities of web interfaces for resource constrained embedded systems Better Embedded 2014, Firenze Va bene! We need to support HTTP. But can we?
  • 10. Peculiarities of web interfaces for resource constrained embedded systems Better Embedded 2014, Firenze Traditional web servers are not designed for embedded systems ● Minimum requirements for embedded Webservers  CPU with network interface  TCP/IP Stack with HTTP support  Non-volatile storage for static web content  Some software for generating dynamic content
  • 11. Peculiarities of web interfaces for resource constrained embedded systems Better Embedded 2014, Firenze Typical classes of embedded systems in 2014 Class CPU Memory OS Support Example TCP/IP Support Webserver Support A 32/64-bit, several 100 MHz Up to some GB RAMand Flash Running full operating system Raspberry Pi Internal, full stack Direct integration via detached process B 8/32-bit, up to a few 100 MHz More than 32kB RAMand 64kB Flash Running small RTOS Ethernut Internal, reduced stack Direct integration via linked library C 8/32-bit, up to a few 100 MHz Fewkilobytes of RAM/ Flash Libraries Arduino External Directly integrated in application code D 8-bit, a few MHz Some hundred bytes of RAM/ Flash or even less Bare metal only 8051, ATtiny External Indirect integration
  • 12. Peculiarities of web interfaces for resource constrained embedded systems Better Embedded 2014, Firenze Open Source TCP/IP Stacks Product Available ports Data RAM Code space License First release Latest stable Comment CycloneTCP AVR32, AT91SAM3/4, Coldfire, Kinetis, LPC17XX, PIC32, STM32F1-4, many more... GPLv2 + Commercial 02/2013 06/2014 Initially commercial? fNet Coldfire, Kinetis, LPC17XX LGPLv3 03/2009 06/2014 By Freescale lwIP Too many to list here 10s of kB 40kB BSD 10/2002 12/2012 Easy to port to new platforms Nut/Net AVR/32, AT91SAM3/7/9, Coldfire, Gameboy, LM3S, LPC17XX, STM32L1/F1-4 10s of kB 30 to 120kB BSD 02/2001 12/2012 Part of Nut/OS, may be difficult to port uIP 6502, AVR, CC2530x, LM3S, MSP430, MC1322x, STM32, many more... few 100 bytes 4 to 5kB BSD 10/2001 Now part of Contiki
  • 13. Peculiarities of web interfaces for resource constrained embedded systems Better Embedded 2014, Firenze support HTTP. But how to get started? Yes, we can
  • 14. Peculiarities of web interfaces for resource constrained embedded systems Better Embedded 2014, Firenze Outline Introduction Providing static content Providing dynamic content Dynamic web interfaces WoT things to be done
  • 15. Peculiarities of web interfaces for resource constrained embedded systems Better Embedded 2014, Firenze Providing static content PNG HTML CSS
  • 16. Peculiarities of web interfaces for resource constrained embedded systems Better Embedded 2014, Firenze Providing static content Read and parse request, line by line Determine content length while () { tcpread(buffer); if (strncmp(buffer, "GET"... Locate requested resource for (i = 0; i < NFILES; i++) { if (strcmp(aof[i].name, ... len = sizeof(aof[i].content); ... tcpwrite(aof[i].content); ... Send response header Send content tcpwrite("HTTP/1.1 200 OKrn"); tcpwrite("Content-Length: "); tcpwrite(itoa(len)); ... const struct files { char *name; uint8_t content[]; } aof[] = { { "index.html", { '<', 'H', 'T', 'M'... GET /index.html HTTP/1.1 HTTP/1.1 200 OK Content-Length: 1872 If no file systemis available, it can be imitated by a constant array in Flash memory.
  • 17. Peculiarities of web interfaces for resource constrained embedded systems Better Embedded 2014, Firenze Providing static content Nut/OS provides a tool named crurom, which converts all files in a subdirectory to a C source file. const char file1data[] PROGMEM = { '<','H','T','M','L','>','<','H','E','A'... 'A','D','>','<','B','O','D','Y','>','<'... 'C','=','"','n','u','t','o','s','.','p'... }; const char file1name[] PROGMEM = "index.html"; const char file2data[] PROGMEM = { 137,'P','N','G', 13, 10, 26, 10, 0... }; const char file2name[] PROGMEM = "nutos.png"; const char file1data[] PROGMEM = { '<','H','T','M','L','>','<','H','E','A'... 'A','D','>','<','B','O','D','Y','>','<'... 'C','=','"','n','u','t','o','s','.','p'... }; const char file1name[] PROGMEM = "index.html"; const char file2data[] PROGMEM = { 137,'P','N','G', 13, 10, 26, 10, 0... }; const char file2name[] PROGMEM = "nutos.png";C:ethernutnutappuhttpd_tiny> make burn avr-gcc -c -I../include … httpd_tiny.c crurom -r -ohtdocs.c htdocs avr-gcc -c -I../include … htdocs.c avr-gcc httpd_tiny.o htdocs.o -mmcu=... avrdude -p m128 -c stk -U flash:w:httpd_tiny.hex … Simply type 'make burn'... ...to upload new content.
  • 18. Peculiarities of web interfaces for resource constrained embedded systems Better Embedded 2014, Firenze File Systems ● If available, use a real file system  Single files can be replaced during runtime e.g via FTP or HTTP upload  Content can be placed on cheap external memories (Flash, SD-cards) ● C array method as a fallback  Simple and robust  In case of file system failures the device is able to provide a minimal rescue interface
  • 19. Peculiarities of web interfaces for resource constrained embedded systems Better Embedded 2014, Firenze File Systems ● Most file systems for resource constrained devices are deeply integrated into the underlying OS and difficult to port to other platforms  Check file system support when selecting an OS ● Portable Open Source projects  FatFS at http://elm-chan.org ➔ Use with memory cards  Coffee, part of Contiki-OS ➔ Use with Flash / EEPROM memory chips
  • 20. Peculiarities of web interfaces for resource constrained embedded systems Better Embedded 2014, Firenze Compression ● Data compression saves memory space and bandwidth ● Use of compressed image formats (jpeg, png) is today's standard  Consider UTF-8 characters and webfonts for pictograms ● HTTP compression is not recommended for tiny systems  On-the-fly compression requires too much CPU power  Most browsers accept gzip-compressed documents, so it may seem attractive to store static content in this format  Problem: Browsers may not always accept it
  • 21. Peculiarities of web interfaces for resource constrained embedded systems Better Embedded 2014, Firenze ...but ● Syntax-aware text compressors may decrease HTML or CSS code by 10 to 30%, even more when applied to JavaScript ● Example: https://htmlcompressor.com/
  • 22. Peculiarities of web interfaces for resource constrained embedded systems Better Embedded 2014, Firenze Fino a qui, tutto bene! Static web pages are lousy!
  • 23. Peculiarities of web interfaces for resource constrained embedded systems Better Embedded 2014, Firenze Outline Introduction Providing static content Providing dynamic content Dynamic web interfaces WoT things to be done
  • 24. Peculiarities of web interfaces for resource constrained embedded systems Better Embedded 2014, Firenze Types of dynamic content Server-side scripting: Values inserted at document generation Client-side scripting: Values dynamically updated without refreshing document
  • 25. Peculiarities of web interfaces for resource constrained embedded systems Better Embedded 2014, Firenze Providing dynamic content Server-side scripting: Values inserted at document generation
  • 26. Peculiarities of web interfaces for resource constrained embedded systems Better Embedded 2014, Firenze Providing dynamic content Read and parse request, line by line Howto determine the content length in advance? while () { tcpread(buffer); if (strncmp(buffer, "GET"... Detect URIs with variable content void SendIndex() { len = ? ... tcpwrite("<HTML>rn"); tcpwrite(timestr); Send response header Send static and variable content tcpwrite("HTTP/1.1 200 OK... ... for (i = 0; i < NFUNCS; i++) { if (strcmp(fnc[i].name, … SendIndex(); ... GET /index.html HTTP/1.1 … HTTP/1.1 200 OK Content-Length: ? CGI way: Call a C function instead of locating static data.
  • 27. Peculiarities of web interfaces for resource constrained embedded systems Better Embedded 2014, Firenze Providing dynamic content ● First problem  Calculating the content length in advance often requires too much RAM space ● Second problem  Maintaining hard coded static content mixed with variable content can become quite painful
  • 28. Peculiarities of web interfaces for resource constrained embedded systems Better Embedded 2014, Firenze Content length problem ● First solution  Do not send content length header and close connection after sending the last character ➔ Sometimes some browsers hang on open connections ➔ Reconnections are costly on slow lines (GSM/GPRS) ● Second solution  Implement chunked transfer encoding
  • 29. Peculiarities of web interfaces for resource constrained embedded systems Better Embedded 2014, Firenze Chunked Transfer Encoding HTTP/1.1 200 OK Transfer-Encoding: chunked GET /index.html HTTP/1.1 8rn Ethernutrn Arn goes Italyrn
  • 30. Peculiarities of web interfaces for resource constrained embedded systems Better Embedded 2014, Firenze Maintenance problem ● First solution: Server Side Includes (SSI) ➔ Stored as static content ➔ Variable parts can be replaced on-the-fly during transmission ● Second solution: Template system ➔ Similar to SSI, but less verbose ➔ Can be combined with SSI ➔ Fully separates content from coding (wishful thinking) ➔ Suitable for many document formats, not just HTML/XML
  • 31. Peculiarities of web interfaces for resource constrained embedded systems Better Embedded 2014, Firenze Nut/OS template system Syntax Element Function Example {{ expression }} Replaced with expression result <div>Current temperature is {{ temp }}°C</div> {% command %} Executes commands if, for and use {% if ip == '127.0.0.1' %} <p>localhost</p> {% elif ip == '255.255.255.255' %} <p>broadcast</p> {% else %} <p>other</p> {% endif %} {# comment #} Simply removed {# Revision 1.2.3 #} ● Subset of Django Template Language ● Developed for LPC1768 platform (100MHz Cortex-M3, 64kB RAM, 512kB Flash) ● Good maintainability
  • 32. Peculiarities of web interfaces for resource constrained embedded systems Better Embedded 2014, Firenze Dynamic data updates Read and parse request, line by line Call template processor while () { tcpread(buffer); if (strncmp(buffer, "GET"... Locate requested resource for (i = 0; i < NFILES; i++) { if (strcmp(aof[i].name, … ProcTempl(aof[i].cont... ... void ProcTempl(char *cp) { ... Send HttpHeader(); ... nxt = GetNextTag(cp); if (NextTagIsExpr()) { r = EvalExpr(nxt); tcpwritechunked(r); } else if (NextTagIsCmd(nxt)) { ... } else { tcpwritechunked(nxt);... Send response header Send chunked content GET /sensor.tpl HTTP/1.1 … HTTP/1.1 200 OK Transfer-Encoding: chunked ...
  • 33. Peculiarities of web interfaces for resource constrained embedded systems Better Embedded 2014, Firenze Outline Introduction Providing static content Providing dynamic content Dynamic web interfaces WoT things to be done
  • 34. Peculiarities of web interfaces for resource constrained embedded systems Better Embedded 2014, Firenze Dynamic web interfaces ● Fat client and thin server ● Let the browser do the job  HTML5 patterns to verify user input  JavaScript for CPU-intensive tasks e.g. floating point calculations or graphics ➔ Scripts may be blocked, non-obstrusive Javascript is prefered  CSS3 transitions for catchy animations
  • 35. Peculiarities of web interfaces for resource constrained embedded systems Better Embedded 2014, Firenze HTML5 patterns for validation ● Example: Check IPv4 address  ((^|.)((25[0-5])|(2[0-4]d)|(1dd)|([1-9]?d))){4}$
  • 36. Peculiarities of web interfaces for resource constrained embedded systems Better Embedded 2014, Firenze JavaScript calculations ● User selects temperature unit ● JavaScript does the conversion  Webserver is not involved until user presses “submit”
  • 37. Peculiarities of web interfaces for resource constrained embedded systems Better Embedded 2014, Firenze Providing dynamic content Client-side scripting: Dynamically updated by JavaScript without refreshing document
  • 38. Peculiarities of web interfaces for resource constrained embedded systems Better Embedded 2014, Firenze JSON vs XML ● Less overhead than XML, therefore preferred format for constraint systems ● JSON is becoming the first choice for web based applications
  • 39. Peculiarities of web interfaces for resource constrained embedded systems Better Embedded 2014, Firenze JSON templates { "timestamp": "{{timestamp}}", "value": "{{temperature}}" ... } ● Template stored as static data ● Tags replaced on the fly { "timestamp": "1404229980", "value": "22.3" ... }
  • 40. Peculiarities of web interfaces for resource constrained embedded systems Better Embedded 2014, Firenze Graphical user interface demo JavaScript ● Queries JSON-data from the web server ● Manipulates SVG images
  • 41. Peculiarities of web interfaces for resource constrained embedded systems Better Embedded 2014, Firenze JSON gives wings to things ● Well suited for M2M communication ● Supported by major cloud services
  • 42. Peculiarities of web interfaces for resource constrained embedded systems Better Embedded 2014, Firenze Outline Introduction Providing static content Providing dynamic content Dynamic web interfaces WoT things to be done
  • 43. Peculiarities of web interfaces for resource constrained embedded systems Better Embedded 2014, Firenze Web of Things Things To Be Done (WoTTTBD) ● Lack of service description standards  Required, but difficult to define in the early stage of a fast growing environment ● Security, trust and privacy  Most challenging for constraint systems ● Probably more
  • 44. Peculiarities of web interfaces for resource constrained embedded systems Better Embedded 2014, Firenze Thank you for your attention. Any questions? Mille grazie! plus.google.com/+EgniteDewww.youtube.com/user/egniteGmbH www.facebook.de/egniteDewww.twitter.com/egniteEmbedded
  • 45. Peculiarities of web interfaces for resource constrained embedded systems Better Embedded 2014, Firenze Credits and References References ● IDC study, Worldwide and Regional Internet of Things (IoT) 2014 –2020 Forecast: A Virtuous Circle of Proven Value and Demand ● "The Web of Things: A Survey" by Deze Zeng, Song Guo, and Zixue Cheng, The University of Aizu, Japan ● Fielding, Roy Thomas (2000), Architectural Styles and the Design of Network-based Software Architectures, Doctoral dissertation, University of California, Irvine Thanks to ● Elegant Themes and Freepik from www.flaticon.com for the icons