0% found this document useful (0 votes)
55 views17 pages

Server Design Document For IOT Considering Gps Tracker As A Example

This document describes the design of a server to store GPS tracking data from IoT devices. It evaluates using the LAMP (Linux, Apache, MySQL, PHP) and MEAN (MongoDB, Express, Angular, Node.js) stacks before selecting MEAN. MEAN was chosen for its flexibility, ability to store data as JSON documents in MongoDB instead of tables, and support for future enhancements. It then outlines installing MongoDB, connecting it to the server using Robomongo, and testing the data storage.

Uploaded by

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

Server Design Document For IOT Considering Gps Tracker As A Example

This document describes the design of a server to store GPS tracking data from IoT devices. It evaluates using the LAMP (Linux, Apache, MySQL, PHP) and MEAN (MongoDB, Express, Angular, Node.js) stacks before selecting MEAN. MEAN was chosen for its flexibility, ability to store data as JSON documents in MongoDB instead of tables, and support for future enhancements. It then outlines installing MongoDB, connecting it to the server using Robomongo, and testing the data storage.

Uploaded by

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

Software Design Document 1(17)

Document number
IOT-EMBD-SDD Rev 1.0

Server Design Document


For
IOT considering gps tracker
as a example

Company
Confidential
Software Design Document 2(17)

Document number
IOT-EMBD-SDD Rev 1.0

Revision History:
Date Revision Description Prepared by
No.
25th April 2017 1.0 Initial release Vishwa ys

Documents Referred:
No. Document Name Revision Date
1 Server Design Document
2
3
4
5
6
7
8

Company
Confidential
Software Design Document 3(17)

Document number
IOT-EMBD-SDD Rev 1.0

Table of Contents
List of Figures...................................................................................................................................................... 5

List of Tables....................................................................................................................................................... 5

1. Introduction............................................................................................................................................... 6

1.1. Architecture selection............................................................................................................................. 6

1.2. Scope..................................................................................................................................................... 9

1.3. GPS Tracking System Block Diagram...................................................................................................... 10

2. Domain selection...................................................................................................................................... 11

3. Gathering prerequisites............................................................................................................................ 11

4. Installation of the Mongo Server............................................................................................................... 12

4.1. Robomongo tool................................................................................................................................... 13

5. Test results............................................................................................................................................... 14

6. References................................................................................................................................................ 16

List of Figure

Company
Confidential
Software Design Document 4(17)

Document number
IOT-EMBD-SDD Rev 1.0

Figure 1: Block diagram of difference between LAMP and MEAN...............................................................7


Figure 2: Block diagram of typical App MEAN Architecture.........................................................................8
Figure 2: Block diagram GPS tracking system............................................................................................10
Figure 4: Snap of Robomongo tool with the created DB and collection in the project..............................14

List of Tables
No table of figures entries found.

Company
Confidential
Software Design Document 5(17)

Document number
IOT-EMBD-SDD Rev 1.0

1. Introduction
This document describes the server development for the “GPS Tracker-Type2” is being
developed for tracking the device on the Google map based on the latitude and longitude
values provided by the device to the server using UBLOX protocol.

This document also explains how to build a private network for storing GPS data sent by the
device in the server, the whole system replicates the functionality of the IOT (Internet of things)

This document is made for the references of:

 Engineering Team at ELDAAS for design and development of GPS Tracker.


 Networking and IOT Team at ELDAAS technologies.

The basic hardware information of the device used in the server system is described as follows,
Hardware design of the “GPS Tracker – Type2” being developed for 3D integrated solutions Pvt
Ltd. GPS Tracker is based on the Tiva C microcontroller from TI, MAX-M8 GPS Module from u-
Blox and M66 GSM Module from Quectel.

GPS Tracker product is designed to be used in commercial domain where it is used for personal
or pet location tracking. The device is synchronized with a mobile application where the
location of the person/pet who is wearing the device can be observed.

1.1. Architecture selection

Architecture selection section is the most important point to be concentrate while server
implementation in the project because this step will decides the future scope of the project, in
the proposed project there are two options for architecture they are LAMP and MEAN.

LAMP is a combination of Linux platform, Apache tomcat server, Mysql database and Php
scripting language, LAMP is old famous architecture from past so many years it uses mysql
database for storing the data in the form of json table format but now the mysql database is
occupied by the oracle so there migh be confliction in the open source tools, so the proposed
project done with the MEAN architecture.
The difference between of the two architecture can be breifly pictorially explained as follows.

Company
Confidential
Software Design Document 6(17)

Document number
IOT-EMBD-SDD Rev 1.0

Figure 1: Block diagram of difference between LAMP and MEAN

