IOT Notes AllUnits PDF
IOT Notes AllUnits PDF
UNIT I - INTRODUCTION
Internet of Things -Domain Specific IoTs -IoT and M2M -Sensors for IoT
Applications– Structure of IoT - IoT Map Device- IoT System Management with
NETCONF-YANG
SCADA and RFID Protocols - BACnet Protocol -Zigbee Architecture - 6LowPAN - CoAP
-Wireless Sensor Structure–Energy Storage Module–Power Management
Module–RF Module–Sensing Module
The Cloud types; IaaS, PaaS, SaaS.- Development environments for service
development; Amazon, Azure, Google Appcloud platform in industry
Building IoT with RASPBERRY Pi- Creating the sensor project - Preparing
Raspberry Pi - Clayster libraries – Hardware Interacting with the hardware -
Interfacing the hardware- Internal representation of sensor values - Persisting
data - External representation of sensor values - Exporting sensor data
Page 1
UNIT I - INTRODUCTION
Internet of Things -Domain Specific IoTs -IoT and M2M -Sensors for IoT
Applications– Structure of IoT - IoT Map Device- IoT System Management with
NETCONF-YANG
1) Home Automation:
b) Smart Appliances: make the management easier and also provide status
information to the users remotely.
c) Intrusion Detection: use security cameras and sensors(PIR sensors and door
sensors) to detect intrusion and raise alerts. Alerts can be in the form of
SMS or email sent to the user.
2) Cities:
a) Smart Parking: make the search for parking space easier and convenient
for drivers. Smart parking are powered by IoT systems that detect the no.
of empty parking slots and send information over internet to smart
application backends.
b) Smart Lighting: for roads, parks and buildings can help in saving energy.
f) Emergency Response: IoT systems for fire detection, gas and water
leakage detection can help in generating alerts and minimizing their
effects on the critical infrastructures.
Page 2
3) Environment:
d) Forest Fire Detection: Forest fire can cause damage to natural resources,
property and human life. Early detection of forest fire can help in
minimizing damage.
e) River Flood Detection: River floods can cause damage to natural and human
resources and human life. Early warnings of floods can be given by
monitoring the water level and flow rate. IoT based river flood monitoring
system uses a no. of sensor nodes that monitor the water level and flow
rate sensors.
4) Energy:
Page 3
predicting failures.
5) Retail:
Page 4
b) Smart Payments: Solutions such as contact-less payments powered by
technologies such as Near Field Communication(NFC) and Bluetooth.
6) Logistics:
a) Route generation & scheduling: IoT based system backed by cloud can
provide first response to the route generation queries and can be scaled
upto serve a large transportation network.
7) Agriculture:
8) Industry:
b) Wearable Electronics
Page 5
2. IoT Systems Management with
NETCONF-YANG
1. Management System
2. Management API
3. Transaction Manager
4. Rollback Manager
5. Data Model Manager
6. Configuration Validator
7. Configuration Database
8. Configuration API
9. Data Provider API
5. Data Model Manager : Keeps track of all the YANG data models and the
corresponding managed objects. Also keeps track of the applications
which provide data for each part of a data model.
8. Configuration API : Using the configuration API the application on the IoT
device can be read configuration data from the configuration datastore and
write operational data to the operational datastore.
9. Data Provider API: Applications on the IoT device can register for
callbacks for various events using the Data Provider API. Through the
Data Provider API, the applications can report statistics and
Page 6
operational ldata.
Page 7
3. Structure of IoT
IoT architecture varies from solution to solution, based on the type of solution
which we intend to build. IoT as a technology majorly consists of four main
components, over which an architecture is framed.
Stage 1: Sensors/actuators
Sensors collect data from the environment or object under measurement
and turn it into useful data. Think of the specialized structures in your cell
phone that detect the directional pull of gravity and the phone's relative
position to the ― thing‖ we call the earth and convert it into data that
Page 8
your phone can use to orient the device.
Page 9
Actuators can also intervene to change the physical conditions that
generate the data. An actuator might, for example, shut off a power supply,
adjust an air flow valve, or move a robotic gripper in an assembly process.
Stage 3: Edge IT
Once IoT data has been digitized and aggregated, it's ready to cross into
the realm of IT. However, the data may require further processing before it
enters the data center.
This is where edge IT systems, which perform more analysis, come into play.
Edge IT processing systems may be located in remote offices or other edge
locations, but generally these sit in the facility or location where the sensors
reside closer to the sensors, such as in a wiring closet. Because IoT data can
easily eat up network bandwidth and swamp your data center resources, it's
best to have systems at the edge capable of performing analytics as a way to
lessen the burden on core IT infrastructure. You'd also face security concerns,
storage issues, and delays processing the data. With a staged approach, you
can preprocess the data, generate meaningful results, and pass only those on.
For example, rather than passing on raw vibration data for the pumps, you
could aggregate and convert the data, analyze it, and send only projections as
to when each device will fail or need service.
Page
10
systems, where more powerful IT systems can analyze, manage, and securely
store the data. It takes longer to get results when you wait until data reaches
Stage 4, but you can execute a more in-depth analysis, as well as combine
your sensor data with data from other sources for deeper insights. Stage 4
processing may take place on-premises, in the cloud, or in a hybrid cloud
system, but the type of processing executed in this stage remains the same,
regardless of the platform.
Page
11
4. IoT and M2M
Machine-to-Machine (M2M)
Fig. Shows the end-to-end architecture of M2M systems comprises of M2M area
networks, communication networks and application domain.
An M2M area network comprises of machines( or M2M nodes) which
have embedded network modules for sensing, actuation and
communicating various communication protocols can be used for M2M
LAN such as ZigBee, Bluetooth, M- bus, Wireless M-Bus etc., These
protocols provide connectivity between M2M nodes within an M2M area
network.
The communication network provides connectivity to remote M2M area
networks. The communication network can use either wired or wireless
network(IP based). While the M2M are networks use either
properietorary or non-IP based communication protocols, the
communication network uses IP-based network. Since non-IP based
protocols are used within M2M area network, the M2M nodes within
one network cannot communicate with nodes in an external network.
To enable the communication between remote M2M are network, M2M
gateways are used.
Page
12
Fig. Shows a block diagram of an M2M gateway. The communication between M2M
nodes and the M2M gateway is based on the communication protocols which
are naive to the M2M are network. M2M gateway performs protocol
translations to enable Ip-connectivity for M2M are networks. M2M gateway acts
as a proxy performing translations from/to native protocols to/from Internet
Protocol(IP). With an M2M gateway, each mode in an M2M area network
appears as a virtualized node for external M2M area networks.
1) Communication Protocols:
• Commonly uses M2M protocols include ZigBee, Bluetooth,
ModBus, M-Bus, Wireless M-Bus tec.,
• In IoT uses HTTP, CoAP, WebSocket , MQTT ,XMPP ,DDS ,AMQP etc.,
5) Applications
• M2M data is collected in point solutions and can be accessed by on-
premises applications such as diagnosis applications, service
management applications, and on- premisis enterprise applications.
• IoT data is collected in the cloud and can be accessed by cloud
applications such as analytics applications, enterprise applications,
remote diagnosis and management applications, etc.
Page
13
UNIT II - IoT ARCHITECTURE, GENERATIONS AND PROTOCOLS
IETF architecture for IoT - IoT reference architecture -First Generation – Description
& Characteristics–Advanced Generation – Description & Characteristics–
Integrated IoT Sensors – Description & Characteristics
➢
6LoWPAN (IPv6 over Low-power WPAN), CoRE (Constrained
RESTful Environments), and ROLL (Routing Over Low power and
Lossy networks).
➢
Each set of specifications makes an attempt to address a different part of
the communication stack of a constrained device.
➢
One layer called Application Support which includes the
Presentation and Session Layers combined. one intermediate
layer is introduced: the Adaptation Layer
➢
It positioned between the Physical/Data Link and the Network Layer and
whose main function is to adapt the Network Layer packets to
Phy/Link layer packets among others.
➢
An example of an adaptation layer is the 6LoWPAN layer designed to adapt
IPv6 packets to IEEE 8021.5.4/Bluetooth Low Energy (BLE)/DECT Low
Energy packets.
➢
An example of an Application Support Layer is IETF Constrained
Application Protocol (CoAP), which provides reliability and RESTful
operation support to applications; however, it does not describe
the specific names of resources a node should host.
➢
The IETF CoAP draft specification describes the Transport and Application
Support Layers, which essentially defines the transport packet
formats, reliability support on top of UDP, and a RESTful
application protocol with GET/PUT/POST/DELETE methods similar
to HTTP with CoAP clients operating on CoAP server resources.
➢
A CoAP server is just a logical protocol entity, and the name “server” does
Page
14
not necessarily imply that its functionality is deployed on a very powerful
Page
15
machine; a CoAP server can be hosted on a constrained device.
➢
The CoRE Link Format specification describes a discovery method
for the CoAP resources of a CoAP server.
➢
For example, a CoAP client sending a request with the GET method to a
specific well defined server resource (./well-known/core) should
receive a response with a list of CoAP resources and some of their
capabilities (e.g. resource type, interface type).
➢
The CoRE interface specification describes interface types and
corresponding expected behavior of the RESTful methods.
➢
The IETF stack for IoT does not currently include any specifications
that are similar to the profile specifications of other IoT
technologies such as ZigBee
➢
Profile specification means a document that describes a list of profile
names and their mappings to specific protocol stack behavior,
specific information model, and specific serialization of this
information model over the relevant communication medium.
➢
An example of a profile specification excerpt would mandate that an
exemplary “Temperature” profile:
(a) should support a resource called /temp,
(b) the resource /temp must respond to a GET method request from a client, and
(c) the response to a GET method request shall be a temperature
value in degrees Celsius formatted as a text string with the format
“,temperature value encoded in a decimal number ._C”
➢
A Resource Directory is a CoAP server resource (/rd) that maintains a list of
resources, their corresponding server contact information (e.g. IP
addresses or fully qualified domain name, or FQDN), their type,
interface, and other information similar to the information that the
CoRE Link Format document specifies.
Page
16
➢
An RD plays the role of a rendezvous mechanism for CoAP Server
resource descriptions, in other words, for devices to publish the
descriptions of the available resources and for CoAP clients to
locate resources that satisfy certain criteria such as specific
resource types. (e.g. temperature sensor resource type).
➢
Resource Directory is a rendezvous mechanism for CoAP Server resource
descriptions, a Mirror Server is a rendezvous mechanism for CoAP
Server resource presentations.
➢
A Mirror Server is a CoAP Server resource (/ms) that maintains a list of
resources and their cached representations (Figure 6.8b).
➢
A CoAP Server registers its resources to the Mirror Server, and
upon registration a new mirror server resource is created on the
Mirror Server with a container (mirror representation) for the
original server representation.
➢
The original CoAP Server updates the mirror representation either
periodically or when the representation changes.
➢
A CoAP Client that retrieves the mirror representation receives the
latest updated representation from the original CoAP Server. The
Mirror Server is useful when the CoAP Server is not always
available for direct access.
➢
An example of such a CoAP Server is one that resides on a real device
whose communication capabilities are turned off in order to
preserve energy, e.g. battery- powered radio devices whose radio
and/or processor goes to sleep mode.
➢
Typically, a Mirror Server is hosted on a device or machine that is always
available.
➢
The IETF CoRE workgroup has included the fundamentals of a
mapping process between HTTP and CoAP in the IETF CoAP
specification as well as a set of guidelines for the interworking
between HTTP and CoAP.
➢
The main is the different transport protocols used by the HTTP and CoAP:
HTTP uses TCP while CoAP uses UDP.
➢
The guidelines focus more on the HTTP-to-CoAP proxy and
recommend addressing schemes (e.g. how to map a CoAP
resource address to an HTTP address), mapping between HTTP
and CoAP response codes, mapping between different media
types carried in the HTTP/CoAP payloads, etc.
➢
HTTP Client sends an HTTP request to a CoAP server (Figure 6.9a)
through a Gateway Device hosting an HTTP-CoAP Cross Proxy.
➢
The Gateway Device connects to the Internet via an Ethernet
cable using a LAN, and on the CoAP side the CoAP server resides
on a Sensor/Actuator (SAN) based on the IEEE 802.15.4 PHY/MAC.
➢
The HTTP request needs to include two addresses, one for
reaching the Cross Proxy and one for reaching the specific CoAP
Page
17
Server in the SAN.
➢
The request is in plain text format and contains the method (GET). It
traverses the IPv4 stack of the client, reaches the gateway, traverses the
Page
18
IPv4 stack of the gateway and reaches the Cross proxy.
➢
The request is translated to a CoAP request (binary format) with a
destination CoAP resource coap://s.coap.example.com/foo, and it
is dispatched in the CoAP stack of the gateway, which sends it
over the SAN to the end device.
➢
A response is sent from the end device and follows the reverse path in the
➢
Architecture Reference Model (ARM) consists of two main parts:
1. a Reference model
2. a Reference Architecture.
➢
The foundation of an IoT Reference Architecture description is an IoT
reference model.
➢
A System Architecture is a communication tool for different
stakeholders of the system.
➢
Developers, component and system managers, partners,
suppliers, and customers have different views of a single
Page
19
system based on their
Page
20
requirements and their specific interactions with the system.
➢
The high-level abstraction is called Reference Architecture as it
serves as a reference for generating concrete architectures and
actual systems, as shown in the Figure 7.2.
➢
Concrete architectures are instantiations of rather abstract and
high-level Reference Architectures.
➢
A Reference Architecture captures the essential parts of an architecture,
such as design principles, guidelines, and required parts (such as
entities), to monitor and interact with the physical world for the
case of an IoT Reference Architecture.
➢
A concrete architecture can be further elaborated and mapped
into real world components by designing, building, engineering,
and testing the different components of the actual system.
Page
21
➢
The general essentials out of multiple concrete architectures can
then are aggregated, and contribute to the evolution of the
Reference Architecture.
➢
It has two types of Architecture:
Three Layered Architecture
Five Layered Architecture
(i) The perception layer is the physical layer, which has sensors for
sensing and gathering information about the environment. It
senses some physical parameters or identifies other smart objects
in the environment.
(ii) The network layer is responsible for connecting to other smart
things, network devices, and servers. Its features are also used for
transmitting and processing sensor data.
(iii) The application layer is responsible for delivering application
specific services to the user. It defines various applications in
which the Internet of Things can be deployed, for example, smart
homes, smart cities, and smart health.
➢
The three-layer architecture defines the main idea of the Internet
of Things, but it is not sufficient for research on IoT because
research often focuses on finer aspects of the Internet of Things.
Page
23
➢
The layers are :
✓ Client/external communications - Web/Portal, Dashboard, APIs
✓ Event processing and analytics (including data storage)
✓ Aggregation/bus layer – ESB and message broker
✓ Relevant transports - MQTT/HTTP/XMPP/CoAP/AMQP, etc.
✓ Devices
➢
The cross-cutting layers are :
✓ Device manager
✓ Identity and access management
Page
24
• A UUID provided by the radio subsystem (e.g. Bluetooth
identifier, Wi- Fi MAC address)
Page
25
• An OAuth2 Refresh/Bearer Token
• An identifier stored in nonvolatile memory such as EEPROM
➢
The most well known three potential protocols are :
➢
The API management layer provides three main functions:
• The first is that it provides a developer-focused portal where
developers can find, explore, and subscribe to APIs from the
system. There is also support for publishers to create, version, and
manage the available and published APIs;
• The final aspect is that the gateway publishes data into the
Page
27
analytics layer where it is stored as well as processed to provide
insights into how the APIs are used.
Page
28
G. Device Management
➢
Device management (DM) is handled by two components.
➢
A server-side system (the device manager) communicates with
devices via various protocols and provides both individual and
bulk control of devices.
➢
It also remotely manages software and applications deployed on the device.
➢
It can lock and/or wipe the device if necessary.
➢
The device manager works in conjunction with the device management agents.
➢
There are multiple different agents for different platforms and device types.
➢
The device manager also needs to maintain the list of device
identities and map these into owners.
➢
It must also work with the identity and access management layer to
manage access controls over devices.
➢
There are three levels of device: non-managed, semi-managed
and fully managed (NM, SM, FM).
➢
A full DM agent supports:
• Managing the software on the device
• Enabling/disabling features of the device (e.g. camera, hardware, etc.)
• Management of security controls and identifiers
• Monitoring the availability of the device
• Maintaining a record of the device’s location if available
Page
29
UNIT III - IoT PROTOCOLS AND TECHNOLOGY
SCADA and RFID Protocols - BACnet Protocol -Zigbee Architecture - 6LowPAN - CoAP
-Wireless Sensor Structure–Energy Storage Module–Power Management Module–RF
Module–Sensing Module
SCADA:
SCADA (supervisory control and data acquisition) is a category of software
applications for controlling industrial processes, which is the gathering of data
in real time from remote locations in order to control equipment and
conditions. SCADA provides organizations with the tools needed to make and
deploy data-driven decisions regarding their industrial processes.
SCADA PROTOCOL:
Industrial automation has a variety of vertical markets and there are also many
types of SCADAs. IEEE created a standard specification, called Std C37.1™, for
SCADA and automation systems [116] in 2007, targeting mostly power SCADA
applications. It’s recognized in the specification that in recent years, network-
based industrial automation has greatly evolved with the use of intelligent
electronic devices (IEDs), or IoT devices in our terms, in substations and power
stations. The processing is now distributed, and functions that used to be done
at the control center can now be done by the IED, that is, M2M between
devices. Despite the fact that many functions can be moved to the IED, utilities
still need a master station, the IoT platform, for the operation of the power
system. Due to the restructuring of the electric industry, traditional vertically
integrated electric utilities are replaced by many entities such as GENCO
(Generation Company), TRANSCO (Transmission Company), DISCO (Distribution
Company), ISO (independent system operator), RTO (regional transmission
organization), and so forth. To fulfill their role, each of these entities needs a
control center, that is, a substation, to receive and process data and take
appropriate control actions.
Page
30
Scenario showing integrated SCADA system to IoT
OPC, which stands for Object Linking and Embedding (OLE) for Process Control,
is the original name for a standard specification developed in 1996 by an
industrial automation industry task force. The standard specifies the
communication of real-time plant data between control devices from different
manufacturers.
OPC was designed to provide a common bridge for Windows-based software
applications and process control hardware. Standards define consistent
methods of accessing field data from plant floor devices. This method remains
the same regardless of the type and source of data. An OPC server for one
hardware device provides the same methods for an OPC client to access its
data as each and every other OPC server for that same or another hardware
device. The aim was to reduce the amount of duplicated effort required from
hardware manufacturers and their software partners, and from the SCADA and
other HMI producers, in order to interface the two. When a hardware
manufacturer had developed their OPC server for the new hardware device,
their work was done to allow anyone to access their device; and when the
SCADA producer had developed their OPC client, their work was done to allow
access to any hardware, existing or yet to be created, with an OPC-compliant
server.
OPC has achieved great success in many application areas, most of them
closely related to or part of IoT applications. However, OPC’s success story is
accompanied by some caveats. For example, standard OPC DA (data access) is
based on Microsoft’s COM and DCOM technology and is consequently restricted
to the Windows operating system. In addition, DCOM communication is easily
blocked by firewalls that prevent OPC clients from accessing data over a wide-
area network and the World Wide Web. New approaches, such as XML-DA and
United Architecture (UA) [234], have been developed to make OPC technology
available on other platforms or accessible by other systems.
Page
31
The RFID protocols and data formats are relatively well defined, mostly by
EPCglobal, and unified compared with protocols and formats of the other three
pillars of IoT. The RFID protocols (such as PML, Object Naming Service
[ONS], Edgeware, EPC Information
Page
32
Service [EPCIS], Application Level Event [ALE], etc.) have been described in the
previous chapters, so we will talk only about protocols for the related
contactless smart cards here.
RFID:
RFID or Radio Frequency Identification is an automatic identification method
that uses wireless non-contact radio frequency waves in which data is digitally
encoded in RFID tags or smart labels which can be read by reader through
radio waves.
RFID PROTOCOL:
The RFID protocols and data formats are relatively well defined, mostly by EPC
global, and unified compared with protocols and formats of the other three
pillars of IoT. The RFID protocols (such as PML, Object Naming Service [ONS],
Edgeware, EPC Information Service [EPCIS], Application Level Event [ALE], etc.)
have been described in the previous chapters, so we will talk only about
protocols for the related contactless smart cards here.
The smart cards with contactless interfaces (RFID is a subset) are becoming
increasingly popular for payment and ticketing applications such as mass
transit and stadiums.
The standard for contactless smart card communications is ISO/IEC 14443. It
defines two types of contactless cards (A and B) and allows for
communications at distances up to 10 cm. An alternative standard for
contactless smart cards is ISO/IEC 15693, which allows communications at
distances up to 50 cm.
Working of RFID Protocol
Page
33
2. BACnet Protocol
Page
34
layer takes on the functions of these two layers.
Page
35
BACnet Physical Layer
The upper layers of BACnet do not depend on the physical layer. So the
Physical layer of BACnet makes it feasible for BACnet to be executed on
different networks. The physical layers of BACnet have been specified with
ARCNET, Ethernet, IP tunnels, BACnet/IP, RS-232, RS485, and
Lonworks/LonTalk. RS232 is for point-to-point communication. RS485 supports
up to 32 nodes with a distance of 1200 m at 76Kbps.
BACnet Protocol Link Layer
BACnet protocol is implemented directly with LonTalk or IEEE802.2 link
layers. So it specifies Point to Point (PTP) data link layer for RS232 connections.
It specifies MS/TP data link layer intended for RS-485 connections. The
standard simply specifies BVLL (BACnet Virtual Link Layer) which states all the
services required through the BACnet device at this link layer.
IP BACnet Virtual Link Layer encapsulates required control data in a
header of BACnet virtual link control information. Because of IP, BVLL, and
BACnet protocol devices can directly communicate over IP networks without
the requirement of any router device.
BACnet protocol utilizes BBMD (BACnet broadcast management device)
concept which executes the required broadcast for the preferred link layer. So,
the BACnet broadcast message is changed into IP-based broadcast or multicast
messages.
BACnet Network Layer
This layer simply specifies the required addresses of the network for routing.
BACnet network includes a minimum of one or above segments that are
connected with bridges once they utilize similar LAN technologies. If they
utilize various LAN protocols then they are connected through routers.
Application Layer
BACnet does not separate presentation as well as application layers. So
it takes care of reliability & sequencing or segmentation mechanisms
generally connected with both the session & transport layers. BACnet includes
devices like objects to exchange service primitives which are described with
ASN.1 syntax & serialized with ASN.1 BER.
BACnet Security Layer
The concept of BACnet security can be understood easily with an
example say when BACnet device-A requests a session key from the key
server for establishing secure communication through device-B, then this key
is transmitted to both the device-A & device-B through the key server which is
known as ‘SKab’. BACnet protocol uses 56-bit DES encryption.
Advantages
The advantages of the Bacnet Protocol include the following.
• BACnet protocol is particularly designed for building automation as well
Page
36
as control networks.
• It doesn’t depend on present LAN or WAN technologies.
• It is an American National Standard & a European pre-standard.
Page
37
• It is scalable completely from small single building applications to
universal networks of devices.
• The implementers of BACnet can securely include non-standard
extensions as well as enhancements without influencing existing
interoperability.
• It is adopted by the most famous fire protection companies in both
the USA & Europe.
• It is supported by different chiller manufacturers like Dunham-
Bush, Carrier, McQuay, York & Trane.
• In real building control applications, this protocol has a proven track record.
Disadvantages
The disadvantages of the Bacnet Protocol include the following.
• The main drawback of the BACnet protocol was a compliant problem. So
because of this issue, the BTL (BACnet Testing Laboratories) was
introduced in the year 2000. BTL is compliance & and independent testing
organization. The main intention of this is to test the products of BACnet
to verify compliance with the standard. Once approved; the product will
get the logo of BTL.
• The problems or net-worthy attacks which are widely found in this protocol
are; Lack of spoofing & authentication, DoS attacks, immobilized network
connections, and lack of encryption & write access over devices.
Applications
The use of Bacnet Protocol includes the following.
• The BACnet is used in HVAC applications, fire control lighting
control, security, alarm & interfacing to utility companies.
• This protocol was particularly designed for building automation as well
as control applications.
• This protocol is used to provide mechanisms, especially for automation
devices for exchanging data irrespective of the specific building service
they perform.
• This protocol can be used by digital controllers, computers &
application-specific otherwise unitary controllers with equivalent
effect.
• BACnet protocol was initially developed to develop interoperability
between building automation devices; however, its data descriptions, as
well as flexible architecture, will make it work within a broad range of
control applications.
• This is an object-oriented protocol, so used to signify network-
Page
38
accessible control equipment.
Page
39
3. Zigbee Architecture
ZigBee is a Personal Area Network task group with low rate task group 4. It is a
technology of home networking. ZigBee is a technological standard created
for controlling and sensing the network. As we know that ZigBee is the Personal
Area network of task group 4 so it is based on IEEE 802.15.4 and is created by
Zigbee Alliance.
ZigBee is a standard that addresses the need for very low-cost implementation of
Low power devices with Low data rates for short-range wireless
communications.
Operating Frequency Bands (Only one channel will be selected for use in a network):
Page
41
Zigbee Network Topologies:
Architecture of Zigbee:
1. Application Layer
2. Network Layer
3. Medium Access Control Layer
4. Physical Layer
• Medium Access Control layer (MAC layer): The layer is responsible for
the interface between the physical and network layer. The MAC
layer is also responsible for providing PAN ID and also network
discovery through beacon requests.
• Network layer: This layer acts as an interface between the MAC layer
and the application layer. It is responsible for mesh networking.
• Application layer: The application layer in the Zigbee stack is the highest
protocol layer and it consists of the application support sub-layer and
Zigbee device object. It contains manufacturer-defined applications.
Channel Access:
Zigbee Applications:
1. Home Automation
Page
42
2. Medical Data Collection
3. Industrial Control Systems
4. meter reading system
5. light control system
Page
43
4. 6LowPAN
6LoWPAN is an IPv6 protocol, and It’s extended from is IPv6 over Low Power
Personal Area Network. As the name itself explains the meaning of this protocol
is that this protocol works on Wireless Personal Area Network i.e., WPAN.
WPAN is a Personal Area Network (PAN) where the interconnected devices are
centered around a person’s workspace and connected through a wireless
medium. You can read more about WPAN at WPAN. 6LoWPAN allows
communication using the IPv6 protocol. IPv6 is Internet Protocol Version 6 is a
network layer protocol that allows communication to take place over the
network. It is faster and more reliable and provides a large number of
addresses.
It comprises an Edge Router and Sensor Nodes. Even the smallest of the IoT
devices can now be part of the network, and the information can be
transmitted to the outside world as well. For example, LED Streetlights.
• 6LoWPAN can interact with 802.15.4 devices and also other types of
devices on an IP Network. For example, Wi-Fi.
• It uses AES 128 link layer security, which AES is a block cipher having key
size of 128/192/256 bits and encrypts data in blocks of 128 bits each.
This is defined in IEEE 802.15.4 and provides link authentication and
Page
44
encryption.
Page
45
Basic Requirements of 6LoWPAN:
1. The device should be having sleep mode in order to support the battery saving.
2. Minimal memory requirement.
3. Routing overhead should be lowered.
Features of 6LoWPAN:
Advantages of 6LoWPAN:
1. 6LoWPAN is a mesh network that is robust, scalable, and can heal on its own.
2. It delivers low-cost and secure communication in IoT devices.
3. It uses IPv6 protocol and so it can be directly routed to cloud platforms.
4. It offers one-to-many and many-to-one routing.
5. In the network, leaf nodes can be in sleep mode for a longer duration of time.
Disadvantages of 6LoWPAN:
Applications of 6LoWPAN:
Page
46
5. CoAP
Constrained Application Protocol (COAP) is a client server-based protocol. With this
protocol, the COAP packet can be shared between different client nodes which
are commanded by the COAP server. The server is responsible to share the
information depending on its logic but has not acknowledged it. This is used
with the applications which support the state transfer model.
CoAP is a session layer protocol that provides the RESTful (HTTP) interface between
HTTP client and server. It is designed by IETF Constrained RESTful Environment
(CoRE) working group. It is designed to use devices on the same constrained
network between devices and general nodes on the Internet. CoAP enables low-
power sensors to use RESTful services while meeting their low power
constraints. This protocol is specially built for IoT systems primarily based on
HTTP protocols.
The data is sent from CoAP clients (such as smartphones, RFID sensors, etc.) to the
CoAP server and the same message is routed to REST CoAP proxy. The REST
CoAP proxy interacts outside the CoAP environment and uploads the data over
REST internet.
Page
47
6. RF module
Types of RF modules
The term RF module can be applied to many different types, shapes and
sizes of small electronic sub assembly circuit board. It can also be applied to
modules across a huge variation of functionality and capability. RF modules
typically incorporate a printed circuit board, transmit or receive circuit,
antenna, and serial interface for communication to the host processor.
Most standard, well known types are covered here:
• transmitter module
• receiver module
• transceiver module
• system on a chip module.
Transmitter module
Page
49
Transceiver modules
Typical applications
• Vehicle monitoring
• Remote control
• Telemetry
• Small-range wireless network
• Wireless meter reading
• Access control systems
• Wireless home security systems
• Area paging
• Industrial data acquisition system
• Radio tags reading
• RF contactless smart cards
• Wireless data terminals
• Wireless fire protection systems
• Biological signal acquisition
• Hydrological and meteorological monitoring
• Robot remote control
• Wireless data transmissions
• Digital video/audio transmission
Page
50
UNIT IV - CLOUD ARCHITECTURE BASICS
The Cloud types; IaaS, PaaS, SaaS.- Development environments for service
development; Amazon, Azure, Google Appcloud platform in industry
IaaS cloud computing platform layer eliminates the need for every
organization to maintain the IT infrastructure.
IaaS is offered in three models: public, private, and hybrid cloud. The
private cloud implies that the infrastructure resides at the customer-premise.
In the case of public cloud, it is located at the cloud computing platform
vendor's data center, and the hybrid cloud is a combination of the two in which
the customer selects the best of both public cloud or private cloud.
Page
51
Advantages of IaaS cloud computing layer
There are the following advantages of IaaS computing layer -
1. Shared infrastructure
IaaS allows multiple users to share the same physical infrastructure.
3. Pay-as-per-use model
IaaS providers provide services based on the pay-as-per-use basis. The
users are required to pay for what they have used.
5. On-demand scalability
On-demand scalability is one of the biggest advantages of IaaS. Using
IaaS, users do not worry about to upgrade software and troubleshoot the issues
related to hardware components.
1. Security
Security is one of the biggest issues in IaaS. Most of the IaaS providers
are not able to provide 100% security.
3. Interoperability issues
It is difficult to migrate VM from one IaaS provider to the other, so the
customers might face problem related to vendor lock-in.
Page
53
2. Platform As A Service (PaaS)
PaaS Types : Various sorts of PaaS are presently accessible to engineers. They are :
1. Public PaaS
2. Private PaaS
3. Hybrid PaaS
4. Communication PaaS
5. Mobile PaaS
6. Open PaaS
1. Public PaaS – Is appropriate for use in public cloud. Public PaaS permits
client to control programming extension, while cloud supplier deals
with circulation of all other key IT segments expected to have
applications, including working frameworks, databases, workers, and
capacity framework systems.
Public dice merchants offer middleware, which permits engineers to
introduce, design, and control workers and databases without need to
introduce framework. Therefore, Public Pass and Infrastructure (IaaS) run
all together. PaaS with exercises on merchant’s IaaS foundation using
public cloud. Tragically, this implies client will adhere to similar public
cloud choice that they would prefer not to utilize. Some little and
medium-sized organizations have received public pass, however huge
enterprises and associations have wouldn’t acknowledge it because of
their cozy relationship with public cloud. This is principally consequence
of an enormous number of guidelines and consistence issues on
organization application advancement in public cloud.
Page
54
community. A private pass is normally circulated as gadget or
programming in client’s firewall, which is regularly kept up in server
farm on organization’s premises. A private PaaS can be created on
framework and works inside organization’s particular private cloud.
Private dice permit an association to all more likely serve designers, improve
inside
Page
55
asset usage, and decrease expensive cloud entrance that numerous
organizations face. Likewise, private dice permit designers to run and
deal with their organization’s applications in consistence with severe
security and protection necessities.
Page
56
3. Software as a Service (SaaS)
Business Services - SaaS Provider provides various business services to start-up the
business. The SaaS business services include ERP (Enterprise Resource
Planning), CRM (Customer Relationship Management), billing, and sales.
Social Networks - As we all know, social networking sites are used by the general
public, so social networking service providers use SaaS for their convenience
and handle the general public's information.
Mail Services - To handle the unpredictable number of users and load on e-mail
services, many e-mail providers offering their services using SaaS.
Page
57
Unlike traditional software, which is sold as a licensed based with an up-
front cost (and often an optional ongoing support fee), SaaS providers are
generally pricing the applications using a subscription fee, most commonly a
monthly or annually fee.
2. One to Many
Software as a service removes the need for installation, set-up, and daily
maintenance for the organizations. The initial set-up cost for SaaS is typically
less than the enterprise software. SaaS vendors are pricing their applications
based on some usage parameters, such as a number of users using the
application. So SaaS does easy to monitor and automatic updates.
All users will have the same version of the software and typically access it
through the web browser. SaaS reduces IT support costs by outsourcing
hardware and software maintenance and support to the IaaS provider.
6. Multidevice support
SaaS services can be accessed from any device such as desktops, laptops,
tablets, phones, and thin clients.
7. API Integration
SaaS services easily integrate with other software or services through standard APIs.
8. No client-side installation
SaaS services are accessed directly from the service provider using the
internet connection, so do not need to require any software installation.
1) Security
Actually, data is stored in the cloud, so security may be an issue for some
Page
58
users. However, cloud computing is not more secure than in-house
deployment.
Page
59
2) Latency issue
Since data and applications are stored in the cloud at a variable distance from
the end- user, there is a possibility that there may be greater latency when
interacting with the application compared to local deployment. Therefore, the
SaaS model is not suitable for applications whose demand response time is in
milliseconds.
Switching SaaS vendors involves the difficult and slow task of transferring the
very large data files over the internet and then converting and importing them
into another SaaS also.
Page
60
UNIT V - IOT PROJECTS ON RASPBERRY PI
Building IoT with RASPBERRY Pi- Creating the sensor project - Preparing
Raspberry Pi - Clayster libraries – Hardware Interacting with the hardware -
Interfacing the hardware- Internal representation of sensor values - Persisting
data - External representation of sensor values - Exporting sensor data
Raspberry Pi
• The Raspberry Pi is a very cheap computer that runs Linux, but it also
provides a set of GPIO (general purpose input/output) pins that allow
you to control electronic components for physical computing and
explore the Internet of Things (IoT).
• Raspberry Pi was basically introduced in 2006.
• It is particularly designed for educational use and intended for Python.
• A Raspberry Pi is of small size i.e., of a credit card sized single board
computer, which is developed in the United Kingdom(U.K) by a
foundation called Raspberry Pi.
• There have been three generations of Raspberry Pis: Pi 1, Pi 2, and Pi 3
• The first generation of Raspberry (Pi 1) was released in the year 2012,
that has two types of models namely model A and model B.
• Raspberry Pi can be plugged into a TV, computer monitor, and it uses
a standard keyboard and mouse.
• It is user friendly as can be handled by all the age groups.
• It does everything you would expect a desktop computer to do like word-
processing, browsing the internet spreadsheets, playing games to
playing high definition videos.
• All models feature on a broadcom system on a chip (SOC), which
includes chip graphics processing unit GPU(a Video Core IV), an ARM
compatible and CPU.
• The CPU speed ranges from 700 MHz to 1.2 GHz for the Pi 3 and
on board memory range from 256 MB to 1 GB RAM.
• An operating system is stored in the secured digital SD cards and
program memory in either the MicroSDHC or SDHC sizes.
• Most boards have one to four USB slots, composite video output, HDMI
and a 3.5 mm phone jack for audio. Some models have WiFi and
Bluetooth.
• Several generations of Raspberry Pis have been released.
Page
61
• All models feature a Broadcom system on a chip (SoC) with an
integrated ARM- compatible central processing unit (CPU) and on-chip
graphics processing unit (GPU).
Page
62
• Processor speed ranges from 700 MHz to 1.4 GHz for the Pi 3 Model
B+ or 1.5 GHz for the Pi 4; on-board memory ranges from 256 MB to 1
GB with up to 4 GB available on the Pi 4 random-access memory
(RAM).
• Secure Digital (SD) cards in MicroSDHC form factor (SDHC on early
models) are used to store the operating system and program memory.
• The boards have one to five USB ports. For video output, HDMI and
composite video are supported, with a standard 3.5 mm tip-ring-sleeve
jack for audio output.
• Lower-level output is provided by a number of GPIO pins, which
support common protocols like I2C. The B-models have an 8P8C
Ethernet port and the Pi 3 and Pi Zero W have on-board Wi-Fi and
Bluetooth.
• Voltages: Two 5V pins and two 3V3 pins are present on the board, as
well as a number of ground pins (0V). The remaining pins are all
general purpose 3V3 pins
• A GPIO pin designated as an output pin can be set to high (3V3) or low
(0V). A GPIO pin designated as an input pin can be read as high (3V3) or
low (0V).
• Processor & RAM: Raspberry based on ARM11 processor. Latest version
supports 700MHz processor and 512MB SDRAM. The Central processing
unit is the brain of the raspberry pi board and that is responsible for
carrying out the instructions of the computer through logical and
mathematical operations.
• Ethernet: The Ethernet port of the raspberry pi is the main gateway for
Page
63
communicating with additional devices. The raspberry pi Ethernet port is
used to plug your home router to access the internet.
• USB Ports: It has 2 USB ports. USB port provide current upto 100mA. For
connecting devices that draw current more than 100mA, an external USB
powered hub is required.
Page
64
• Ethernet Port: It has standard RJ45 Ethernet port. Connect Ethernet cable
or USB wifi adapter to provide internet connectivity.
• HDMI Output: It supports both audio and video output. Connect
raspberry Pi to monitor using HDMI cable.
• Composite video Output: Raspberry comes with a composite video output
with an RCA jack that supports both PAL and NTSC video output.
• Audio Output: It has 3.5mm audio output jack. This audio jack is used for
providing audio output to old television along with RCA jack for video.
• GPIO Pins: It has a number of general purpose input/output pins. These
pins are used to connect other electronic components. For example, you
can connect it to the temperature sensor to transmit digital data.
• Display Serial Interface (DSI): DSI interface are used to connect an LCD
panel to Raspberry PI.
• Cameral Serial Interface(CSI): CSI interface are used to connect a camera
module to Raspberry PI.
• SD Card slot: Raspberry does not have built in OS and storage. Plug in an
SD card loaded with Linux to SD card slot.
• Power Input: Raspberry has a micro USP connector for power input.
• Memory: The raspberry pi model A board is designed with 256MB of
SDRAM and model B is designed with 51MB.Raspberry pi is a small size
PC compare with other PCs. The normal PCs RAM memory is available in
gigabytes. But in raspberry pi board, the RAM memory is available more
than 256MB or 512MB
• Status LEDs: Raspberry has 5 status LEDs.
Raspberry PI Interfaces:
Page
65
• SPI: Serial Peripheral Interface (SPI) is a synchronous serial data protocol
used for communicating with one or more peripheral devices. In an SPI
connection, there is one master device and one or more peripheral
devices. There are 5 pins Raspberry
Page
66
for SPI interface.
o MISO(Master In Slave Out): Master line for sending data to the peripherals.
o MOSI(Master Out Slave In): Slave Line for sending data to the master.
o SCK(Serial Clock): Clock generated by master to synchronize data transmission.
o CE0(Chip Enable 0): To enable or disable devices.
o CE1(Chip Enable 1): To enable or disable devices.
• I2C: I2C Interface pins are used to connect hardware modules. I2C
interface allows synchronous data transfer with two pins: SDA(data line)
and SCL (Clock Line)
1. Where the system processing is huge. They can process high end
programs for applications like Weather Station, Cloud server, gaming
console etc. With 1.2GHz clock speed and 1 GB RAM RASPBERRY PI can
perform all those advanced functions.
2. RASPBERRY PI 3 has wireless LAN and Bluetooth facility by which you
can setup WIFI HOTSPOT for internet connectivity.
3. RASPBERRY PI had dedicated port for connecting touch LCD display
which is a feature that completely omits the need of monitor.
4. RASPBERRY PI also has dedicated camera port so one can connect camera
without any hassle to the PI board.
5. RASPBERRY PI also has PWM outputs for application use. 6. It supports HD steaming
Applications
• Hobby projects.
• Low cost PC/tablet/laptop
• IoT applications
• Media center
• Robotics
• Industrial/Home automation
• Server/cloud server
• Print server
• Security monitoring
• Web camera
• Gaming
• Wireless access point
Page
67
2. Creating the sensor project
Our first project will be the sensor project. Since it is the first one, we will
cover it in more detail than the following projects in this book. A majority of
what we will explore will also be reutilized in other projects as much as
possible. The development of the sensor is broken down into six steps, and the
source code for each step can be downloaded separately. You will find a simple
overview of this here:
2. Then, you will configure the hardware and learn to sample sensor values and
maintain a useful historical record.
3. After adding HTTP server capabilities as well as useful web resources to the
project, you will publish the sensor values collected on the Internet.
4. You will then handle persistence of sampled data in the sensor so it can
resume after outages or software updates.
5. The next step will teach you how to add a security layer, requiring user
authentication to access sensitive information, on top of the application.
6. In the last step, you will learn how to overcome one of the major obstacles in
the request/response pattern used by HTTP, that is, how to send events from
the server to the client.
3. Preparing Raspberry Pi
Page
69
To prepare Raspberry for the execution of the .NET code, we need to
install Mono, which contains the Common Language Runtime for .NET that will
help us run the .NET code on Raspberry. This is done by executing the following
commands in a terminal window in Raspberry Pi:
4. Clayster libraries
Library Description
This provides the application with a powerful object database.
Objects are persisted and can be searched directly in the code
Clayster.Library.Data
using the object's class definition. No database coding is
necessary. Data can be stored in the SQLite database provided in
Raspberry Pi.
This provides the application with an extensible event logging
Clayster.Library.EventLog
architecture that can be used to get an overview of what happens
in a network of things.
This contains classes that implement common Internet protocols.
Clayster.Library.Internet Applications can use these to communicate over the Internet in a
dynamic manner.
This provides mechanisms to create localizable applications that
Clayster.Library.Language
are simple to translate and that can work in an international
setting.
This provides a powerful extensible, mathematical scripting
Clayster.Library.Math
language that can help with automation, scripting, graph plotting,
and others.
This provides classes that help applications become interoperable
Clayster.Library.IoT by providing data representation and parsing capabilities of data in
IoT. The source code is also included here.
Page
70
This contains Hardware Abstraction Layer (HAL) for Raspberry Pi. It
provides object-oriented interfaces to interact with devices
Clayster.Library.Raspberry
connected to the General Purpose Input/Output (GPIO) pins
Pi
available. The source code is also included here.
Page
71
5. Hardware Interacting with the hardware
Hardware
Our sensor prototype will measure three things: light, temperature, and motion.
To summarize, here is a brief description of the components:
• The light sensor is a simple ZX-LDR analog sensor that we will connect to a
four- channel (of which we use only one) analog-to-digital converter
(Digilent Pmod AD2), which is connected to an I 2C bus that we will connect
to the standard GPIO pins for I2C.
• The temperature sensor (Texas Instruments TMP102) connects directly to
the same I2C bus.
• The SCL and SDA pins on the I2C bus use recommended pull-up resistors
to make sure they are in a high state when nobody actively pulls them
down.
• The infrared motion detector (Parallax PIR sensor) is a digital input that we
connect to GPIO 22.
• We also add four LEDs to the board. One of these is green and is connected to
GPIO
23. This will show when the application is running. The second one is yellow
and is connected to GPIO 24. This will show when measurements are done.
The third one is yellow and is connected to GPIO 18. This will show when an
HTTP activity is performed. The last one is red and is connected to GPIO 25.
This will show when a communication error occurs.
• The pins that control the LEDs are first connected to 160 Ω resistors before
they are connected to the LEDs, and then to ground. All the hardware of
the prototype board is powered by the 3.3 V source provided by Raspberry
Pi. A 160 Ω resistor connected in series between the pin and ground makes
sure 20 mA flows through the LED, which makes it emit a bright light.
For instance, digital output is handled using the DigitalOutput class and
digital input with the DigitalInputclass. Devices connected to an I 2C bus are
handled using the I2C class. There are also other generic classes, such as
Page
72
ParallelDigitalInput and ParallelDigitalOutput, that handle a series of digital
input and output at once. The SoftwarePwm class handles a software-controlled
pulse-width modulation output. The Uart class handles communication using
the UART port available on Raspberry Pi. There's also a subnamespace called
Devices where device-specific classes are available.
Page
73
In the end, all classes communicate with the static GPIO class, which is
used to interact with the GPIO layer in Raspberry Pi.
With our temperature sensor on the I2C bus, which limits the serial clock
frequency to a maximum of 400 kHz, we interface as follows:
private static AD799x adc = new AD799x (0, true, false, false, false, i2cBus);
The sensor data values will be represented by the following set of variables:
private static bool motionDetected = false;
private static double temperatureC;
private static double lightPercent;
private static object synchObject = new object ();
Page
75
8. Persisting data
Finally, you will get a proxy object for the object database as follows. This
object can be used to store, update, delete, and search for objects in your
database:
db = DB.GetDatabaseProxy (“TheSensor");
By doing this, the sensor does not lose data if Raspberry Pi is restarted.
Page
77
10. Exporting sensor data
The export starts by calling the Start() method on the sensor data export
module and ends with a call to the End() method. Between these two, a
sequence of StartNode() and EndNode() method calls are made, one for each
node to export. To simplify our export, we then call another function to output
data from an array of Record objects that contain our data. We use the same
method to export our momentary values by creating a temporary Record object
that would contain them:
Output.EndNode ();
}
Output.End ();
}
If a data field passes all these tests, it is exported by calling any of the
instances of the overloaded method ExportField(), available on the sensor data
export object. Fields are exported between the StartTimestamp()
andEndTimestamp() method calls, defining the timestamp that corresponds to
the fields being exported:
Page
78
private static void Export(ISensorDataExport Output, IEnumerable<Record>
History, ReadoutType Type,ReadoutRequest Request)
{
if((Request.Types & Type) != 0)
{
foreach(Record Rec in History)
{
if(!Request.ReportTimestamp (Rec.Timestamp))
continue;
Output.StartTimestamp(Rec.Timestamp);
if (Request.ReportField("Temperature"))
Output.ExportField(“Temperature",Rec.TemperatureC, 1,"C", Type);
if(Request.ReportField("Light"))
Output.ExportField("Light",Rec.LightPercent, 1, "%", Type);
if(Request.ReportField ("Motion"))
Output.ExportField("Motion",Rec.Motion, Type);
Output.EndTimestamp();
}
}
}
We can test the method by exporting some sensor data to XML using the
SensorDataXmlExport class. It implements the ISensorDataExport interface.
The result would look something like this if you export only momentary and
historic day values.
Page
79