0% found this document useful (0 votes)
429 views8 pages

Analysis and Applications of IOT Using Raspberry Pi

This document discusses using a Raspberry Pi to function as a file server for connecting multiple laptops over a network. It explores using the Raspberry Pi for client-server communication using Wi-Fi and ZigBee wireless technologies. The Raspberry Pi runs a Samba server to allow remote file access from multiple computers. The document also discusses using the Raspberry Pi and XBee module to demonstrate low-power wireless data transmission between devices.

Uploaded by

Amel B
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
429 views8 pages

Analysis and Applications of IOT Using Raspberry Pi

This document discusses using a Raspberry Pi to function as a file server for connecting multiple laptops over a network. It explores using the Raspberry Pi for client-server communication using Wi-Fi and ZigBee wireless technologies. The Raspberry Pi runs a Samba server to allow remote file access from multiple computers. The document also discusses using the Raspberry Pi and XBee module to demonstrate low-power wireless data transmission between devices.

Uploaded by

Amel B
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

International Journal of Research in Computer and ISSN (Online) 2278- 5841

Communication Technology, Vol 4, Issue 12, December- 2015 ISSN (Print) 2320- 5156

Analysis and Applications of IOT using Raspberry Pi


S.Raja Gopal1, B.Praveen Kumar2, Venneti.kiran3
123
Assistant Professor, Dept. of Electronics & Communication Engineering,
Aditya College of Engineering, Surampalem

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

www.ijrcct.org Page 2044


International Journal of Research in Computer and ISSN (Online) 2278- 5841
Communication Technology, Vol 4, Issue 12, December- 2015 ISSN (Print) 2320- 5156

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

ZigBee refers to high-level communication protocol which


can be used to build a personal area networks (PAN). It is a
small and low-power digital radio that based on IEEE
802.15.4 standard. Due to its low power consumption, the
transmission distance is up to 10 – 100 meter line-of-
sights. However, it increases the output power and less
resistance in signal [12].

ZigBee is mostly used in low data a rate application that


does not require high power consumption and secure
transmission. ZigBee networks use of 128 bit symmetric
encryption keys [13]. ZigBee has pre-defined rate of 250
kbit/s, which is best for intermittent data transmissions
from a sensor or input device.

There is various kind of existing application such as


wireless light switches, traffic management system, and
consumer equipment etc. are use of short-range low-rate
1.2. Raspberry Pi wireless data communication such as ZigBee. ZigBee is
considered better than other technology (Bluetooth or Wi-
The Raspberry PI is a low cost, small and portable size of Fi) because it is simpler and less expensive [14].
computer board. It can be used to plug into computer
monitor or television, keyboard, mouse, pen drive etc. 2. RELATED WORKS
Raspberry Pi has built in software such as Scratch which
enables users to program and design animation, game or Megat N.M. Mohamed Noor (2013) has conducted work
interesting video. In addition, programmers can also on community based home security using wireless mesh
develop script or program using Python language; it’s the network [15]. In this work, the author builds a prototype
main core language in Raspbian operating system [8]. for home security system that is based on wireless mesh
Raspberry Pi B+ is evolution of Model B. Python language network. The system is considered cost effective and
is used in this work to write script for client/server scalable. It is considered a community based application as
communication. Moreover, there are improvements such as it uses open mesh wireless router and raspberry PI device
adding more GPIO header PINS, more USB ports, lower and the deployment is shared among house residential. The
power consumption etc. It is recommended to use model raspberry Pi B+ board is interfaced with PIR sensor to
B+ for school learning because it offers more flexibility detect movement. Moreover, it uses Filezilla server to
than model A especially for embedded projects and transfer captured image from Raspberry Pi to host over
requires low power, providing more USB ports compared TCP network. The results show the benefit of
to Model B [9]. implementing this system over home security as it
produces a clear human face detection and recognition.
Samba is open source software that provide seamless file The system can also be expanded by deploying additional
and print service to SMB/CIFS clients [10]. This software open mesh wireless router, camera and sensor node.
is considered a good and user friendly development
because it allows interoperability between Linux/Unix A research on “An agent-based middleware for
server and Window-based clients. Samba server consists of decentralized dynamic data-gathering in wireless sensor
two key programs which is smbd and nmdb [11]. The four networks” has been done by Haghighi, M. & Cliff, D.
main services provided by Samba included: file and print (2013) [16]. This article describes the design and
services, authentication and authorization, name resolution development of Sensomax which is written in Java and run

www.ijrcct.org Page 2045


International Journal of Research in Computer and ISSN (Online) 2278- 5841
Communication Technology, Vol 4, Issue 12, December- 2015 ISSN (Print) 2320- 5156

on network ranging from limit resource as Sun Spot nodes


to resource rich as Raspberry Pi board. Sensomax  Wireless router: Provide wireless environment for
facilitates fully distributed and decentralized bulk file access between client and server.
programming and update of sensor node to serve multiple
simultaneous applications used by users. It also enables  Computer: Client model that gain remote access
dynamic run-time changes in application and switch to raspberry Pi.
between time-driven, data-driven and event-driven
operational model. Sensomax are able to operate and  XBee: It used connect to Raspberry Pi to act as
provide response to application request without data transmitter and another XBee connect to
interrupting outgoing network operation. Window to act as receiver.

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

www.ijrcct.org Page 2046