There are so many architecture available outside to construct GPS tracking server system
but proposed project is followed with MEAN architecture because it is flexible for the future
application enhancements and the database used in this project will store the data as a script
instead of storing as a table, MEAN is a combination of four parts those are describes as
follows.

MEAN is architecture it has the capability of tracking the device by making the port listening on
the particular IP, flexibility of demodulating code, storing data in backend of the server and
frontend development to mark the position of the device on the Google map.

Standardization of the MEAN architecture

 The letter ‘M’ stands for MongoDB:

MongoDB is the leading NoSQL database, empowering businesses to be more agile and
scalable.

Where MongoDB is used to store the data received by the tracker device as a script (JSON
object) in the specified collection (sub directory).
Company
Confidential
Software Design Document 7(17)

Document number
IOT-EMBD-SDD Rev 1.0

 The letter ‘E’ stands for Express:

Express is a minimal and flexible node.js web application framework, providing a robust set of
features for building single and multi-page, and hybrid web applications.

 The letter ‘A’ stands for AngularJS:

AngularJS lets you extend HTML vocabulary for your application. The resulting environment is
extraordinarily expressive, readable, and quick to develop.

 The letter ‘N’ stands for Node.JS:

Node.js is a platform built on Chrome's JavaScript runtime for easily building fast, scalable
network applications.

The typical App architecture of the MEAN is as follows.

Figure 2: Block diagram of typical App MEAN Architecture

Company
Confidential
Software Design Document 8(17)

Document number
IOT-EMBD-SDD Rev 1.0

1.2. Scope
The scope of this project is to develop a private network to build a GPS tracking system by
installing server on the windows platform using MEAN architecture.

The whole project resembles the IOT system, the proposed project is a best prototype for
the IOT technology.

The following points are the enhancement in the scope of proposed project

 Selection of platform/domain.
 Collection of prerequisites
 Installation of the server
 Installation of the MongoDB
 Installation of the node.js

Company
Confidential
Software Design Document 9(17)

Document number
IOT-EMBD-SDD Rev 1.0

1.3. GPS Tracking System Block Diagram


This section describes the how the communication develops between tracker device to the
Android App/web App. Using MEAN architecture and UBLOX protocol.

The proposed project architecture is shown below and the functionality of the architecture
can be explained as follows, the GPS tracker will send the informative data (i.e., complete
data including latitude, longitude, GSM,SEN, device data etc…) to the Eldaas or private
server via GSM or WIFI (for the establishment of internet connection), server could
demodulate the data and expose the latitude and longitude values to the web browser
using particular IP and port , the user can browse the location of the device on the browser
with the given http address and port.

Private /Elaadas
server

Internet

GPS Tracking system

GPS tracker
Browser/App

Figure 3: Block diagram GPS tracking system

Company
Confidential
Software Design Document 10(17)

Document number
IOT-EMBD-SDD Rev 1.0

2. Domain selection
This section describes in which domain mongo server can be installed, mongo server can be
installed in any platform like windows, Linux or mac but in the proposed project windows
operating system is chosen as domain.

But the system which server has to be installed should have the following minimal
requirements for the best performance.

1. Should be 64 bit operating system architecture


2. More than 4GB RAM
3. More storing capacity (min 500GB) for a simple application server development.

3. Gathering prerequisites
This section explains how to collect prerequisites for the Installation of server on the windows platform,
there are many dependencies to install the mongo server they are as follows
The proposed project requires “Express, node.js, socket.io” to be installed to create a service in the node
program, which is always listening for the specified port and IP (Internet protocol) and this can be done
through npm (node package manager).

Node package manager is a command based package provider which is needful for the project,
The required Express can be installed on the server running system with the following command

Installing node:
Download the node package from the internet for the suitable version for the operating system and
follow the steps as usual as installing .exe file, to check it weather is properly installed on the system
type node in the command prompt.

Installing Express:
“npm install Express”
If this command not worked properly like reply back any error then go with
“npm install Express -g” or “npm install --save express”
-g stands for installing Express globally in the system

Installing Socket.io:
To install the socket.io use the following npm command
“npm install socket.io –g”

Company
Confidential
Software Design Document 11(17)

Document number
IOT-EMBD-SDD Rev 1.0

This package useful to call server function in the running server and create a server in running server.

Nodemon:
Nodemon is intelligent command which is used for start the node program automatically, to install the
nodemon type the following command in the command prompt.
“npm install -g nodemon”

4. Installation of the Mongo Server


As we know that the available architecture like LAMP and MEAN open source so we can
download from the internet and follow the steps mentioned below to make server setup on the
windows platform.

Quick start:

 Download the Mongo DB .msi file from the net using following link
