Professional Documents
Culture Documents
Study on Internet of Things = Nghiên Cứu Về Internet Của Vạn Vật
Study on Internet of Things = Nghiên Cứu Về Internet Của Vạn Vật
---------------------------------------
DANH TỪ
JOÃO FILIPE OFIÇO
MASTER OF SCIENCE
2014B
HANOI – 2016
MINISTRY OF EDUCATION AND TRAINING
HANOI UNIVERSITY OF SCIENCE AND TECHNOLOGY
---------------------------------------
MAJOR : TELECOMMUNICATIONS
SCIENTIFIC SUPERVISOR:
Dr. TRƯƠNG THU HƯƠNG
Hà Nội – 2016
CỘNG HÒA XÃ HỘI CHỦ NGHĨA VIỆT NAM
Tác giả, Người hướng dẫn khoa học và Hội đồng chấm luận văn xác nhận tác
giả đã sửa chữa, bổ sung luận văn theo biên bản họp Hội đồng ngày 24/08/2016
với các nội dung sau:
The data and results presented in this thesis are honest and not yet published in
any previous study.
Author
------------------------------------------------------------
July, Hanoi
i
LIST OF FIGURES
Figure 2.1: Internet of Things is "born" between 2008 and 2009 [3] .........................7
Figure 2.2: Common IoT devices and Technologies [9] ............................................9
Figure 2.3: Real Time Stream Processing- Google IoT [11] ....................................12
Figure 2.4: IBM IoT Foundation [12] .......................................................................13
Figure 2.5: ThingWorx IoT foundation [13] .............................................................14
Figure 2.6: Electric Imp and ThingSpeak IoT [14] ...................................................16
Figure 2.7: Digital Service Cloud IoT foundation [10] ............................................17
Figure 2.8: Data streaming from Gateway to cloud by Amazon Kinesis [10] .........18
Figure 2.9: Microsoft IoT foundation [15] ................................................................20
Figure 2.10: IoT Connectivity [18] ...........................................................................22
Figure 2.11: IoT Architecture [22] ............................................................................28
Figure 2.12: Applications of IoT [6] .........................................................................33
Figure 3.1: Three basic stages of M2M technology [26] ..........................................36
Figure 3.2: M2M Protocol Stack and Technical Challenges [29] ............................42
Figure 3.3: Architecture of M2M system [30] ..........................................................45
Figure 3.4: Examples of components of M2M system [30] .....................................45
Figure 4.1: House design with distribution of the smart devices in each area..........47
Figure 4.2: Structure of the Internet of Things system .............................................48
Figure 4.3: Duty Cycle PWM [31]. ...........................................................................51
Figure 4.4: PIR sensor ...............................................................................................52
Figure 4.5: Raspberry Pi 3 [33] .................................................................................54
Figure 4.6: Raspberry Pi interface after installing Rasbian OS ................................56
Figure 4.7: Connection diagram of Arduino LED and Motion sensor [38]..............57
Figure 4.8: Bluetooth connection between smart devices with Gateway .................68
Figure 4.9: IoT ecosystem .........................................................................................69
Figure 4.10: PIR sensor data .....................................................................................71
Figure 4.11: Node-Red ..............................................................................................72
Figure 4.12: Login for access the interface RockMongo ..........................................73
ii
Figure 4.13: Interface RockMongo (management software MongoDB) ..................74
Figure 4.14: Testbed for the Usecase Ecosystem .....................................................75
iii
LIST OF ACRONYMS
IP - Internet Protocol
iv
M2M – Machine to Machine
MCU - Microcontroller
RF - Radio Frequency
UI - Unique Identifier
v
ACKNOWLEDGEMENTS
I would like to thank my supervisor, Dr. Trương Thu Hương and the IoT research
group for their support during the course of this thesis.
vi
ABSTRACT
This work aims to explain the concepts of the M2M communication and IoT
concept, reference models, architectures and protocols used in the Internet of
Things. My thesis intends to give an overview on the Internet of Things, as well as
helps beginners build Internet of Things applications by their own.
In this research, the IoT and M2M communication will be discussed, terms that
have arisen with the creation of devices that can access the network to communicate
and exchange information. Those can optimize and facilitate tasks like collecting
information of things and of the environments where they are.
vii
Contents
DECLARATION ..............................................................................................................i
LIST OF ACRONYMS...................................................................................................iv
ACKNOWLEDGEMENTS ............................................................................................vi
ABSTRACT ...................................................................................................................vii
4.3.1 Protocol for the connection between Smart Device Gateway ................... 68
CONCLUSION .............................................................................................................. 76
REFERENCES ............................................................................................................... 77
1.1 Introduction
Nowadays the Internet is one of the most important and the most used means of
communicating.
The internet makes a big impact in many areas and also for all of the humanity.
Therefore, the internet can be considered one of the greatest creations in the history
[1].
The next generation of the Internet will be the Internet of Things which can be
acknowledged as a worldwide network of interconnected objects [2]. In this new
model, any object has a unique ID and can join a common and known network
which is the Internet [1].
If we analyze the impact that the internet brought to the humanity in general, we
can conclude that the internet is one of the most important and powerful creations in
the history. IoT represents a progress that will make use of revolutionary
applications [3].
2
get information about the environments. These can be used as a network to
communicate with other devices.
The IoT thesis title is supported by the fact that it represents an innovation in the
network concept. This is a system that collects useful data, through sensing devices
and to process the collected data. Many data are collected through IoT, it can be an
advance to the society.
1.2 Motivations
As we all know that the global network of computers that are interconnected
through TCP/IP is called internet. Internet changed the way long distance
communication was conducted, it created new ways to share and acquire
knowledge; it changed the way awareness was spread across communities and so
on. Internet also changed the entertainment and media industry. It was a great leap
when people from different parts of the world were able to connect with each other
through internet to share, learn and care.
To create a real life scenario, one can imagine a smart home; a house full of
smart objects: smart TV, smart phone, lights, heating system and etc. All these
objects are connected to each other creating an IoT network and connected to the
internet with a special Gateway device. The owner is able to control these devices
with his smart phone or laptop from his job or anywhere he can connect to the
internet. For a more specific situation: the owner of the house checks the
temperature sensor values and decides to turn the heating system of the house on
just before he left his job so that he can have a "warm" welcome when he reaches
3
the house. Since variety of smart objects are on the market, working with Bluetooth,
ZigBee, ANT or 6LoWPAN, the most important component of this scenario is to
build the IoT network inside the house; while the main challenge is to avoid the
unauthorized people to get control of your house [6].
These were the major motivations of the study, since the topic is of public
interest today.
1.3 Goals
General:
To implement an Internet of Things infrastructure using the communication
protocol.
Specific:
To study IoT;
To learn M2M communication;
To identify the Internet of Things reference model;
To identify some protocols that are used in the Internet of Things;
To check the operating system used in the Internet of Things.
4
1.5 Structure of the thesis
The rest of the thesis is structured as follows:
Chapter 4: Presents the case study testbed establishment, description the material
used for the implementation and the final results.
In the end, it presents the conclusion, some recommendations for future work and
references.
5
CHAPTER 2 - INTERNET OF THINGS OVERVIEW
In this chapter we discuss the concept of the Internet of Things, transmission
technologies and architecture of the Internet of Things, applications, Smart objects,
Smart devices, Internet of Things platform, advantages and disadvantages of IoT
and Operating System for the Internet of Things.
With crescent use of smartphones and tablets it was increased the number of
devices connected to the internet, about 12.5 billion in 2010, increasing the number
of devices connected per person to more than 1.84 for the first time [3].
Observing the figure 2.1, which belongs to an investigation of cisco internet
Business solutions Group, it was observed that that the quantity of devices
connected to the internet will grow in next years. Consequently the number of
devices connected per person will also increase [3].
In this new model of internet, the communication will be done not only by
people, but also by people and things and by own object. It will be the join of the
physical world with the information world. It will be possible if each machine
communicates with another machine, with the aid of one unique identification form,
as occurs on the Internet current [2].
6
Figure 2.1: Internet of Things is "born" between 2008 and 2009 [3]
2.1.1 What is Internet of Things?
In 2005, ITU published an annual report of the Internet of Things, which
extended the concept of the Internet of things and posed the foreground of "Any
Time, and Any Place, and Any Things Connection", “Ubiquitous networks” and
“Ubiquitous Computing”, except RFID technology, sensor technology,
nanotechnology and smart things technology will be more widely applied [7].
Any object which not only has a state, which has certain data associated with a
state but an object which can also determine nature of connectivity, duration of
connectivity and connectivity protocol are called smart objects.
RFID, Bluetooth Low Energy and NFC make it possible to use our phone as
readers. We can extract information from certain objects just by tapping it or
7
bringing our device close to it. RFID tags do not have any embedded system or does
a NFC tag has. But data can still be brought to internet by reading through a reader.
These are called smart objects. Non-processor entity whose data can be acquired
and migrated over internet falls under these category.
Anybody who keeps track of the Silicon Vally is sure to know that IoT is the
latest buzz. So many of the startups now are focusing towards IoT. Therefore when
we are talking about IoT, we are basically talking about infinite possibilities,
hardware and software platform. So when trying to find a list of IoT devices on the
internet, one might end up getting frustrated purely because it's is difficult to
provide such list.
We divide the IoT devices into two broad categories: The wearable ones and
Microcontroller/Microprocessor driven embedded IoT ones. Some of the embedded
devices like Arduino Lilly pad are minisque and anybody can further utilize them to
make their own wearable solution. However, wearable hardware which is pretty
standard and IoT has only software scope for the developer [9].
8
Here is a diagram of common peripheral hardware that one might have to learn
while working with IoT hardware in embedded level.
So not being a hardware geek can be started with Wearable and start making
apps for popular wearable platforms. Being a hardware enthusiast, can be started
with Embedded IoT platform. Any of the broader technologies like Raspberry Pi,
Arduino or Galileo and startup with IoT development, must be selected [9].
Inventory Management: IoT is used to tag radio frequency sensors to track the
location of products in real time. It has been instrumental in tracking the level of
9
inventory and to stock it in advance, making alerts for unforeseen stoppages,
automatically placing orders, etc.
Assessing web user intelligence: IoT is used by third party web data aggregators
to have a better understanding of their key customer by tracking them on social
media networks to know their preferences.
Complexity: As with all complex systems, there are more opportunities of failure.
With the Internet of Things, failures could sky rocket. Infrastructure is still being
developed and it will still take quite some time to overcome these disadvantages.
10
system can reside. This Operating system will allow application to work above it by
providing necessary execution environment to it [10].
Google is one of the popular IoT platforms because of: Fast global network,
Google's BigData tool, Pay as you use strategy, Support of various available
services of cloud like RiptideIO, BigQuery, Firebase, PubSub, Telit Wireless
Solutions, Connecting Arduino and Firebase and Cassandra on Google Cloud
Platform and much more [10].
Figure 2.3 shows real time stream processing by Google. Devices send their
status information to App Engine. So first load balancer makes sure that the load is
balanced among various app engines. Then compute engine performs data
computation and publication of data. Multiple instances of compute engine are
available to insure reliability and scalability. The data is stored and backed up using
cloud storage. Big query allows speedy insertion of data in tables of cloud database.
The results can be presented to the end users by means of various analysis and
visualization technique.
Key features:
11
Provided support if required;
Assurance of Google Grade security and compliance for your applications;
Environment safe cloud.
IoT foundation shown in Figure 2.4 combined with IBM BlueMix platform
provides powerful application access to IoT data and devices. IBM BlueMix
support rapid development of analytics applications, visualization dashboard, and
mobile IoT applications. We can create our IoT application with IBM Bluemix and
then IBM provide REST and secure API to connect our device data with our
application. IBM IoT foundation is the Hub where we can set up and manage our
connected devices. IBM IoT foundation uses MQTT protocol to securely transfer
device data to cloud [12].
Key features:
12
Device Registration
Scalable connectivity
Security of communication
Storage of data
Provided support if required
13
logic. System service integration interact with business systems like ERP, CRM etc.
3D storage engine enables big data analytics. Above it there is a layer for REST
APIs that helps to implement and use social services and cloud services. Then the
data is presented via various visualization techniques [10].
Key features:
14
2.3.2.4 ThingSpeak
ThingSpeak is an application platform for the development of IoT systems. It can
help to build the application which works upon the data collected by sensors.
ThingSpeak is an open data platform for IoT application development. ThingSpeak
is the perfect complement to an existing enterprise system to tap into the Internet of
Things. It provides the ability to integrate our data with a variety of third-party
platforms, systems and technologies, including other leading IoT platforms such as
ioBridge and Arduino. ThingsSpeak channel is used to send and store data [10].
Figure 2.6 shows ThingSpeak IoT with Electric Imp platform. Here Electric Imp
is a platform with provides connectivity of WiFi devices with cloud services. It
provides access to the Electric Imp modules. Once the connectivity to such modules
is simplified by Electric Imp cloud, data services from ThingSpeak are used to get
IoT experience [10].
Key features:
15
Figure 2.6: Electric Imp and ThingSpeak IoT [14]
2.3.2.5 Digital Service Cloud
Digital service cloud is an open IoT platform. It allows IoT innovators to own
their customers the way customers own their products. It supports product start-ups,
global technological brands and product innovators. It is a platform that accelerates
time to market process for a new innovation. By using the readymade infrastructure
provided by DSC, one can build needed customized IoT solutions by connecting
devices and using plug and play dashboard. Then one has to monitor and manage
the product over its lifetime. It connects our product with a network of millions of
devices. It runs a UI-driven rules engine that requires no coding. It monitors and
streams a petabyte of real time data. It operates on a secure tenant based system and
provides quick launch of our application with a wizard based app builders [10].
Figure 2.7 shows Digital service cloud IoT foundation. Here consumer devices
equipped with variety of sensors can connect to IoT application available on cloud
and can communicate with application. Various networking and connectivity
techniques are available that can connect the devices over cloud. Cloud provides
device management and app development. Data analytics and visualization through
powerful dashboard are supported to end users [10].
Key features:
16
Scalability;
Security;
Plug and Play;
Unified customer service;
Big data analytics;
Monitoring, maintenance and management of devices;
Multi-channel support delivery;
Preventive support through support cloud;
Users across diverse verticals.
17
flexibility for IoT applications in terms of tools, programming languages, data
management and other infrastructure resources. ActiveMq and Mosquito servers
help in managing and analyzing IoT applications. User identity, device analytics,
and device messaging/notifications are all common parts of an Internet of Things
application Amazon Web Services provides services that take the effort out of these
important parts of your application. Services like Amazon Cognito, Amazon Mobile
Analytics, and Mobile Push to take care of the undifferentiated heavy lifting while
you focus on the differentiated benefits of application [10].
As shown in figure 2.8, Amazon Kinesis can collect high throughput data from
devices and gateways, and then it can analyze and store it over cloud so that
applications can consume it and can generate quick decision. It can support data up
to any scale.
Key features:
Scalability;
Privacy and Security;
High availability and flexibility;
Data analytics and storage of high volume data;
On demand services like other platforms;
Provides Hardware resources.
Figure 2.8: Data streaming from Gateway to cloud by Amazon Kinesis [10]
18
2.3.2.7 Microsoft Azure Cloud
Azure is Microsoft’s cloud computing platform, a rising collection of integrated
services analytics, database, computing, networking, mobile, storage and web for
moving quicker, accomplishing more and saving money.
Azure IoT Suite helps securely connect millions of Linux, RTOS (Real Time
Operating System), iOS, Android and Windows devices to reliably send telemetry
and receive commands from your application back-end in the cloud [15]
Figure 2.9 shows how Microsoft provides IoT solution. The core of Microsoft
IoT foundation is Microsoft Azure cloud platform. It provides connectivity of
millions of devices and sensors with IoT application. It provides remote access,
monitoring, and content distribution and configuration management facilities for
connected devices. It provides big data analysis, social as well as business
integration and dash boarding tools to IoT application to build an IoT solution.
19
Figure 2.9: Microsoft IoT foundation [15]
2.4 Transmission Technology
2.4.1 Process of IoT
To achieve a successful integration, IoT must be supported from some
innovational technologies. RFID is one of the key enablers of IoT. Connecting and
communicating with small objects require a uniquely identified system and real
time tracking, which RFID can provide by getting information about the location
and status of objects. The IoT can be divided into three processes [16]:
20
of Things, the two transmissions will be involved in the transmission process
of data from the collection device to the background processing center. The
process that the item identification information is read by the collection
equipment and the process that the Information from the collection device
transmitted to the Internet backbone network are wireless transmissions. The
backbone of the Internet of Things refers to the current communication
network, including Internet, telecom net and Enterprise networks and so on,
which is a typical wired transmission mainly responsible for the transmission
between the information processing center and external communication
devices.
c) Backstage center intelligent processing: The center mainly does the work of
pooling, converting, analyzing on the collection of information and data, and
adapt the information according to the specific needs of the user's and trigger
the event. Because a large number of original data is obtained from the
ending note and only after the original data is converted, selecting and
analyzing has the actual value for the users. The center also arranges these
data collation according to the specific content of services and
correspondingly respond according to the user’s triggering event.
The embedded systems can use a range of connectivity to connect with other
devices or the internet, as show in figure 2.10.
21
Figure 2.10: IoT Connectivity [18]
2.4.2.1 Bluetooth
An important short-range communications technology is of course Bluetooth,
which has become very important in computing and many consumer product
markets. It is expected to be key for wearable products, in particular, again
connecting to the IoT albeit probably via a smartphone in many cases. The new
Bluetooth Low-Energy or Bluetooth Smart, as it is now branded is a significant
protocol for IoT applications. Importantly, while it offers similar range to Bluetooth
it has been designed to offer significantly reduced power consumption [19].
However, Smart/BLE is not really designed for file transfer and is more suitable
for small chunks of data. It has a major advantage certainly in a more personal
device context over many competing technologies given its widespread integration
in smartphones and many other mobile devices. According to the Bluetooth SIG,
more than 90% of Bluetooth-enabled smartphones, including iOS, Android and
Windows based models, are expected to be ‘Smart Ready’ by 2018. Devices that
employ Bluetooth Smart features incorporate the Bluetooth Core Specification
22
Version 4.0 (or higher the latest is version 4.2 announced in late 2014) with a
combined basic-data-rate and low-energy core configuration for an RF transceiver,
baseband and protocol stack. Importantly, version 4.2 via its Internet Protocol
Support Profile will allow Bluetooth Smart sensors to access the Internet directly
via 6LoWPAN connectivity (more on this below). This IP connectivity makes it
possible to use existing IP infrastructure to manage Bluetooth Smart ‘edge’ devices.
Bluetooth 4.2 core specification:
2.4.2.2 ZigBee
ZigBee, like Bluetooth, has a large installed base of operation, although perhaps
traditionally more in industrial settings. ZigBee PRO and ZigBee Remote Control
(RF4CE), among other available ZigBee profiles, are based on the IEEE802.15.4
protocol, which is an industry-standard wireless networking technology operating at
2.4GHz targeting applications that require relatively infrequent data exchanges at
low data-rates over a restricted area and within a 100m range such as in a home or
building. ZigBee/RF4CE has some significant advantages in complex systems
offering low-power operation, high security, robustness and high scalability with
high node counts and is well positioned to take advantage of wireless control and
sensor networks in M2M and IoT applications. The latest version of ZigBee is
recently launched 3.0, which is essentially the unification of the various ZigBee
wireless standards into a single standard. An example product and kit for ZigBee
development are TI’sCC2538SF53RTQT ZigBee System-On-Chip IC and CC258
ZigBee Development Kit [19].
23
Data Rates: 250kbps.
2.4.2.3 WiFi
WiFi connectivity is often an obvious choice for many developers, especially
given the pervasiveness of WiFi within the home environment within LANs. It
requires little further explanation except to state the obvious that clearly there is a
wide existing infrastructure as well as offering fast data transfer and the ability to
handle high quantities of data [19].
Currently, the most common WiFi standard used in homes and many businesses
is 802.11n, which offers serious throughput in the range of hundreds of megabit per
second, which is fine for file transfers, but may be too power-consuming for many
IoT applications. [19].
2.4.2.4 NFC
NFC is a technology that enables simple and safe two-way interactions between
electronic devices, and especially applicable for smartphones, allowing consumers
to perform contactless payment transactions, access digital content and connect
electronic devices. Essentially it extends the capability of contactless card
technology and enables devices to share information at a distance that is less than
4cm [19].
24
Data Rates: 100–420kbps.
2.4.2.5 6LoWPAN
A key IP-based technology is 6LowPAN. Rather than being an IoT application
protocols technology like Bluetooth or ZigBee, 6LowPAN is a network protocol
that defines encapsulation and header compression mechanisms. The standard has
the freedom of frequency band and physical layer and can also be used across
multiple communications platforms, including Ethernet, WiFi, 802.15.4 and sub-
1GHz ISM. A key attribute is the IPv6 stack, which has been a very important
introduction in recent years to enable an IoT. IPv6 is the successor to IPv4 and
offers approximately 5 x 10 28 addresses for every person in the world, enabling any
embedded object or device in the world to have its own unique IP address and
connect to the Internet. Specially designed for home or building automation, for
example, IPv6 provides a basic transport mechanism to produce complex control
systems and to communicate with devices in a cost-effective manner via a low-
power wireless network [19].
Standard: RFC6282
Frequency: (adapted and used over a variety of other networking media
including Bluetooth Smart (2.4GHz) or ZigBee or low-power RF (sub-
1GHz)
Range: N/A
Data Rates: N/A
25
2.4.2.6 Z-Wave
Z-Wave is a low-power RF communications technology that is primarily
designed for home automation for products such as lamp controllers and sensors
among many others. Optimized for reliable and low-latency communication of
small data packets with data rates up to 100kbit/s, it operates in the sub-1GHz band
and is impervious to interference from WiFi and other wireless technologies in the
2.4-GHz range such as Bluetooth or ZigBee. It supports full mesh networks without
the need for a coordinator node and is very scalable, enabling control of up to 232
devices. Z-Wave uses a simpler protocol than some others, which can enable faster
and simpler development, but the only maker of chips is Sigma Designs compared
to multiple sources for other wireless technologies such as ZigBee and others [19].
2.4.2.7 LoRaWAN
Again, similar in some respects to Sigfox and Neul, LoRaWAN targets wide-area
network applications and is designed to provide low-power WANs with features
specifically needed to support low-cost mobile secure bi-directional communication
in IoT, M2M and smart city and industrial applications. Optimized for low-power
consumption and supporting large networks with millions and millions of devices,
data rates range from 0.3 kbps to 50 kbps [19].
Standard: LoRaWAN
Frequency: Various
Range: 2-5km (urban environment), 15km (suburban environment)
Data Rates: 0.3-50 kbps.
26
2.4.2.8 ANT
ANT is a proprietary WSN technology featuring a wireless communications
protocol stack that enables semiconductor radios operating in the 2.4 GHz
Industrial, Scientific and Medical allocation of the RF spectrum ("ISM band") to
communicate by establishing standard rules for co-existence, data representation,
signaling, authentication and error detection [20].
2.4.2.9 RFID
Radio frequency identification is the wireless use of electromagnetic fields to
identify objects. Usually, would install an active reader, or reading tags that
contain a stored information mostly authentication replies. Experts call that an
Active Reader Passive Tag (ARPT) system. Short range RFID is about 10cm, but
long range can go up to 200m. What many do not know is that Léon Theremin
invented the RFID as an espionage tool for the Soviet Union in 1945. An Active
Reader Active Tag (ARAT) system uses active tags awoken with an interrogator
signal from the active reader. Bands RFID runs on: 120 –150 kHz (10cm), 3.56
MHz (10cm-1m), 433 MHz (1-100m), 865-868 MHz (Europe), 902-928 MHz
(North America) (1-12m) [21].
Pros:
Cons:
Highly insecure;
Ongoing cost per card;
Tags need to be present as identifier and be handed over before;
27
Not compatible with smartphones.
Examples include animal identification, factory data collection, road tolls, and
building access. RFID tag is also attached to an inventory such that its production
and manufacturing progress can be tracked through the assembly line. We believe
RFID technology will very soon be replaced by NFC technology in smartphone
[21].
28
information to be collected and processed. The miniaturization of hardware has
enabled powerful sensors to be produced in much smaller forms which are
integrated into objects in the physical world [22].
There are various types of sensors for different purposes. The sensors have the
capacity to take measurements such as temperature, air quality, movement and
electricity. In some cases, they may also have a degree of memory, enabling them to
record a certain number of measurements. A sensor can measure the physical
property and convert it into signal that can be understood by an instrument. Sensors
are grouped according to their unique purpose such as environmental sensors, body
sensors, home appliance sensors and vehicle telematics sensors, etc [22].
Most sensors require connectivity to the sensor aggregators (Gateways). This can
be in the form of a LAN such as Ethernet and WiFi connections or PAN such as
ZigBee, Bluetooth and Ultra- Wideband (UWB). For sensors that do not require
connectivity to sensor aggregator their connectivity to backend servers/applications
can be provided using WAN such as GSM, GPRS and LTE. Sensors that use low
power and low data rate connectivity, they typically form networks commonly
known as WSNs. WSNs are gaining popularity as they can accommodate far more
sensor nodes while retaining adequate battery life and covering large areas [22].
With demand needed to serve a wider range of IoT services and applications such
as high speed transactional services, context-aware applications, etc, multiple
networks with various technologies and access protocols are needed to work with
each other in a heterogeneous configuration. These networks can be in the form of a
29
private, public or hybrid models and are built to support the communication
requirements for latency, bandwidth or security [22].
Also, certain situation requires immediate response to the situation. This layer
helps in doing that by abstracting data, extracting information and managing the
data flow. This layer is also responsible for data mining, text mining, service
analytics etc.
From the figure 2.11, we can see that, management service layer has Operational
Support Service (OSS) which includes Device Modeling, Device Configuration and
Management and many more. Also, we have the Billing Support System (BSS)
which supports billing and reporting [23].
Also, from the figure 2.11, we can see that there are IoT/M2M Application
Services which includes Analytics Platform; Data which is the most important part;
Security which includes Access Controls, Encryption, and Identity Access
30
Management etc.; and then we have the Business Rule Management (BRM) and
Business Process Management (BPM) [23].
From the figure 2.11, we can see that there are two types of applications which
are Horizontal Market which includes Fleet Management, Supply Chain etc. And on
the Sector wise application of IoT we have energy, healthcare, transportation etc
[23].
2.6 Application
IoT has potential for societal, environmental as well as economic impact.
Accurate information about the status, location and identity of things, which forms
part of and impacts on the environment, allows for smarter decision making and
appropriate action taking. IoT concepts have been demonstrated in a variety of
domains, ranging from logistics, transport and asset tracking, smart environments
(homes, buildings, infrastructure), to energy, defense and agriculture. In essence,
IoT impacts and certainly has the potential to significantly influence all facets of
society [24].
IoT is relevant in every step in every value chain. He has identified seven main
value drivers. The first four based on value from M2M communication, while the
last three create value with the integration of users. The drivers as identified by
Fleisch are [24]:
31
Automatic proximity trigger – an action is triggered automatically when the
physical distance of two things drops below (or passes) a threshold. The identity of
the thing is known, which when combined with the physical location and action
allows for better processes.
Automatic sensor triggering – a smart (or cooperative) thing can collect data via
any type of sensor including temperature, acceleration, orientation, vibration and
humidity. The thing senses its condition and environment, communicates the
information which enables prompt (and global) decision making.
Simple and direct user feedback – things can incorporate simple mechanisms to
provide feedback to a human present in the environment. Often these feedback
mechanisms are in the form of audio (audible beep) or visual (flashing light)
signals.
Extensive user feedback – things can provide rich services to a human (often the
thing is linked to a service in cyberspace through a gateway device such as a smart
phone). Augmented product information is a good example of extensive user
feedback.
Mind changing feedback – the combination of real world and cyberspace might
generate a new level of changing behaviors in people. One possibility is changing
the driving behavior as sensors in the vehicle communicate driving patterns to an
outside agency.
32
Figure 2.12: Applications of IoT [6]
33
Raspberry Pi.
34
CHAPTER 3 - MACHINE TO MACHINE COMMUNICATION
In this chapter we discuss the concept of M2M, M2M Platforms, M2M standards
and protocols, M2M protocol stack and networking standards, Architecture and
components of M2M and some protocols.
In simple terms, it is a technology that enables devices to interact with each other
over a wired or wireless communication network without any human intervention.
M2M technology usually employs sensors, actuators, MCUs and/or RF
Transceivers that acquires data from an end device or an event which is then
transmitted via a communication network (either Global System for Mobile
Communications GSM/General Packet Radio Service GPRS, powerline or satellite)
to application software that processes the received data into meaningful
information. The three basic stages of M2M technology are illustrated in Figure 3.1.
35
Figure 3.1: Three basic stages of M2M technology [26]
Today, M2M solutions are doing more than just monitoring the status of remote
assets and equipment. They are gathering real-time data from millions of connected
machines, for example, tractors, medical devices, vending machines, or storage
tanks, and translating it into meaningful information for quick decisions, automated
actions, and strategic analytics. The primary driver for M2M solutions is now
enabling new services, rather than just improving operational efficiency/cost saving.
36
Creating a platform is usually a complex and delicate task, and needs to serve
multiple purposes, but the primary purpose is to support and simplify the work of
those who will be using or consuming this platform. M2M platforms have
transformed the M2M market by making device data more accessible to application
developers, and also by offering well-defined software interfaces and making APIs
available so that application developers can readily integrate information sources
and control parameters into their applications.
37
with multiple technologies, and connected to the networks of multiple CSPs
(Communication Service Providers).
Solution Provider: it should be regarded typically as an enabler for a large
system development initiative, rather than as a standalone offering. These
M2M platforms are generally used by systems integrators to support turnkey
and client-specific solutions.
38
OneM2M
TIA (Telecommunications Industry Association) – USA
OneM2M
BBF (Broadband Forum)
TR-069 protocol specification
OMA (Open Mobile Alliance)
OMA-DM
OASIS (Advancing Open Standards for the Information Society)
XACML
NIST (National Institute of Standards and Technology)
Access Control
CSA (Cloud Security Alliance)
3.2.2 Protocols
The table below shows some communication protocols
Protocol Descriptions
39
RESTful HTTP "Representational State Transfer (REST) is a style of
software architecture for distributed systems such as the
World Wide Web. REST has emerged as a predominant
web API design model”.
MQTT protocol
40
MQTT stands for Message Queue Telemetry Transport is a lightweight network
protocol used for publishing and subscribing to messages that are sent between
devices. It is invented by Dr Andy StanfordClark of IBM and Arlen Nipper of
Arcom, with the goal to create a protocol that is bandwidth-efficient and uses little
battery power. The protocol works on top of the TCP/IP protocol, and is ideal for
use in constrained environments or low-bandwidth networks with limited
processing capabilities, small memory capacities and high latency [28].
Clients
A MQTT client is any device from a micro controller up to a server that has a
MQTT library running and is connecting to a MQTT broker over any kind of
network. Clients can subscribe and publish on topics, the topic is the routing
information for the broker. A MQTT client app is responsible for collecting
information from the telemetry device, connecting to the server, and publishing the
information to the server. To create a MQTT client, we will need to use a MQTT
library. These libraries are available for a broad variety of devices and frameworks
[28].
Brokers
The broker is primarily responsible for receiving all the messages, filtering them,
decide who is interested in it and then sending the message to all subscribed clients.
Brokers receive messages from publisher clients on a topic, which they forward to
the subscribers of the topic [28].
41
each layer is contributing to addressing at least one challenge in the M2M
communication, such as security and reliability [29].
42
M2M Device: Device capable of replying to request for data contained within
those devices or capable of transmitting data autonomously. Sensors and
communication devices are the endpoints of M2M applications. Generally, devices
can connect directly to an operator’s network, or they will probably interconnect
using WPAN technologies such as ZigBee or Bluetooth. Backhaul to an operator’s
network is than achieved via gateways that encapsulate and manage all devices.
Consequently, addressing and identifying, e.g., routing, of the devices relies heavily
on the gateways. Devices that connect via gateways are normally outside the
operator’s responsibility but belong to M2M applications that are provided by
service or application providers. Sensors and devices that connect directly into an
operator’s network (via embedded SIM, TPM and radio stack or fixed line access)
are endpoints of the network. Thus, the responsibility in terms of accountability,
SLAs etc., lies within the network operator (or virtual network operator). This holds
true especially with respect to TPM (Trusted Platform Module) where it is
necessary to ensure that the module is really that reliable and well protected [30].
M2M Gateway: Equipment that uses M2M capabilities to ensure M2M Devices
inter-working and interconnection to the communication network. Gateways and
routers are the endpoints of the operator’s network in scenarios where sensors and
M2M devices do not connect directly to the network. Thus, the task of gateways
and routers are twofold. Firstly, they have to ensure that the devices of the capillary
network may be reached from outside and vice versa. These functions are addressed
by the access enablers, such as identification, addressing, accounting etc., from the
operator’s platform and have to be supported at the gateway’s side as well. Thus,
platform and gateway form a distributed system, where generic and abstract
capabilities are implemented on the gateway’s side. Consequently, there will be a
control flow between gateway and operator’s platform that has to be distinguished
from the data channel that is to transfer M2M application data. Secondly, there may
43
be the need to map bulky internet protocols to their lightweight counterpart in low-
power sensor networks. However, the latter application might lose its relevance
since there are implementations of IPv6 for sensor networks available, that allow an
all-IP approach [30].
M2M Applications: It contains the middleware layer where data goes through
various application services and is used by the specific business-processing engines.
M2M applications will be based on the infrastructural assets (e.g., access enablers)
that are provided by the operator. Applications may either target at end users, such
as user of a specific M2M solution, or at other application providers to offer more
refined building blocks by which they can build more sophisticated M2M solutions
and services. e.g. customer care functionality, elaborate billing functions, etc.
Those services, or service enablers, may be designed and offered by an application
provider, but they might be offered by the operator via the operator platform itself
[30]. Figure 3.3 shows a simple architecture of M2M systems with its components.
44
Figure 3.3: Architecture of M2M system [30]
Figure 3.4 shows the M2M system with examples of various components and
applications.
45
The number of interconnected machines will very soon exceed the overall
population count. Therefore, it is important to understand well M2M interactions. In
this chapter we focus on the concepts of M2M, M2M standards and protocols basic
architecture and M2M protocols stack.
Also found that all the activities and with help of collaboration work of the
standards developing organizations in few years we will have generalized
framework for M2M communications that will support many heterogeneous devices
46
CHAPTER 4 - CASE STUDY TESTBED ESTABLISHMENT AND
RESULTS
After obtaining theoretical knowledge in previous parts of this thesis, in this
chapter we build a case study ecosystem in which, we intend to control the lighting
in a house that are assumed to have 3 areas (first floor, stairs and second floor). The
functions of the lighting system are described as follows:
1. Sensors are installed at each floor and staircases to sense the motion of persons.
Each time a motion is detected at a sensor, the light is turn on locally at that
point.
2. When a person passes by a sensor, for example, in the first floor, and pass by the
next sensor in the staircase connecting the first and second floor after a while,
the light bulb in the second floor should be turn on before the one reaches the
second floor.
Function (1) lights up the bulb at the needed area for a person. Function (2)
allows the system to smartly manage the lighting of a floor without person detection
beforehand. With this function, the lighting will be turn on before the person
reaches the floor based on the detection of his movement from the first floor to the
second floor.
Figure 4.1: House design with distribution of the smart devices in each area
47
An illustration of the smart device installation in a house can be described in
figure 16 house design with the distribution of the smart devices in each area.
Role:
48
Arduino Uno reads the signal from PIR sensor every second and sends to
Gateway via Bluetooth.
Receive command “turn on” or “turn off” from the Gateway to control the
light of the second floor through the cloud.
a) Arduino
The Arduino is a platform of hardware and software, built in single card that has
the aim of simplifying the application of objects or interactive environments. This
platform of low cost has analogic and digital writing and reading and has many
specific components that can interact with a simple and intelligent object.
Generally, these models use processors mega AVR, of Atmel corporation (2014),
the voltage is 5v, current 40mA per pin (reach 150m in wire 20 AWG,
unamplified), 32KB of flash memory, SRAM of 2KB, EEPROM of 1KB and watch
of 16MHz. The boards are programmable, libraries using the Arduino, with the
language C with an abstraction simplified. The board programming was abstracted;
so that the people without familiarity with the microcontrollers or with
programming languages can write the applications and that can be easily transmitted
to the board using integrated development environment.
The IDE Arduino, which includes Arduino library in written codes, is responsible
for transmitting and implementing automatically the program in the board. The
board has analogic and digital entrances. The digital writing or output in their pins
consists it is to convert the program code HIGH (1) or LOW (0), in constant signs
of 5v or 0v. The digital entrance in their pins consists of interpreting a to the voltage
of 5v or 0v and convert them to HIGH (1) or LOW (0) in their pins, respectively.
The analogic reading consists in reading the voltage between 0v and 5v, through an
analogic-digital converter (ADC), from 0 to 1023 to be transferred to the code as a
whole, and that the quantization used, has sensitivity / error 4,9mV.
The analogic Writing consists in taking the code which varies from 0 to 255 and
passes it to its pin using pulse width modulation (PWM). This technic can simulate
49
analogic results in analogic devices, using digital means altering the time when the
sign is between 5v and 0v. The time that pulse has to vary between 0v and 5v is 2
milliseconds and that is called duty cycle.
If the programmer sends 191 of analogic writing in its code, a pulse generated at
pin stays 75% of a duty cycle in 5v, an analogic device would be stimulated in the
same way if it received 3.75v during all time.
If the programmer sends 225 of analogic writing in its code, a pulse generated at
pin stays 100% of a duty cycle in 5v, an analogic device would be stimulated in the
same way if it received 05v during all time. These relations are presented in a figure
4.3-Duty Cycle PWM.
50
Figure 4.3: Duty Cycle PWM [31].
There are several components of low cost developed by many manufactories the
have hardware and software especially for compatibility with digital and analog
inputs and outputs of the Arduino. Among the most common components we find
temperature measurement of the air, humidity of air, humidity of soil, pressure,
distance, luminosity, fume, human touch, RFID reading director of fire wood, gyros
copy, infrared, accelerometer, detector of alcohol in air, detector of sound, GPS,
detector of metals, detector of locomotion, color identification and visible light.
PIR sensors detect a person’s body heat when the person comes in close
proximity. These sensors are small, low power, inexpensive and easy to use. Due to
these reasons, PIR sensors are generally used in gadgets, home appliances, business
enterprises, industries, etc. PIR gives digital output when it detects motion. It
51
consists of pyro-electric sensor that detects the infrared radiation emitted from
humans.
4.1.2 Gateway
A gateway is a network point that acts as an entrance to another network. On the
Internet, a node or stopping point can be either a gateway node or a host (end-point)
node [32]. we use Raspberry Pi 3 model B as Gateway.
Role:
Gateway receives data from the smart device via Bluetooth and sends the
data to the cloud through MQTT protocol.
Receive command “turn on” or “turn off” from the cloud and send to a smart
device of the second floor.
52
If we intend to extend the network, extended smart devices should be edited the
python code in Gateway and the javascript code in the cloud.
Raspberry Pi
Was given in 2006, the Raspberry pi is a microcontroller like a credit card, its
function is to help in procreation teaching and in electronic projects as home
automation, scientific experiments or music experiments. It's based on free
operation systems, like Debian or fedora and work through an SD card. The board is
fed by USB common when we connect to a keyboard, mouse and monitor; it can
function as a regular Linux computer. The Raspberry pi can have its developed
applications in languages as python, C, C++, java and Ruby, and can allow
additional software installations that can be compiled to platform ARMv6.
As Arduino, the Raspberry pi can also connect the GPIOs To a variety of circuits
developed by other manufacturers that allow controlling and feeling the
environment. The both places are small and of low cost, and the Arduino the
smallest and cheaper.
53
The same form factor as the Pi 2 Model B, the only difference is the location
of the onboard LEDs.
Role:
Receive data and compare data from the first floor and the stairs, afterwards
send "turn on" or "turn off" to the LED on the second floor;
Store all data received in MongoDB.
54
This makes data integration for certain types of applications faster and easier.
MongoDB is built for scalability, high availability and performance from a single
server deployment to large and complex multi-site infrastructures.
Node- RED is a visual tool for wiring the Internet of Things, but it can also be
used for other types of applications to quickly assemble flows of services. The name
is not the most intuitive name. The reason why ‘Node’ is in the name is because the
tool is implemented as Node application but from a consumer point of view that is
really only an internal implementation detail. Node-RED is available as open source
and has been implemented by IBM emerging technology organization.
Mosquitto is an Open Source MQTT v3.1 message broker. It aims to provide the
same features (and more) as IBM's Really Small Message Broker but as fully Open
Source software [36].
55
Figure 4.6: Raspberry Pi interface after installing Rasbian OS
With this connection, pins 1 and 3 are powered with 5V by the Arduino, so it is
through these pin connections that the PIR motion sensor gets the 5V that it needs
to power on and operate.
And it is through pin 2 that the Arduino receives output from the motion sensor.
When the motion detector does not detect any motion, the output is LOW and the
Arduino receives no voltage signal. When the sensor detects motion, the output is
HIGH and the Arduino receives a voltage signal, which can then trigger another
device to turn on, such as an LED we will use for this circuit.
The LED we will light connects pin 13 and ground of the board. The anode
connects to pin 13 and the cathode connects to ground. No external resistor is
necessary to limit current to the LED, because pin 13 already has built-in resistance
56
to limit current flow. Figure 4.7 shows the connections between Arduino with PIR
Motion sensor and LED.
Figure 4.7: Connection diagram of Arduino LED and Motion sensor [38]
After connect the motion sensor and LED with Arduino, we connect Arduino
with Bluetooth module, as shown in table 3.
Pin TX 10~
Pin RX 11~
57
After all connections, we did the upload of the Arduino code for Arduino kit on
the first floor and in the stairs area. Following can be seen the Arduino code. The
Arduino code to the second floor can be found in the appendix A.
#include <SoftwareSerial.h>
#include <pt.h>
boolean condition=false;
char check_data = 0;
int value;
int k;
void setup() {
pinMode(led, OUTPUT);
digitalWrite(led, LOW);
Serial.begin(9600);
Serial.println("Start");
BTSerial.begin(38400);
PT_INIT(&pt2);
58
PT_INIT(&pt3);
void SensorMotion(void);
void action();
void loop() {
protothread2(&pt2, 1000);
protothread1(&pt1, 1000);
protothread3(&pt3, 1000);
// SensorMotion();
PT_BEGIN(pt);
while(1) {
getDataFromSensor();
PT_END(pt);
59
PT_BEGIN(pt);
while(1) {
timestamp = millis();
act();
PT_END(pt);
PT_BEGIN(pt);
while(1) {
timestamp = millis();
action();
PT_END(pt);
void getDataFromSensor()
if (value == 1)
k=15;
60
}
void act()
if(k>0)
Serial.println("1");
BTSerial.print("1");
digitalWrite(led, HIGH);
--k;
else
BTSerial.print("0");
Serial.println("0");
digitalWrite(led, LOW);
void action()
Serial.println(ch);
if (ch=="ON"){
61
digitalWrite(led, HIGH);
After uploading the Arduino codes, it was written the code to the raspberry pi 3
in python, as can be seen in the following code:
import threading
import thread
import time
import bluetooth
import re
import md5
global message
message = {}
macEncryp=[]
macNonEncryp=[]
result=[]
global controlMesg
controlMesg = ''
global status
62
status = ''
global sockActuator
global q
nearby_devices = bluetooth.discover_devices(duration=3,lookup_names=True)
print nearby_devices
q=Queue()
pkt={}
packet={}
sock={}
myThread=[]
in_topic="Ofico/controls/in/#"
out_topic="Ofico1/controls/#"
client = mqtt.Client()
client.username_pw_set("ioteam","ioteam")
client_control = mqtt.Client()
client_control.username_pw_set("ioteam","ioteam")
print("Published: ",mid)
63
def on_connect(client, userdata, rc):
client.subscribe(out_topic,2)
q.put(msg.payload)
print msg.payload
global controlMesg
controlMesg=''+str(msg.payload)
print '123'+controlMesg
client_pub = mqtt.Client()
client_sub = mqtt.Client()
client_pub.username_pw_set("ioteam","ioteam")
client_pub.on_connect = on_connect
client_pub.on_publish = on_publish
client_sub.username_pw_set("ioteam","ioteam")
client_sub.on_connect = on_connect
client_sub.on_message = on_message
client_control.on_message = on_messageControl
64
lock = threading.Lock()
def sub_command():
client_sub.loop_forever()
def analyse_data():
lock.acquire()
data_queue=q.get()
fileMac=data_queue.split("|")
print fileMac
q.put(fileMac)
lock.release()
def pub_request():
#while 1 :
client_pub.publish(in_topic,"request")
#time.sleep(60)
lock_m= threading.RLock()
class exampleThread(Thread):
threading.Thread.__init__(self)
self.threadID= threadID
self.threadName=threadName
self.targetadd= targetadd
def run(self):
sock[self.threadID]=bluetooth.BluetoothSocket(
65
bluetooth.RFCOMM )
sock[self.threadID].connect((self.targetadd,1))
pkt[self.threadID]=''
global message
global controlMesg
while 1:
message[self.threadID] = []
message[self.threadID].append(sock[self.threadID].recv(4))
pkt[self.threadID]=''.join(message[self.threadID])
lock_m.acquire()
client.connect("52.77.88.152", 1883,60)
client.publish("Ofico/",
self.targetadd+','+pkt[self.threadID][len(pkt[self.threadID])-1]) # MQTT Topic,
MQTT Message = (MAC+Sensor_Status)
msg = ''.join(controlMesg)
if (str(self.targetadd) == "20:15:04:09:09:10") :
#~ msg = ''.join(controlMesg)
print msg
66
if msg is not '':
sock[self.threadID].send(msg)
controlMesg=''
lock_m.release()
time.sleep(1)
fileMac=['20:15:04:08:35:23','20:15:04:09:09:10','20:15:04:09:09:14']
for i in range(0,len(fileMac)):
for j in range(0,len(nearby_devices)):
if fileMac[i]==nearby_devices[j][0]:
result.append(nearby_devices[j])
arrayThread=[]
print result
for i in range(0,len(result)):
print i
topicname=str(result[i][1])
thread=exampleThread(i+1,topicname,result[i][0])
arrayThread +=[thread]
client_control.subscribe(out_topic,2)
client_control.loop_start()
for x in arrayThread:
print x
x.start()
67
4.3.1 Protocol for the connection between Smart Device Gateway
When running the python code, firstly it receives the signal of smart devices via
Bluetooth modules as shown in figure 4.8.
4.3.2 Architecture
After the understanding of some of the IoT platforms, an ecosystem was built, as
shows in figure 4.9. Here, is shown that the Arduino and Raspberry pi communicate
via Bluetooth, while Raspberry Pi and cloud communicate through the MQTT
protocol. In the Cloud, we have Node-Red, MongoDB and Mosquitto broker.
68
Figure 4.9: IoT ecosystem
4.3.3 Operation Modes
In all areas (first floor, stairs and second floor), we use motion sensors to turn on
the LEDs, in addition, in the second floor it is also controlled through the cloud.
When someone passes by the motion sensor of the first floor the locally control
“turn on” the LED of the first floor;
When that one passes by the sensor in the Stair area, then locally control to turn
on the LED in the stairs, all sensors (first floor, stair and second floor) sends their
data via Bluetooth to Raspberry Pi 3 in every one second, upon receiving the sensor
readings, Raspberry Pi Gateway published and stores the data in MongoDB through
MQTT protocol, then when the cloud detects that a smart device on the first floor
sends value "1" to the cloud and a smart device of the stairs also sends the value "1"
69
to the cloud, so the cloud sends “turn on” to the LED on the second floor after 5
seconds.
All sensors, when LEDs are turned on, they sends the signal 1(value) by 15
seconds to the cloud.
4.4 Results
When running python code in Raspberry Pi, we observed the PIR sensor data
being transmitted as shown in figure 4.10. The figure shows that we have three
devices transmitting data, one device is in the first floor (UI:'20:15:04:08:35:23');
two devices are in the stairs area (UI:'20:15:04:09:09:14') and in the second floor
(UI:'20:15:04:09:09:10') Where we have:
ON meaning that the cloud detects that in the first floor and stairs the LED
turns on, so it sends “turn on” to the LED of the second floor;
123ON meaning that all LEDs are “turns on”.
70
Figure 4.10: PIR sensor data
When a Gateway receives data sensors sends to the cloud through MQTT
protocol and in the cloud found the Node-Red, and then our Node-RED receives the
data from the MQTT broker to saves it in a Mongo DB. Figure 4.11 shows Node-
Red of our implementation.
71
Figure 4.11: Node-Red
In the cloud, we write code in that when detecting that the LED in the first floor
and the stairs are turned on it sends “turn on” command to the LED of the second
floor, as shown in the following code. The code was written in JavaScript and is in
the Node-Red on the function block, where we have “f”.
messArr = (msg.payload).split(",");
newMess.mac = messArr[0];
newMess.value = messArr[1];
context.global.floor1 = Number(messArr[1]);
context.global.stair = Number(messArr[1]);
72
if ((context.global.floor1 === 1)&&(context.global.stair === 1)){
context.global.floor2 = "ON";
} else {
context.global.floor2 = "OFF";
return newMess;
The access of the Interface RockMongo is done by using a browser, typing the IP
address of the server in the URL address bar, where appears the displayed window
as in figure 4.12.
73
Figure 4.13: Interface RockMongo (management software MongoDB)
Figure 4.14 illustrates Testbed for the Usecase Ecosystem where we can check in
figure three smart devices connected the power in each area, the Gateway and the
LEDs.
74
Figure 4.14: Testbed for the Usecase Ecosystem
75
CONCLUSION
Concluding this thesis, it was possible to understand how the IoT has a great
potential for developing applications that will fringe many benefits, not only for the
Network areas but also for the humanity.
IoT allows many advances and discoveries for the society. This occurs with
increasing amount of data available for processing that the IoT provides, along with
the capability of data communications in the Internet. Thus, the more data is
generated, the more knowledge and wisdom people will get. During the
development of this thesis, we noted the lack of information related to the subject of
national origin, which shows the lack of studies in this area. On the other hand, we
found a wide variety of documents, applications, and studies about Internet of
Things developed in countries such as China, the United States, and some European
countries. At the end of this thesis, the main goal which is the implementation of an
Internet of Things infrastructure using the communication protocol, is reached.
Future Work
During the implementation of practical work, we have faced many problems with
the Internet connection to achieve significant successes. We recommend that
Internet with good speed and connectivity must be used. Also the related theory
must be studied before in order to understand more about the Internet of Things.
The reason is because proponents of the Internet of Things promise us a world in
which we will be connected with literally every kind of things we can think of.
76
REFERENCES
[1] D. Evans.(2011), "The Internet of things-How the Next Evolution of the
Internet Is Changing Everything," Cisco Internet Business Solutions Group.
[5] L. Coertzee and J. Eksteen. (2011), "The Internet of Things - promise for the
future? An introduction," in IST- Africa conference Proceedings.
[7] H.-X. ZHAO. (2010), "Internet of Things key technology Analysis and
Discussion [J] Western Technology," China.
77
[11] [Online]Available:https://cloud.google.com/solutions/architecture/streampro
cessing. [Accessed 15 05 2016].
[13] [Online].Available:http://www10.mcadcafe.com/blogs/jeffrowe/2015/05/14/
ptc-thingworx-converges-on-iot/. [Accessed 20 04 2016].
[17] [Online].Available:http://www.rs-
online.com/designspark/electronics/knowledge-item/eleven-internet-of-
things-iot-protocols-you-need-to-know-about. [Accessed 20 05 2016].
[21] I. T. Union. (2005), " The Internet of Things. Executive Summary," ITU
Internet Reports , Geneva.
[22] [Online].Available:https://www.ida.gov.sg/~/media/Files/Infocomm%20Lan
78
dscape/Technology/TechnologyRoadmap/InternetOfThings.pdf. [Accessed
20 04 2016].
[25] A.-Q. A.S. and e. al. (December 2015), "inter. Journal of Engineering
Research and Applications", vol. 05.
[27] ITU. (2014), "ITU-T Focus Group on M2M Service Layer: M2M service
layer: APIs and protocols overview".
[28] [Online].Available:http://dspace.howest.be/bitstream/10046/1184/1/LanderA
rnoys.pdf. [Accessed 02 06 2016].
[30] [Online].Available:http://tec.gov.in/pdf/Studypaper/White%20Paper%20on
%20Machine-to-Machine%20(M2M)Communication.pdf. [Accessed 20 05
2016].
[32] [Online].Available:http:
//internetofthingsagenda.techtarget.com/definition/gateway. [Accessed 08 07
79
2016].
[38] [Online].Available:http://www.learningaboutelectronics.com/Articles/Ardui
no-motion-sensor-light-circuit.php. [Accessed 20 05 2016].
80
Appendix A: Arduino code for the Second Floor
#include <SoftwareSerial.h>
#include <pt.h>
boolean condition=false;
char check_data = 0;
int value;
int k;
void setup() {
pinMode(led, OUTPUT);
digitalWrite(led, LOW);
Serial.begin(9600);
Serial.println("Start");
BTSerial.begin(38400);
PT_INIT(&pt2);
PT_INIT(&pt3);
81
void SensorMotion(void);
void action();
void loop() {
protothread2(&pt2, 1000);
protothread1(&pt1, 1000);
protothread3(&pt3, 1000);
// SensorMotion();
PT_BEGIN(pt);
while(1) {
getDataFromSensor();
PT_END(pt);
PT_BEGIN(pt);
while(1) {
82
PT_WAIT_UNTIL(pt, millis() - timestamp > interval );
timestamp = millis();
act();
PT_END(pt);
PT_BEGIN(pt);
while(1) {
timestamp = millis();
action();
PT_END(pt);
void getDataFromSensor()
if (value == 1)
k=15;
83
void act()
if(k>0)
Serial.println("1");
BTSerial.print("1");
digitalWrite(led, HIGH);
--k;
else
BTSerial.print("0");
Serial.println("0");
digitalWrite(led, LOW);
void action()
Serial.println(ch);
if (ch=="ON"){
if (k<5) {
k = 5;
84
}
85