International Journal of Research in Computer and ISSN (Online) 2278- 5841
Communication Technology, Vol 4, Issue 12, December- 2015 ISSN (Print) 2320- 5156

folder must login with a valid user.


Figure 4 Wireless sensor connected through Cytron
Create mask = 0777: allow directories/folders created board to XBee (Unit A) for communication
within the parent have read/write permissions.

only guest = no: refer for authorized user only.

Figure 1 shows the overall system architecture of client


server files sharing in which laptop (client) can remote
access to the file in raspberry pi (server). Figure 2 shows
raspberry Pi connected with different components such as
power source, HDMI to VGA cable and wireless adapter.

3.4. Client-Server Communication using ZigBee

ZigBee is a short range communication technology that is


very suitable for low data rate short distance
communication forming a mesh network. Raspberry Pi has
features to allow for wireless communication using Figure 5 XBee (Unit B) to be connected to Laptop
ZigBee. The following experiment shows how Raspberry
Pi can be configured for wireless communication for short After designating the XBee to PC interface and building up
range file transmission. Together with ZigBee, XCTU is the hardware, testing need to be done to make sure the PC
required to view ZigBee connections and range test. can talk to the XBee module. Figure 7 show the testing
communication with XCTU.
3.4.1. Setting up XCTU in Windows

The XBee manufacturer, once called maxstream, now


'Digi', built software called X-CTU and it works on all
versions of windows. This software can be downloaded for
free from: http://www.digi.com [18]. Figure 3 shows the
basic installation of XCTU.
The installation process for this program is just like any
other, so can download and get it installed in the laptop or
desktop. Next, two XBee and a Raspberry Pi is used to
setup the communication environment. Figure 4 shows
wireless sensors connected to XBee (Unit A) through
Cytron board, whereas another XBee is connected to the
laptop as shown in Figure 5. Figure 6 shows raspberry Pi
connected with different components such as XBee and
mouse.

Figure 6: Raspberry Pi model B+ connected to


HDMI, Mouse, Keyboard, LAN and XBee
(USB)

www.ijrcct.org Page 2047


International Journal of Research in Computer and ISSN (Online) 2278- 5841
Communication Technology, Vol 4, Issue 12, December- 2015 ISSN (Print) 2320- 5156

X-CTU cannot be installed on Raspberry Pi since Wine


does not support ARM processors. In order to
communicate XBee with the Raspberry Pi, Minicom must
be installed and configured correctly [19]. The Minicom
tool can be downloaded through Aptitude. After installing,
the following steps are required to configure the XBee.

 Upon plugging in the ftdi cable+adapter/xbee


module, it is detected in /dev as ttyUSB0, so make
sure to use ttyUSB0 below.

Using minicom, the steps for getting serial communication


with the XBee are as follows.

 Enter this command: minicom --device


Figure 7: Testing XBee communication with XCTU /dev/ttyUSB0
3.4.2. Setting up Minicom in Raspbian OS
open. If type 'atid' then hit enter, it should return your
 Can see the minicom screen. As prompted, hit Ctrl- device's default PAN id. From there it is ready to use AT
A and Z to enter setup. (To quit at any point, hit commands to configure the device on the serial terminal.
Ctrl-A and Q.) Figure 8 shows testing connection and checking firmware
and communication channel (unit A).
 Hit "o" and <enter> to 'configure minicom'. From
the next screen, select 'serial port setup'.

 On the port setup screen, choose 'E' to set 9600 8N1

 Hit <enter> and return to port setup screen. Toggle


F to set hardware flow control to off.

 Leave port setup and go to 'modem and dialling


setup'. Hit A and remove all the characters from init
string; hit B and remove all characters from reset
string so those fields are empty.

 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-

www.ijrcct.org Page 2048


International Journal of Research in Computer and ISSN (Online) 2278- 5841
Communication Technology, Vol 4, Issue 12, December- 2015 ISSN (Print) 2320- 5156

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

www.ijrcct.org Page 2049


International Journal of Research in Computer and ISSN (Online) 2278- 5841
Communication Technology, Vol 4, Issue 12, December- 2015 ISSN (Print) 2320- 5156

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.

4.3. Client server communication within local host result REFERENCES

[1] Manyika J. et. al. (2013), disruptive technologies:


Advance that will transform life, business and the global
economy retrieved from McKinsey & Company
[ONLINE] Available:
http://www.mckinsey.com/insights/business_technology
/disruptive_tec hnologies

[2] Internet of Things (2014), retrieved from Microsoft


[ONLINE] Available:
Figure 22 Local host server display client request in http://www.microsoft.com/windowsembedded/en-
web browser. us/internet-of-things.aspx

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-

www.ijrcct.org Page 2050


International Journal of Research in Computer and ISSN (Online) 2278- 5841
Communication Technology, Vol 4, Issue 12, December- 2015 ISSN (Print) 2320- 5156

wifi-bluetooth-and- zigbee.

[14] David Baker, ( 15 August 2013). How ZigBee


Compares in Wireless Home Automation, [ONLINE]
Available: http://www.control4.com/blog/2013/08/how-
zigbee-compares-in- wireless-home-automation

[15] Megat N.M. Mohamed Noor. Community based home


security system using wireless mesh network.
International Journal of Academic Research Part A;
2013; 5(5), 73-79. DOI: 10.7813/2075-4124.2013/5-
5/A.9.

Authors

www.ijrcct.org Page 2051

You might also like