Motivation for SOAuosis.mif.vu.lt/~valdo/webs2015/WebServices.L07.pdf– # bits per word, parity...
Transcript of Motivation for SOAuosis.mif.vu.lt/~valdo/webs2015/WebServices.L07.pdf– # bits per word, parity...
Valdas Rapševičius Vilnius University
Faculty of Mathematics and Informatics
2015.05.28
Web Services Lecture VII
2015.05.28 Valdas Rapševičius. Webservices 1
Contents
• Introduction to Internet of Things (IoT) • Device
– Microcontrollers (MCU) – I/O Sensors – Interfaces – Wireless options – Power sources
• Aggregation – Protocols – Platforms
2015.05.28 Valdas Rapševičius. Webservices 2
The Internet of Things
• Also called The Internet of Objects, refers to a wireless network between objects, usually the network will be wireless and self-configuring, such as household appliances. Wikipedia
• By embedding short-range mobile transceivers into a wide array of additional gadgets and everyday items, enabling new forms of communication between people and things, and between things themselves WSIS2005
• A number of technologies and research disciplines that enable the Internet to reach out into the real world of physical objects. IoT 2008
• Things having identities and virtual personalities operating in smart spaces using intelligent interfaces to connect and communicate within social, environmental, and user contexts. IoT in 2020
2015.05.28 Valdas Rapševičius. Webservices 3
Connected Devices
Source: Cisco IBSG: April 2011
2015.05.28 Valdas Rapševičius. Webservices 4
Hype Cycle 2015
Source: Gartner, August 2014
2015.05.28 Valdas Rapševičius. Webservices 5
Gartner predictions 2014
• Gartner's 2015 predictions focus … closest attention to the Internet of Things (IoT), since it has introduced new concepts for identity management (every device interacting with users has an identity) and users and devices can have complex, yet defined, relationships.
• Further, as the smart wearables market continues to grow and evolve, Gartner predicts that by 2017, 30% of smart wearables will be completely unobtrusive to the eye
• Further predictions about the consumer devices market:
– By 2018, more than 25 million head-mounted displays (HMDs) will have been sold as immersive devices and virtual worlds will have transitioned from the fringe to the mainstream
– By 2016, biometric sensors will be featured in 40% of smartphones shipped to end users; – Through 2017, one-third of consumers in emerging markets will have never owned a Windows
device; – By 2018, more than 50% of users will use a tablet or smartphone first for all online activities – By 2018, 40% of enterprises will specify Wi-Fi as the default connection for non-mobile
devices, such as desktops, desk phones, projectors, conference room equipment – By 2020, 75% of smartphone buyers will pay less than $100 for a device – By 2018, more than half of all B2E mobile apps will be created by enterprise business analysts
using codeless tools; etc.
Source http://www.gartner.com/newsroom/id/2819918
2015.05.28 Valdas Rapševičius. Webservices 6
IoT Challenges
• Precision – Sensing a complex environment – Innovative ways to sense and deliver
information from the physical world to the cloud sensing
• Connectivity – Variety of wired and wireless connectivity
standards are required to enable different application needs sensing
• Power – Many IoT applications need to run for
years over batteries and reduce the overall energy consumption sensing
• Security – Protecting users' privacy and
manufacturers' IP; detecting and blocking malicious activity sensing
• Complexity – IoT application development needs to be
easy for all developers, not just to experts sensing
• End-to-end solution – IoT applications require end-to-end
solutions including cloud services sensing
2015.05.28 Valdas Rapševičius. Webservices 7
D2S Layout
I/O, Sensor
MCU
M2M
MCU
M2M
M
2S
Server
M2M protocol
M2M protocol
IoT device IoT
Aggregator IoT Bus
Pow
er
2015.05.28 Valdas Rapševičius. Webservices 8
Microcontroller (MCU)
I/O, Sensor
MCU
M2M
MCU
M2M
M
2S
Server
M2M protocol
M2M protocol
IoT device IoT
Aggregator IoT Bus
Pow
er
2015.05.28 Valdas Rapševičius. Webservices 9
From: PIC Microcontrollers by Milan Verle
MCU Components
2015.05.28 Valdas Rapševičius. Webservices 10
MCU: Types
• Architecture – Harvard (code & data use separate address space)
Small (old) MCUs, DSPs – Von Neumann (code & data can be mixed)
General purpose CPU & MCU – Modified Harvard (extension to mix data & instructions)
Most common MCU
• Instruction set – RISC (Reduced Instruction Set Computer)
Most common RISC microprocessors are Alpha, ARC, ARM, AVR, MIPS, PA-RISC, PIC, Power Architecture, and SPARC
– CISC (Complex Instruction Set Computer) System/360, VAX, PDP-11, Motorola 68000 family, and AMD and Intel x86 CPUs
2015.05.28 Valdas Rapševičius. Webservices 11
MCU: CPU
• Monitors and controls all processes inside the microcontroller
• Components: • Instruction Decoder
Recognizes program instructions and runs other circuits on the basis of that • Arithmetical Logical Unit (ALU)
Performs all mathematical and logical operations upon data. • Special function Registers (SFR):
• SP (stack pointer), • PSW (program status word), • A (accumulator, accessed via the SFR space as ACC) • B • DPL and DPH (16-bit register DPTR) • others
2015.05.28 Valdas Rapševičius. Webservices 12
MCU: Registers
• Register Electronic circuit which can memorize the state of one byte
• Special Function Register Register that has a predetermined function. Their bits are connected (literally) to internal circuits such as timers, A/D converter, oscillators and others
• Input/Output Ports Registers connect to MCU pins to read/write data to external devices. Usually each I/O port is under control of another SFR
2015.05.28 Valdas Rapševičius. Webservices 13
MCU: ROM
• Masked ROM Microcontrollers containing this ROM are reserved for the manufacturers. Program is loaded into the chip by the manufacturer. In case of large scale manufacture, the price is very low.
• One Time Programmable ROM (OTP ROM) If the microcontroller contains this memory, you can download a program into this memory, but the process of program downloading is a “one-way ticket”, meaning that it can be done only once. If an error is detected after downloading, the only thing you can do is to download the corrected program to another chip.
• UV Erasable Programmable ROM (UV EPROM) Both the manufacturing process and characteristics of this memory are completely identical to OTP ROM. However, the package of this microcontroller has a recognizable “window” on the upper side. It enables the surface of the silicon chip inside to be lit by an UV lamp, which effectively erases and program from the ROM.
• Flash memory The contents of this memory can be written and cleared practically an unlimited number of times, the microcontrollers with Flash ROM are ideal for learning, experimentation and small-scale manufacture. Because of its popularity, the most microcontrollers are manufactured in flash versions today.
2015.05.28 Valdas Rapševičius. Webservices 14
MCU: RAM
• Random Access Memory (RAM) It is used for temporary storing data and intermediate results created and used during the operation of the microcontroller
• Electrically Erasable
Programmable ROM (EEPROM) The contents of the EEPROM may be changed during operation (similar to RAM), but remains permanently saved even upon the power supply goes off (similar to ROM). Accordingly, an EEPROM is often used to store values, created during operation, which must be permanently saved.
2015.05.28 Valdas Rapševičius. Webservices 15
MCU: Oscillator
• The internal oscillator circuit is used to generate the device clock. The device clock is required for the device to execute instructions and for the peripherals to function.
• Usually frequency is pre-scaled 1/100, 1/200, etc.
• MCU options – Internal oscillator – External oscillator
• Types:
– RC Oscillators – Crystal Oscillators – Negative-resistance Oscillators – Tuned Circuit Oscillators
2015.05.28 Valdas Rapševičius. Webservices 16
MCU: Counters
• Automatically inc/decr SFR
• If available – possible to use pre-scalers
• When point is reached – Interrupt – Execute procedure
• Real-time Counters (RTC)
• Watchdog Uses external oscillator to reset program
2015.05.28 Valdas Rapševičius. Webservices 17
MCU: Analog-to-Digital Converter
• Analog-to-Digital Converter (ADC) are used to communicate with digital circuits in a manner that goes beyond simple threshold triggering
• Converts an analog signal into a series of binary numbers, each number being proportional to the analog level measured at a given moment
• Used in data-acquisition systems, digital sound recording, and within simple digital display test instruments (e.g., light meters, thermometers, etc.)
2015.05.28 Valdas Rapševičius. Webservices 18
I/O Components (Sensors)
I/O, Sensor
MCU
M2M
MCU
M2M
M
2S
Server
M2M protocol
M2M protocol
IoT device IoT
Aggregator IoT Bus
Pow
er
2015.05.28 Valdas Rapševičius. Webservices 19
Sensors
• Sensors act like Inductors Capacitors Resistors
• Value changes in proportion to physical stimuli
• Types: • Analog • Digital
2015.05.28 Valdas Rapševičius. Webservices 20
I/O Components
Sensors • Accelerometer / Movement • Atmospheric Pressure • Color Sensor • Compass, Gyro & Magnetometers • Digital Potentiometer • Electricity • Flex / Force • Gas Sensors • GPS • Light / Proximity / IR • Liquid / Flow • Medical • Motor • Temperature / Humidity • Time • Touch Sensors • Others
Manual Input
• Button • Switch / Jumper
Output
• O/LED (array, bar) • LCD display • Sound • Motor / Servo • Other
2015.05.28 Valdas Rapševičius. Webservices 21
Analog Sensor to MCU
I/O, Sensor
MCU
M2M
MCU
M2M
M
2S
Server
M2M protocol
M2M protocol
IoT device IoT
Aggregator IoT Bus
Pow
er
2015.05.28 Valdas Rapševičius. Webservices 22
Analog Sensor Interfaces
• GPIO (General Purpose I/O) pins • Sensors as Switches • Analog sensor:
– On board MCU ADC (recommended) – Discrete ADC
• Digital sensor: – Serial interfaces (next slides)
MCU
MCU
MCU
2015.05.28 Valdas Rapševičius. Webservices 23
Component Serial Interfaces
I/O, Sensor
MCU
M2M
MCU
M2M
M
2S
Server
M2M protocol
M2M protocol
IoT device IoT
Aggregator IoT Bus
Pow
er
2015.05.28 Valdas Rapševičius. Webservices 24
Serial Interfaces (1)
• 1-Wire
– 1 wire (DATA) + ground – Master and slaves – Up to 16 kbit/s
• I2C (TWI, 2-Wire)
– 2 wire (SCL, SDA) + 2 power – Master and slaves – Up to 400 kbit/s
• SPI (Serial Peripheral Interface)
– 4 wire (SCLK, MOSI, MISO, SDA, SS) – Master and slaves – Up to 80 Mbit/s
2015.05.28 Valdas Rapševičius. Webservices 25
Serial Interfaces (2)
• Serial (Transistor Transistor Logic, TTL)
– Fixed bound rates (110 to 256000) – # bits per word, parity bit, # of start and end bits (8N1) – Timing is critical
• Universal Asynchronous Receiver/Transmitter
– A piece of computer hardware that translates data between parallel and serial forms – The "universal" part means that it can be configured to support many different
specific serial protocols. The term is generic, and does not represent a specific standard. At minimum it means that it has a TX and an RX line, which sends a serial data stream and receives a serial data stream.
UART D0 D1 D2 D3 D4 D5 D6 D7 R/W CLK INT
RX
TX
Control I/O
Data Bus
Para
llel Serial
2015.05.28 Valdas Rapševičius. Webservices 26
M2M protocols
I/O, Sensor
MCU
M2M
MCU
M2M
M
2S
Server
M2M protocol
M2M protocol
IoT device IoT
Aggregator IoT Bus
Pow
er
2015.05.28 Valdas Rapševičius. Webservices 27
D2A/D Protocols
• WWAN – 4G, 3G, GPRS
900 MHz, 1800 MHz, US: 850 MHz, 1900 MHz
– WiMAX (802.16 standard) 2.3 GHz, 2.5 GHz, 3.5 GHz
• WLAN
– WiFi (802.11 standards) 2.4 GHz
• WBAN
– IEEE 802.15.6 2.4 GHz
• WPAN – Bluetooth incl. Bluetooth Low
Energy (BLE, SMART) V4 – ANT, ANT+
2.4 GHz – Zigbee / 802.15.4
868 MHz, 2.4 GHz – NFC (Near Field
Communication) 13.56 MHz
– INSTEON – Z-Wave
902 to 924 MHz – Wireless USB
3.1 to 10.6 GHz – Infrared Data Association
(IrDA)
2015.05.28 Valdas Rapševičius. Webservices 28
ISM Radio Bands
Frequency range Example
6.765 MHz 6.795 MHz RFID
13.553 MHz 13.567 MHz NFC
26.957 MHz 27.283 MHz Citizens Radio
40.660 MHz 40.700 MHz Toys
433.050 MHz 434.790 MHz Amateur radio
902.000 MHz 928.000 MHz Amateur radio
2.400 GHz 2.500 GHz WiFi, Bluetooth, …
5.725 GHz 5.875 GHz WiFi
24.000 GHz 24.250 GHz Vehicle radars
61.000 GHz 61.500 GHz
122.000 GHz 123.000 GHz
244.000 GHz 246.000 GHz
• Band - portions of the radio spectrum
• The industrial, scientific and medical (ISM) radio bands are radio bands reserved internationally for the use of radio frequency (RF) energy for industrial, scientific and medical purposes other than telecommunications
• In recent years the fastest-growing uses of these bands have been for short-range, low power communications systems
• IoT
2015.05.28 Valdas Rapševičius. Webservices 29
Power Source
I/O, Sensor
MCU
M2M
MCU
M2M
M
2S
Server
M2M protocol
M2M protocol
IoT device IoT
Aggregator IoT Bus
Pow
er
2015.05.28 Valdas Rapševičius. Webservices 30
Batteries
• Convert stored chemical energy into electrical energy
• Batteries – Primary (irreversible) – Secondary (rechargeable)
• Characteristics – Voltage (V) – Capacity (Ah) – Discharge rate (C-rate)
• Tens of types • Hundreds of sizes
– IEC, ANSI, industry
2015.05.28 Valdas Rapševičius. Webservices 31
Energy Harvesting
• Biomechanical – Pedal, knee bend, …
• Piezoelectric – Mechanical strain
• Pyroelectric – Temperature change
• Thermoelectrics – Temperature difference
• Ambient-radiation – RFID
• Photovoltaic – Solar
• Others
2015.05.28 Valdas Rapševičius. Webservices 32
Aggregator Protocols
I/O, Sensor
MCU
M2M
MCU
M2M
M
2S
Server
M2M protocol
M2M protocol
IoT device IoT
Aggregator IoT Bus
Pow
er
2015.05.28 Valdas Rapševičius. Webservices 33
D2S protocols
• Device data must be collected and sent to the server infrastructure (D2S) • Real-time publish-subscribe IoT protocol • Must connect thousands of devices
• Generic
– TCP/IP – HTTP (Restful API)
• Specialized
– CoAP (RFC 7252 Constrained Application Protocol)
• REST model for small devices – MQTT (Message Queue Telemetry Transport)
• a protocol for collecting device data and communicating it to servers (D2S) • real-time publish-subscribe IoT protocol • On top of TCP/IP
– XMPP (Extensible Messaging and Presence Protocol) • Previous Jabber • a protocol best for connecting devices to people, a special case of the D2S pattern, since people are connected to the servers • XML, HTTP, TCP/IP
– DDS (Data Distribution Service) • a fast bus for integrating intelligent machines (D2D) • OMG M2M middleware
– AMQP (Advanced Message Queuing Protocol) • a queuing system designed to connect servers to each other (S2S) • On top of TCP/IP • Different formats
2015.05.28 Valdas Rapševičius. Webservices 34
CoAP
• http://coap.technology/ • Debugging URL: http://coap.me • 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
• Asynchronous over a datagram-oriented transport such as UDP – The CoAP messaging model is based on the exchange of messages over UDP between
endpoints – Uses a short fixed-length binary header (4 bytes) that may be followed by compact binary
options and a payload
2015.05.28 Valdas Rapševičius. Webservices 35
CoAP Examples
2015.05.28 Valdas Rapševičius. Webservices 36
D2S Examples
2015.05.28 Valdas Rapševičius. Webservices 37
Service Bus
I/O, Sensor
MCU
M2M
MCU
M2M
M
2S
Server
M2M protocol
M2M protocol
IoT device IoT
Aggregator IoT Bus
Pow
er
2015.05.28 Valdas Rapševičius. Webservices 38
IoT Platforms
• Functions – Routing
• To other servers (S2S) • To analysis programs • To people • Back to devices (S2D)
– Analysis (BigData) – Visualization – Monitoring – Control
• Vendors
– Microsoft Azure IoT services – Google Cloud – Oracle’s Internet of Things platform – Carriots – TIWIConnect by LSR – Realtimeio – … many others
Source: TIWIConnect
2015.05.28 Valdas Rapševičius. Webservices 39
Iot Platform Examples (1)
2015.05.28 Valdas Rapševičius. Webservices 40
Iot Platform Examples (2)
2015.05.28 Valdas Rapševičius. Webservices 41
Conclusions
• Subject is complex – IT, electronics, radio,
subject, … • Constant flux
– New devices, components, protocols, …
• Promises are high – Wearables – Smart home – Smart city – Smart manufacturing – Health care – Automative – Retail
2015.05.28 Valdas Rapševičius. Webservices 42