Iot Lesson1
Iot Lesson1
Programming
Andrea Acquaviva
Lesson 1
Course introduction
Organization
40 h classes
20 h labs (5 labs)
Video recordings
Classes
Lab intro (not the whole lab)
Exam
Written text (multiple choice): 10/30
Project discussion (slides + code): 20/30
Project discussion date is flexible (no time constraints, even in another
session, but raspberry kit must be returned within 3 months from the
end of the course, unless you use yours)
Code + slides (draft) must be sent to TA at least 2 days before
discussion
Projects
Two types of projects:
Proposed by TA
Proposed by students
Project team
members: 1-3
team building: autonomous
1 raspberry kit for each team
Project selection
Course purpose
To learn how to program embedded devices (things)
connected to the internet
How to get data from sensors and give commands to
actuators
How to communicate with other devices
How to write applications to collect data from devices
What is different from standard PC programming?
Andrea
Acquaviva
IoT
programming
Course purpose
Programming IoT devices includes:
Sensors/actuator interfacing
Web oriented programming (ok, this is like PCs) but protocols
and APIs are different
Lightweight, QoS oriented, low-power
Course contents
Classes
Middleware programming
Introduction to OOP
OO/Web programming with Python
Other Web programming approaches
(Java, Javascript, AJAX, PHP)
XML, JSON formats
Course contents
Raspberry
pi2
+
case
Labs
1.
Python programming
Basics, OOP
2.
Web programming I
Web services, cherry py, static pages
3.
Web programming II
Web services, cherry py, dynamic
pages, REST+JSON
4.
Raspberry PI I
T, H sensor
Intro + sensors
5.
RaspberryPI II
Web services + sensors
6.
Relay
RaspberryPI III
Web services + MQTT
ARM710
900
MHz
4
1
GB
Linux
Seminars
IREN (Italian DSO) will demonstrate District Heating
management system (sensors + data in the CLOUD) for
smart city applications
Reply (consulting company) will demonstrate their IoT
solutions
Introduction
IoT concept
US National Intelligence Council (NIC) considers Internet of Things
as one of the 6 Disruptive Civil Technologies
(April 2008)
IEEE ranks IoT #1 in the list of Top Trends for 2013 (Winter 2012):
The IoT promises to be the most disruptive technological
10
Tentative definition
IoT is
Things having identities and virtual personalities operating
in smart spaces using intelligent interfaces to connect and
communicate within social, environmental, and user
contexts
11
12
What is
environmental benefits.
2020
50 Billion
2013
x10
x5
<4 Zettabytes
13 Billion
Devices
1 Zettabytes = 1012 G
Things?
Things, in the IoT, can refer to a wide variety of devices
such as heart monitoring implants,bio-chip transponders
on farm animals, automobiles with built-in sensors, or field
operation devices that assist fire-fighters in search and
rescue.
Current market examples includesmart thermostatsystems
and washer/dryers that utilize WiFi for remote monitoring.
16
New Things
to Augment
LifeLife
New Things
to Augment
Smart City
Reduce traffic congestion
Better use of resources
Improve security
Smart Car
Reduce emissions
Increase safety
Save fuel
Smart Home
Make entertainment more
interactive and immersive
Increase comfort
Save energy
Smart Me Healthcare
Empower patients
Help physicians monitor and
diagnose remotely
Smart Me Wellness
Help to lead healthier lives
Optimize sports performance
Early warning of illness
Smart Industrial
& Smart Services
Productivity gains
Efficiency, agility, water and
food.
It used to remind
you of someone
close to your heart
Now it tells
you what to do
Now it reminds
you to take care
of your heart
And exactly
what you
doing
TheInternet
Internet of
of Things
Things Opportunity
The
Opportunity
Existing Things
augmented
New Things to
augment life
Internet
EveryThings
Things Scenario
Internet
ofofEvery
scenario
Remote
Monitoring
13
Power Plant
Smart Metering
Fab automation
Smart Home
Renewable Energy
IoT Services
21
Sensors/Actuators
Low power, autonomic, pervasive, ubiquitous computing
Communication protocols (REST, CoAP, MQTT)
Microservices and Middlewares
Data Analytics Engines -> in the CLOUD
Apps (iOS, Android, Web)
Key issues:
Interoperability
Security/trust and privacy
Low resources (=> revisit protocols and algorithms
implemented in Internet and Web)
Scalability
Andrea
Acquaviva
IoT
programming
22
JSON
24
Publish/Subscribe/Service:/Pattern
Publish/Subscribe
Pattern
ICT$Smartcities$2013$$$2$$$FP72SMARTCITIES22013$$
ICT22013.6.4$Optimizing$Energy$Systems$in$Smart$Cities
Publish/Subscribe$pattern
25
Publish/Subscribe: QoS
T$Smartcities$2013$$$2$$$FP72SMARTCITIES22013$$
T22013.6.4$Optimizing$Energy$Systems$in$Smart$Cities
Publish/Subscribe/Service:/QoS
26
27
Introductory Videos
Intel IoT -- What Does The Internet of Things Mean?
http://www.youtube.com/watch?v=Q3ur8wzzhBU
Internet
0:
Lighter
IP
using
simple
communicaPon
protocol
IPSO: Integrate IP and IEEE
802.15.4 (6LoWPAN) IPSO
Alliance
6LowPAN:
IP
over
802.15.4
Example Application:
Smart Buildings
The
thing
here
is
the
power
plug
that
becomes
a
smart
plug
Data
are
processed
in
the
CLOUD
and
visualized
in
A/R
or
V/R
through
context
aware
technologies
on
a
mobile
device
5
530
Module
2420
2520
Prosumer 1
Temperature Sensor
Humidity Sensor
Sensirion
Electric
SHT11
Meter
TI TMP125Avago
Photodiode Sensor
Hamamatsu S1087
Hamamatsu S1087-01
ADPS-9300
MV/LV Substation 1
MV/LV Substation j
MV/LV Substation m
Electric Meter
Electric Meter
Electric Meter
Gas
Meter
ts CC2530 and Crossbow Telos rev. B Hardware
Water
Meter
nb),
ils
ce
ed
se
of
he
on
%.
es
ks
ch
er
en
re
mIn
ed
nd
he
ed
30
ed
da
ng
ys
dto
Heating Meter
DSO
services
FLEXMETER consorPum
Other
services
SEEMPubS
consorPum
36
Summary
IoT is an incoming revolution, enabling a world of new applications
New communication paradigms are needed (i.e. publish/subscribe)
Programming IoT requires specific skills (web-network-object oriented,
resource constrained programming)
In this course we will study the main paradigm of IoT programming
using Python, similar concepts can be implemented in Java and other
scripting languages