Analysis and Applications of IOT Using Raspberry Pi
Analysis and Applications of IOT Using Raspberry Pi
Communication Technology, Vol 4, Issue 12, December- 2015 ISSN (Print) 2320- 5156
Abstract – As the next frontier of the Internet, the IoT Nowadays, there have many implementations of IoT
represents a persuasive opportunity across an astounding devices, for instances, heart monitoring implants,
array of applications. When taken as a whole, the IoT can automobiles built-in sensors, farm animals equip with
potentially transform nearly every aspect of how we live, biochip transponders, field operation device used by fire-
work, and play, on local and global levels. Having a smart fighters in search and rescue etc. [2]. In the present market
network, connected devices means we can assure the implementation of smart thermostat systems and
constructing safer buildings, design more fuel-efficient washer/dryer for remote monitoring by using Wi-Fi are
cars, and lead secured and healthier lifestyles. Self- very much available [3].
regulating systems, accessing Big Data, much more
automated manufacturing, more intelligent supply chains, According to McKinsey Global Institute, IoT has wider
and maximum use of scarce and meager resources. market and potential to create economic impact of $2.7
Onboard sensors are an essential part of the IoT, enabling trillion to $ 6.2 trillion annually by 2025[4]. IoT is not
the connected devices the ability to track/trace and respond futuristic or inspirational technology trend; instead it
to environmental conditions. Sensing requirements have already exists in our devices, cloud infrastructure, data, and
changed from simple monitoring to simultaneous analysis sensor as well as business intelligence tools. Microsoft
and fusion of data from different sensors and sensor types. Corporation also delivers unique and integrated approach
This includes accelerometers, gyroscopes and for all enterprises to capitalize on IoT by collecting, storing
magnetometers, as well as environment sensors like light and processing data. This method was extends from broad
level, color, temperature, pressure, humidity, etc. This product portfolio such as PC, tablets and industry devices
article explores the use of Raspberry Pi to function as a on edge of enterprise network to backend system and
server in which several laptops are connected to it to copy, services develop tool and diverse partner ecosystem [5].
store and delete the file over network. IT requires
authentication for user login before granting access to the In 2007, there collapsed a bridge in Minnesota [6], the
file to ensure data integrity and security. File server is cause of this tragic accident is steel plates were inadequate
widely used in many areas, for example in education for to handle to bridge’s load. If we are implementing smart
uploading study notes into the server and students can cement which equipped with sensor to monitor cracks,
immediately download it into their laptops. Moreover this stresses and war pages, the tragedy sure can be escaped.
work also explores the use of Raspberry Pi B+ model and Therefore, IoT should be further exploring as object can
XBee (ZigBee module) to demonstrate wireless represent itself digitally or becomes more powerful than it.
communication data transmission, proving the validity of It is known as “ambient intelligence” when there are many
usage as a mobile low-power wireless network objects act in unison [7].
communication. The main goal of the research is to explore
the use of Raspberry Pi for client-server communication 1.1. System Architecture
using various wireless communication scenarios such as
Wi-Fi and ZigBee.
A web server is a system which hosts a web site an
Index Terms – Client/server, Raspberry Pi, XBee, IOT, provides services for any requesting clients. The general
Sensors. purpose web servers compose of an operating system, the
Introduction web pages or the application and a huge amount of
Internet of things (IOT) can be defined as interconnection
memory and sometimes a special hardware. Below Fig
between people animal or object that ability to exchange
shows a typical client-server architecture where, the client
data over network without involving human-to-human or accesses the server through the LAN router and the
human-to-computer interaction. IOT offer several kinds of
Internet. Whenever, the client wants to access the sever, it
connectivity from devices, systems, and services that work
sends the request to the server, this request is taken by the
within machine-to-machine communications (M2M) and
router, which is connected to the Internet. The web
cover with applications, domains and protocols. [1].
processes the request made and finally connects to the
desired web server, access the requested data and sends the and service announcement. In this project, samba is use for
data to the client as a server in raspberry pi for remote file access with
multiple computers.
Conceptual Diagram
1.3. ZigBee
Cagnetti, M. et. al. (2013) has conducted work on “A New 3.2. Software List
Remote and Automated Control System for the Vineyard
Hail Protection Based on ZigBee Sensors, Raspberry-Pi Raspbian OS: It is the official image for
Electronic Card and WiMAX” [17]. The author proposed RaspberryPi, software development for this OS
systems that perform action to protect vineyard and relay includes python language.
message to remote control. For the overall design, an
“umbrella” solution is used in which ZigBee sensor used to Window 7: is used by client model to gain
send the data to central control unit (Raspberry Pi). remoteaccess to file server. It can store, copy and
However, WiMax are chosen because it overcomes both delete file in server.
distance limitation of Wi-Fi and the absence of ADSL.
They provide result to prove that the system is user Samba: is an open source server mainly for file
friendly and effective to protect over hail and maintenance transfer.
cost.
3.3. Client-Server Communication using Wi-Fi
3. METHODOLOGY
In this experiment, client-server communication is
In this project, Raspberry Pi is used as a server by explored by transferring file wirelessly to the server using
connecting to several laptops as clients in the same Wi-Fi communication. Raspberry Pi supports wireless
network. The work was explored in three different communication by allowing connection to wireless
scenarios, i. client-server communication using Wi-Fi, ii. adapter. In order to set up a server in Raspberry Pi, samba
Client-server communication using ZigBee and iii. Client- software is used by setting configuration such as permit
server communication within local host for remote file user to read only, write only or read write access. Part of
sharing facility. Router is used to create a wireless network the configuration in samba is shown below:
communication between the devices. To create remote file
sharing environment, wireless adapter and router is used [PiShare]
and 2 units of XBee S1 series ZigBee communication is comment=Raspberry Pi
used to explore an alternative wireless communication Share path=/home/pi/share
platform. In order to carry out the research, several browseable=Yes
hardware and software platforms were required as shown writeable=Yes
below.
Only guest=no
3.1. Hardware List create
mask=0777
Raspberry Pi B+: Small and portable board that public=no
can perform as a computer. It acts as a file server
in this work. Path: is the folder location for sharing file.
Browseable = yes: enable client to search for the
SD card: Raspbian OS in SD card file. Writeable = yes: enable client to modify the
file.
Asus WL-167G V3: Wireless adapter for
Raspberry Pi Wifi connection. Public = no: whenever client want access to the shared
From configuration menu, select 'save setup as dfl'. Figure 8: Testing connection and checking firmware
and communication channel (Unit A)
Finally, return to the main minicom menu
('Command Summary'). 3.5. Client-Server Communication within Localhost
Hit 'A' to add linefeed then return and hit 'E' to add In this scenario, python script is written for communication
local echo. Their actual toggled status is not between client and server within localhost [20]. It uses
displayed. Since linefeed and echo are not saved in raspberry pi as a medium in this communication. Client will
default settings, these need to be changed each time send a request message to the server to get some
minicom is used. information, then server will process it and reply the request
message to the
Now minicom main screen can be used as a serial terminal client. Figure 9 shows the architecture of client server
for sending commands to the XBee device. Type '+++' and communication within localhost.
should get 'OK'. The communication only stays open for a
few seconds. If more time elapses, enter '+++' again to re-
cmd = raw_input()
if cmd.strip() ==
'!q':
sys.exit(1)
Figure 9 client server communication within localhost
self.sock.send(cmd)
Code below shows part of server configuration:
except:
PORT = 8018
self.sock.close()
TIMEOUT = 5
BUF_SIZE = 4. RESULTS AND DISCUSIONS
1024
# set up socket
sock = socket.socket(socket.AF_INET,
socket.SOCK_STREAM)
sock.setsockopt(socket.SOL_SOCKET,
socket.SO_REUSEADDR, 1)
sock.bind((HOST,
PORT)) sock.listen(5)
print '-= WhatsUp Server =-' 4.1. File server communication result
print '>> Listening on:',
PORT print '>> Author: After configuring raspberry server site, windows users can
Raspberry Pi' print '' now connect to the RASPBERRYPI network. It is necessary
forusers to login before they can browse the file as it has
Code below shows part of client configuration: been configured in the server site. This is important to
improve data integrity and privacy of the file, so that
HOST = unauthorized users cannot gain access. Figure 10 shows
'127.0.0.1' PORT login authentication for RASPBERRYPI network. Figure 11
= 8018 shows the file that is stored in the RASPBERRYPI shared
TIMEOUT = 5 folder such as images, documents and drivers.
BUF_SIZE =
1024 After completing all the setup and configuration of both
XBee units on Raspberry Pi (Raspbian OS) and the laptop
def __init__(self, host=HOST, port=PORT): (Windows OS), the following test are conducted. Figure 12
shows XCTU program running, and showing locally
self.sock = socket.socket(socket.AF_INET, connected XBee (Unit B) on the left panel and wireless
socket.SOCK_STREAM) detected XBee (Unit A) on the right panel.
self.sock.connect((host, port)) After tracking down wireless XBee, XBEE (Unit B) is used
logging.info('Connecting to %s:%s' % (host, to send test packet to XBee (Unit A) as shown in Figure 13.
port)) while 1: Figure 14 shows test packets are generated and being
converted to hexadecimal form in case of transmitting to
try: XBee(Unit A).
buf = Before completing the experiment, a range test was done for
self.sock.recv(BUF_SIZE) XBee. Range test is the amount of data packet can be sent in
sys.stdout.write(buf) a message. Figure 19 shows the range test running and
Figure 20 shows users create custom payload packet for avenue for researchers who wish to embark into this new
range test whilst result is shown in Figure 21. embedded invention. Raspberry Pi can also be used as an
Figure 21 Unit A receives that packet from Unit B educational tool as it comes with Scratch as an animation
through ZigBee network tool for young learners.
When client sends a request message to server local host, the [3] Libby Sander & Susan Saulny (2 August 2007), Bridge
server processes the request and reply back to the client. collapse in Minneapolis Kills at least 7, from New York
Figure 22 shows client request is displayed in the local host Times [ONLINE] Available:
server through web browser. http://www.nytimes.com/2007/08/02/us/02bridge.html?
_r=0
5. CONCLUSION
[4] Jack M. Germain (9 October 2014), The Importance of
Raspberry PI is useful for small application development Openness to the Internet of Things [ONLINE]
because it can be used to integrate with many components Available:
such as speakers, LED lights, sensors, cameras and wireless http://www.linuxinsider.com/story/81024.html?rss=1
communication units to develop smart applications. In this
project, two ZigBee module is being communicated with [5] Anonymous, (n.d), Raspberry Pi [ONLINE] Available:
two different devices (laptop and raspberry PI). With the http://my.rs
successful communication implementation, it can be further online.com/web/generalDisplay.html?id=raspberrypi
developed by adding sensors to develop smart applications [9] Anonymous, (n.d), What is a raspberry pi [ONLINE]
such as smart alarm system, population of customer walk-in Available: http://www.raspberrypi.org/help/what-is-a-
and walk-out, temperature alert system and so on. This raspberry-pi/
project also demonstrates how files are being shared between
raspberry pi and windows users. Raspberry PI acts as server [10] Anonymous, (n.d), What is samba [ONLINE]
by using samba. Samba was choosen because it is free Available:
software and enables admin to configure for file access to https://www.samba.org/samba/what_is_samba.html
protect the privacy or personal information of a company. It
is very important to protect the file in order to maintain data [11] Anonymous, (n.d), Configure Samba [ONLINE]
consistency and accuracy. File sharing is widely used Available:
ranging from small-medium sized company to big company. http://www.ephesoft.com/wiki/index.php?title=Configur
One of the reason is that, admin can easily manage the file e_Samba
and client can access the file efficiently. For future
development, whenever user login failed more than three [12] Annonymous, (n.d), XBEE [ONLINE] Available:
times it will generate sound and send a message to alert http://www.geeetech.com/wiki/index.php/XBee
admin because there could be an intruder into the system. In
conclusion, Raspberry Pi can be the future for smart [13] John Donovan, (24 May 2012) Security Issue with Wi-
applications and client-server communications. This project Fi, Bluetooth, and ZigBee [ONLINE] Available:
is a stepping stone to introduce the various features and http://www.digikey.com/en-
possibilities available in Raspberry Pi and opens up an US/articles/techzone/2012/may/security-issues-with-
wifi-bluetooth-and- zigbee.
Authors