https://www.mongodb.com/download-center?jmp=nav#community
 Then install the .msi file by double clicking
 Open command prompt and go to the installed location and run the mongod.exe to
start the Mongo DB
 Open command prompt and go to the installed location and run the mongo.exe to
connect the Mongo DB

Configuration need to be done in the installed mongo server

1. Open an Administrator command prompt.

Press the Win key, type cmd.exe, and press Ctrl + Shift + Enter to run the Command Prompt as


Administrator.

Execute the remaining steps from the Administrator command prompt.

2. Create directories.

Create directories for your database and log files:

mkdir c:\data\db

mkdir c:\data\log

3. Create a configuration file.

Company
Confidential
Software Design Document 12(17)

Document number
IOT-EMBD-SDD Rev 1.0

Create a configuration file. The file must set systemLog.path Include additional configuration


options as appropriate.

For example, create a file at C:\Program Files\MongoDB\Server\3.2\mongod.cfg that specifies


both systemLog.path and storage.dbPath:

systemLog:

destination: file

path: c:\data\log\mongod.log

storage:

dbPath: c:\data\db

4. Start the MongoDB service.

To stop the MongoDB service, use the following command: net start MongoDB

5. Stop or remove the MongoDB service as needed.

To stop the MongoDB service, use the following command: net stop MongoDB

4.1. Robomongo tool


Robomongo is a virtual database tool to create, modify or delete the data sent by the tracker device in
the particular collection of the database, this tool is very useful to create a database and collection in
the server implementation.

The Robomongo is used in the project for verifying the inserted data and data format from the GPS
tracker device, the following snap is the database and collection created in the MongoDB.

Company
Confidential
Software Design Document 13(17)

Document number
IOT-EMBD-SDD Rev 1.0

Figure 4: Snap of Robomongo tool with the created DB and collection in the project

5. Test results
To do the testing of GPS tracking system follow the steps mentioned below.

Step1. Run the mongod server as mentioned before

Step2. Run the index program attached in the coding section ie., node index.js

Step3. Run the support.js file located in the same file location where index.js file stored with node
support.js

Step4. Start browsing with localhost : 2346 to see the tracker marker on the map.

In the below shown image the left upper console picture is showing that raw data receiving from the
GPS device, left down picture showing the latitude and longitude values captured from the database and
exposed those on web service and right snap showing the location marked on the Google map

Company
Confidential
Software Design Document 14(17)

Document number
IOT-EMBD-SDD Rev 1.0

Figure 5: Snap of Robomongo tool window showing location of the tracker

Company
Confidential
Software Design Document 15(17)

Document number
IOT-EMBD-SDD Rev 1.0

6. References

a. For the installation of the mongo server referred following link


https://www.mongodb.com/download-center?jmp=nav#community

b. For Robomongo tool installation referred following link

https://gist.github.com/piraveen/c7e786990a422998f2c249c8bbe0873c

c. Installation of node on the windows referred following link

http://blog.gvm-it.eu/post/20404719601/getting-started-with-nodejs-on-windows

http://jasonwatmore.com/post/2015/12/26/setup-the-mean-stack-on-windows

d. To establish the connectivity between server and the database referred following link

https://www.digitalocean.com/community/tutorials/how-to-connect-node-js-to-a-mongodb-database-
on-a-vps

Company
Confidential
Software Design Document 16(17)

Document number
IOT-EMBD-SDD Rev 1.0

The project explained above is the best prototype example for the IOT system, it describes
1. Server and database development
2. Data demodulation at the server end
3. How the server an control the hardware
4. The protocol used to develop a channel between serve and end nodes.

Estimation for the project intelligent home automation system

Hardware requirements:
1. Raspberry pi evolution board (updated model) 5000
2. Memory card 8/16 GB 500
3. Supporting cables 1000
4. Hdmi interface cable 300

5. Power supply circuit 500


6. Hdmi supporting monitor depends on size

Working tools:
1. Multimeter 1000
2. Soldering gun (pointed needle and normal) 1000
3. Connecting wires. 1000
4. Lead and flux 100

5. ESD(Electro static discharge) supporting table depend on requirement

PCB board development:


At the hub development side: 3000
1. Empty pcb and bread board
2. Electronic components as per the design
At the end nodes development side:
1. Empty pcb and bread board 4000
2. Electronic components as per the design

Software requirements:
1. Laptop with good features for the server development------------------as per the company advice

Company
Confidential
Software Design Document 17(17)

Document number
IOT-EMBD-SDD Rev 1.0

2. Noobs os for the hub os development 500/600


3. Basic level internet as per the company advice

(Note:All amount mentioned above is in Indian rupees ) and cost may vary as per the market

Company
Confidential

You might also like