Server Design Document For IOT Considering Gps Tracker As A Example
Server Design Document For IOT Considering Gps Tracker As A Example
Document number
IOT-EMBD-SDD Rev 1.0
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.2. Scope..................................................................................................................................................... 9
2. Domain selection...................................................................................................................................... 11
3. Gathering prerequisites............................................................................................................................ 11
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
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)
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.
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
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.
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
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.
AngularJS lets you extend HTML vocabulary for your application. The resulting environment is
extraordinarily expressive, readable, and quick to develop.
Node.js is a platform built on Chrome's JavaScript runtime for easily building fast, scalable
network applications.
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
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 tracker
Browser/App
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.
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”
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
2. Create directories.
mkdir c:\data\db
mkdir c:\data\log
Company
Confidential
Software Design Document 12(17)
Document number
IOT-EMBD-SDD Rev 1.0
systemLog:
destination: file
path: c:\data\log\mongod.log
storage:
dbPath: c:\data\db
To stop the MongoDB service, use the following command: net start MongoDB
To stop the MongoDB service, use the following command: net stop MongoDB
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.
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
Company
Confidential
Software Design Document 15(17)
Document number
IOT-EMBD-SDD Rev 1.0
6. References
https://gist.github.com/piraveen/c7e786990a422998f2c249c8bbe0873c
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.
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
Working tools:
1. Multimeter 1000
2. Soldering gun (pointed needle and normal) 1000
3. Connecting wires. 1000
4. Lead and flux 100
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
(Note:All amount mentioned above is in Indian rupees ) and cost may vary as per the market
Company
Confidential