Fleet Management System

Major project report
by

Jithin V Mohan & Minu Balan
Dept. of Computer Science and Engineering

Sharoon Thomas & Lynn Mariette Mendonza
Dept. of Electronics and Communication Engineering

Under the guidance of

Mr. Shine N Das
HoD, Dept. of Computer Science and Engineering

Mr. Biju V G
HoD, Dept. of Electronics and Communication Engineering

MARCH 2009
Submitted in partial fulfillment of the requirements for the award of B.Tech Degree in Computer Science and Engineering of Cochin University of Science & Technology

Department of Computer Science and Engineering

College of Engineering, Munnar

College of Engineering, Munnar
Munnar, Idukki, Kerala 685612 Department of Computer Science and Engineering

Certificate
This is to certify that the Major Project entitled

FLEET MANAGEMENT SYSTEM
submitted by Jithin V Mohan, 10262611 for the award of Degree of Bachelor of technology in Computer Science & Engineering of the Cochin University of Science and Technology is a bona-fide account of the work carried out by him in this department during the academic year 2008-2009 under our supervision

Head of the Department

Fleet Management System
GPS Vehicle Tracking and development of a fleet management module for OpenERP
Jithin V Mohan Minu Balan [Dept. of Computer Science] Sharoon Thomas Lynn Mariette Mendonza [Dept. of Electronics & Communication]

College of Engineering, Munnar

Jithin V Mohan# Minu Balan# Sharoon Thomas* Lynn Mariette Mendonza*
Dept. of Computer Science and Engineering Dept. of Electronics and Communication Engineering College of Engineering, Munnar jithinvmohan@gmail.com minu.frnds@gmail.com sharoonthomas@teagarden.in lmmendonza@gmail.com
#

*

Acknowledgements

We are grateful to the Principal & Staff of College of Engineering, Munnar for their support in the proceedings of this project, especially our Head of the Departments, Mr. Shine N Das of the Department of Computer Science & Engineering and Mr. Biju V.G of The Department of Electronics & Communication. We would also like to thank our lab technicians who provided us with the required equipments round the clock.

Major Project ‘09 1 Fleet Management System

Table of Contents
ABSTRACT INTRODUCTION 1.1 Background 4 5 6 7 7 8 8 8 9 11 12 13 13 14 14 15 16 16 17 17 18 19 19 19 20 21 21

Project Requirements 1.2 Resources

UNDERLYING TECHNOLOGIES 2.1 Wireless communication 2.1.1 GSM 2.1.2 GPRS 2.2 Internet Protocol 2.3 Global Positioning System 2.3.1 Triangulation 2.3.2 Technical issues 2.3.3 Error sources 2.3.4 NMEA Protocol 2.3.5 Competing positioning systems 2.4 Input/Output 2.4.1 RS232 2.4.2 Buses 2.4.3 General input/output pins 2.5 Python Programming HARDWARE PLATFORM 3.1 GSM Module 3.1.1 General applications 3.1.2 Hardware 3.2 Remote Update 3.3 Telit GM862 GPS Dept. of Computer Science & Engineering College of Engineering, Munnar

Major Project ‘09 2 Fleet Management System

3.3.1 Overview 3.3.2 Logic Levels 3.3.3 Antenna Requirements 3.3.4 Software HARDWARE DEVELOPMENT 4.1 Block Diagram 4.2 Control Flow Diagram 4.2.1 Flow Chart 4.3 Sound System 4.4 Tamper System WEB RESOURCE DEVELOPMENT 5.1 Google Maps API 5.2 MySQL 5.3 PHP 5.4 Software Requirement Specifications 5.4.1 Overall Description 5.4.2 User Classes and Characteristics 5.4.3 Operating Environment 5.4.4 Design and Implementation constraints 5.4.5 Assumptions and Dependencies 5.4.4 Product Description 5.4.5 Page Hierarchy OPENERP INTEGRATION 6.1 Open Source Software at the Service of Management 6.2 The OpenERP Solution 6.3 Fleet Management Module Appendices A Telit GM862GPS Datasheet B Source Code (Web Side) C Source Code (Device Side) Dept. of Computer Science & Engineering College of Engineering, Munnar

21 22 22 22 24 24 25 25 29 31 32 32 32 33 34 34 34 34 34 34 35 36 38 38 39 40

Major Project ‘09 3 Fleet Management System

Dept. of Computer Science & Engineering College of Engineering, Munnar

Major Project ‘09 4 Fleet Management System

ABSTRACT

T

his project, code named 'Project Marauders Map' is an Enterprise Fleet Management System for large and medium fleets (Trucks, Cars, Buses). The project consists of a hardware platform which manages Vehicle data,

Global Positioning and Wireless Communication, and a software platform to provide integration into real-time mapping, costing, inventory, asset status and HR processes.

The hardware platform uses a GSM module, a stripped down version of the mobile that allows Python scripts to run as third party applications. This report reviews the development of the Fleet Management System, its feasibility and presents experiences from implementation of a prototype based on the Telit GM862 GPS.

Dept. of Computer Science & Engineering College of Engineering, Munnar

Major Project ‘09 5 Fleet Management System

1
INTRODUCTION

T

he Fleet operation industry has been an area of heavy investment since Independence and the progress has been significant. But the task is so gigantic that it would require many years and large doses of investment to

bring about the desired improvement in the country's transportation system. India‘s transport sector being large and diverse; caters to the needs of 1.1 billion people. In 1997, the sector contributed 4.4 percent to the nation‘s GDP, with road transportation contributing the lion‘s share. Good physical connectivity in the urban and rural areas is essential for economic growth. Since the early 1990s, India's growing economy has witnessed a rise in demand for transport infrastructure and services by around 10 percent a year. However, the sector has not been able to keep pace with rising demand and is proving to be a drag on the economy. Major improvements in the sector are therefore required to support the country's continued economic growth1.

Fleet Management System, aims at improving the quality and efficiency of the industry by identifying & tackling major roadblocks in the day to day operations of a typical enterprise.

Dept. of Computer Science & Engineering College of Engineering, Munnar

Major Project ‘09 6 Fleet Management System

1.1 Background
In the current scenario, most small scale fleet operators use manual methods of fleet management and have no tracking system at all. The medium and larger enterprises on the contrary have some levels of management integrated into their operations. Most firms have now deployed GPS based tracking units in their mobile assets for better monitoring. Such devices are widely available from many vendors across the country, and offer a web interface on their websites for tracking. However these devices also add to the inherent Indian problem of 'Lack of Integration' with existing infrastructure. Softwares in use by the medium players of the industry are mostly limited to spreadsheets developed or by custom regional solutions software overall impact of reducing efficiency and increasing the cost of operation. Hence these solutions are limited to a few players who could afford the investment and subsequent training of its employees. These solutions also lack integration with the existing tracking hardware. With the increased competition in the industry, companies are now looking for ways to improve their efficiency. FMS is an umbrella term for applications that aim at improving the overall performance of a hauler‘s fleet in terms of fuel economy, maintenance costs, utilisation advantages level, are etc. FMS‘ main

better

transport

coordination, better vehicle and driver follow up, faster and more precise invoicing, and faster assistance in case of a road side breakdown2. Considering the above facts, this project introduces the use of latest hardware systems and open source tools to build a low cost Fleet Management System for the South Asian market addressing the problems discussed.

developers. Lack of support, security and synchronisation issues are few drawbacks of such solutions. The giants however have resorted to the use of proprietary ERP solutions to increase quality & efficiency. These solutions with sky rocketing prices and longer deployment times, in turn have an
Dept. of Computer Science & Engineering College of Engineering, Munnar

Major Project ‘09 7 Fleet Management System

Project Requirements
The project was divided into five parts. i. Identification of industry requirements and ideal tools to address them. ii. Evaluation of possible hardware platforms. iii. Development of Hardware prototype iv. Web resources development v. OpenERP integration

The aforesaid goals had to be achieved and documented in a report including review of the hardware platform used, feasibility in the South Asian region, future prospects and implementation of a prototype.

1.2 Resources
This project focuses on prototype Notes have also been taken from blogs and forums of active hobbyists involved in development of M2M platforms. The technologies used in the project are all in wide use. They are themselves

development and hence the investigating part consists of hardware platform reviews and evaluation. Therefore much of the resources have been data sheets and product specifications. Specifications of hardware components used have been acquired from web pages of respective manufacturers.

extensively documented and a detailed study of them is beyond the scope of this report

Dept. of Computer Science & Engineering College of Engineering, Munnar

Major Project ‘09 8 Fleet Management System

2

UNDERLYING TECHNOLOGIES

This chapter will explain the fundamentals of technologies used by the project prototype. It is not meant to be a complete description, but rather an orientation to help the reader understand possibilities and limitations of the studied task. For a more thorough study, see the references at the end of the report.

2.1 Wireless communication
[Paragraph 2.1 is based on ref 3]

bandwidth. The application of this project has low demands on bandwidth, but requires country wide coverage. For this type of applications GSM/GPRS is the most suitable candidate today.

When data needs to be sent from a moving target, or from remote locations, wireless communication is desirable. There are a number different of techniques available range with and

focuses

regarding

2.1.1 GSM
The Global System for Mobile versions of the standard have been released, allowing higher data rates and new features in the networks. The basic GSM network is circuit switched, just like an ordinary land line telephone network. When a call is established between two nodes, the link in-between is busy, regardless of anything is being telecommunications, GSM, standard was developed in the eighties to address the problem of compatibility between numerous telecommunication systems that had

emerged. A first version of the standard was completed in 1990. Since then, the system has been adopted around the world, and new
Dept. of Computer Science & Engineering College of Engineering, Munnar

Major Project ‘09 9 Fleet Management System

said/transmitted or not. To allow many simultaneous calls over the radio link, GSM uses multiple frequency channels around its basic working frequency, 900 MHz. One set of

frequencies is used for uplinks and one set for downlinks. These frequency channels, in turn, use Time Division Multiple Access, TDMA to further increase the number of parallel lines. TDMA means that a channel is chopped up into a set of repeating time slots. Each (cell phone) connection has its own repeating time slot in a channel. (see figure 2.1) The cell phone samples some speech, compresses it and sends it in its next slot. For this to work, the time to transmit one second of compressed speech has to be much shorter than one second. The GSM network is divided into cells, with each cell having its own Base Station System, BSS. The BSS contains a radio transceiver and a controller. The controller handles the radio channels and forwards calls in the cell to a switching centre in the network. The switching centre in turn routes the call onwards to the target BSS or to another network. The GSM network also contains a set of data bases which contains information about attached cell phones, their rights and statuses. See figure 2.2.

Figure 2.2: Rough Structure of a GSM Network

2.1.2 GPRS
An extension to the GSM standard called General Packet Radio Services, GPRS, was released in 1997. GPRS allows packet based data to be sent in the GSM network and onwards through gateways to the internet using standard internet protocols. This also implies that computers connected to the
Dept. of Computer Science & Engineering College of Engineering, Munnar

Major Project ‘09 10 Fleet Management System

internet need no special hardware to communicate with a GPRS device. Data to be sent is first divided into small pieces, packets. The individual packets are then sent as soon as there is a time slot available in the network. Finally, transmitted data is reconstructed from the packets at its destination. See figure 2.3. No user ‗owns‘ a repeating time slot, as in the basic GSM network. This allows a more efficient use of thebandwidth. When user A doesn‘t need any time slots, user B can have them and vice verse. Both users can still be constantly attached to the base station, much like an internet broadband connection, ready to send or receive. Network operators often employ a tariff scheme where users pay for the data actually sent, not the time period he is connected. The pay-per-byte nature of GPRS makes it ideal to use with remote devices that need to be constantly connected to other devices, or to a central server, but only exchanging small amounts of data

A GPRS device can only send at one frequency at a time (use one channel), but it can use more than one slot in each time slot cycle of that channel to increase its bandwidth. GPRS devices are divided into classes according to the number of time slots they can make use of. Performances range from utilising one slot in each direction in class one, to four slots in one direction and one in the other (4+1 or 1+4), in class 12. See table 2.1. The theoretical data rate, when using one slot, is 13,400 bits per second, giving 53,600 bps for class 12. These 53,6 kbps is the ―raw data‖ rate; up to 25 percent thereof is used for error correction and redundancy, leaving about 40 kbps for user data. Table 2.1: Examples of GPRS classes. ‘Active slots’ gives the maximum number of simultaneously utilized slots. For example class 11 supports up to four slots for the uplink and up to three slots for the downlink, but it can only use a total of five slots simultaneously.
GPRS Class 2 4 6 8 Uplink Slots 2 3 3 4 4 4 Downlink Slots 1 1 2 1 3 4 Active Slots 3 4 4 5 5 5

spread over long periods of time.
Figure 2.3: Time slot usage of a GPRS channel

11 12

Dept. of Computer Science & Engineering College of Engineering, Munnar

Major Project ‘09 11 Fleet Management System

address. The operator then routes incoming A GSM network needs new software and hardware to handle GPRS. For example, the base station controller needs software to manage new coding schemes. GPRS data is sent from the BSS to GPRS support nodes in the network. They have roughly the same functionality as the switching centre in GSM. The routing to and from other IP based networks (internet) is done through gateways. See figure 2.4. requests to the public IP address through the DNS server to the unit‘s current dynamic IP address.

2.2 Internet Protocol
[Paragraph 2.2 is based on ref 4]

The Internet Protocol Suit, IPS, has been used since the beginning of the eighties for communication between remote computer systems. With the introduction of GPRS in the GSM network, GSM devices could adopt the same suit of protocols to communicate internet. Data to be sent from a device over the internet faces an elaborate 2.2 scheme. It needs to be packed and wrapped before it can be transmitted, and control mechanisms are needed to make sure it reaches its with computers on the

Figure 2.4: Rough structure of GPRS network

destination. An application sending data usually needs not to worry about all this. The required functionality is provided at a

Assignment of an IP address to a unit is done dynamically by the network operator, i.e. A unit‘s IP address will change over time. This means that there is no way for a server that wants to contact a unit to know its IP address for sure. Lately specialised operators utilize a Domain Name System, DNS, to give a unit a static public IP

lower level by the IPS. IPS has a layered architecture. The bottom layer handles the physical link; sending and receiving of raw bits. The top layer provides an interface that applications can use. Each layer in between handles its own part of the transmission. A layer only serves the layer immediately above and only makes requests to the layer

Dept. of Computer Science & Engineering College of Engineering, Munnar

Major Project ‘09 12 Fleet Management System

immediately below. With well defined interfaces between the layers, this makes for a flexible and easily maintained architecture. This approach is promoted in the more general Open Standards Interconnect, OSI, model and is often called a protocol stack, in this case an Internet Protocol stack, IP-stack. The layers of the IP-stack are a subset of those defined in the OSI. The IP-stack layers are outlined in figure 2.5. The main option for the application

are usually implemented in higher level protocols when using UDP.

programmer when configuring an IP-stack is, apart from the targets addresses, the use of either TCP or UDP. TCP provides a controlled channel to the target. It makes sure that everything that is sent is delivered to the recipient, and that it is delivered in the right order and without errors. To handle this, TCP contains sequence numbers and timers to control sent data and retransmit when data get lost. UDP lacks all this. There are no guarantees that data sent by UDP arrives correct at the destination, or that it arrives at all. The control mechanisms of TCP create a lot of overhead to the ‗useful‘ data. In some applications, the security of TCP can be traded for the lower bandwidth demanded by UDP. The choice here is TCP. Some data integrity and flow control checks Figure 2.5: IP-Stack Layers

2.3 Global Positioning System
[Paragraph 2.3 is based on ref 5]

The Global Positioning System, GPS, was developed by the United States Department of Defence during the seventies and eighties and became operational in 1993. The system works in two parallel modes; one with higher precision that is encrypted and reserved for US military, and one with less precision that is free to use by the public. An ordinary civilian GPS has an accuracy of about 15 meters. The core of the GPS infrastructure consists of 24 satellites in orbit (plus three used for backup) and a set of satellite tracking stations around the

Dept. of Computer Science & Engineering College of Engineering, Munnar

Major Project ‘09 13 Fleet Management System

world. The satellites send positioning data and system information to users on earth. Each satellite transmits at two frequencies, one for civil and one for military use.

have some accurate way to measure distance. The first problem is not so hard. Orbits of the satellites are stabile and can be predicted with high accuracy by

mathematical formulas. In addition to this,

2.3.1 Triangulation
GPS positioning is based on triangulation. A GPS receiver on earth first measures its distance, R1, to one of the GPS satellites, S1. The receiver has then pinned its position down to a sphere with radius R1 around S1. By repeating this procedure for two more satellites the receiver has three spheres that intercepts in two points. One of these two points can be discarded as being to far from the earth; the other interception point is the receiver‘s location. There is a fourth variable added to the three ‗room‘ dittos: relative time of the clocks in the satellites and receivers. Therefore a fourth satellite is required to solve the equation. The reason for is described in more detail in the next paragraph.

tracking stations around the world monitor the satellites positions and update them when they are off course. The satellites in turn, send correction data to the GPS receivers. The receivers store the positions of the satellites and can then calculate satellite positions for the coming time intervals, until the satellites send the next position update. To measure distance, a given predefined pseudo random code is transmitted by the satellite starting at a given time. At the same time, the receiver starts to generate the same code. By correlation, the receiver then measurers the time offset between its own code and that received from the satellite. The signal from the satellite is an

electromagnetic wave with finite speed, c. Multiplying the time offset, ∆t, of the two codes with c gives the distance between

2.3.2 Technical issues
For the positioning to have a meaning, the receiver must know where the satellites are relative to the earth. The receiver also has to
Dept. of Computer Science & Engineering College of Engineering, Munnar

satellite and receiver. Additional techniques,

including measuring the phase of the signal
carrier, can be used to enhance precision. The critical part of the distance

measurement is timing, which must be

Major Project ‘09 14 Fleet Management System

extraordinarily precise. If the two clocks of a satellite and a receiver are off by just 1 microsecond, the error in distance

2.3.3 Error sources
The main limitation of GPS accuracy used to be the Selective Availability, SA. This was a random bias applied to the civilian satellite signal by the US Department of Defence to limit non-military accuracy. The SA was turned off in the year 2000, enhancing GPS accuracy by a factor of 10. The main limiting factors of GPS accuracy today are path errors. The satellite signal bounces on atmosphere and items in the receiver‘s vicinity, making the path travelled longer then the straight line assumed. A more severe limitation is that the satellite signal can be completely blocked by buildings in ―city canyons‖ or in tunnels. The GPS signal, coming form a satellite in orbit, is very weak compared to, for example, a GSM signal, making it very sensitive to blocking. This error can be partly worked around with ―dead reckoning‖ by use of accelerometers.

measurement will be 300 m. The satellites use highly accurate atomic clocks that keep the system ‗GPS-time‘. To equip a receiver with an atomic clock would make it very expensive. Instead, the receiver hosts an ordinary quartz clock which is continuously set by the atomic clocks of the satellites. As mentioned above, three dimensional positioning requires three ‗visible‘ satellites, if all parts keep the same time. In practice, there is a fourth variable; the offset between the receiver clock and GPStime. To solve the equation, a total of four visible satellites are required. Four variables and four equations, one for each satellite, gives a definite solution. The requirement of four visible satellites is fulfilled 95 % of the time in all places around the world. The probability is better in populated areas where usually six to eight satellites can be spotted. Each satellite is called a channel. ―Number of channels‖ is a marketing feature for GPS- receivers. A 6-channel receiver can monitor six satellites simultaneously,

2.3.4 NMEA Protocol
[Paragraph 2.3.4 is based on ref 6]

making more precise positioning possible.

The de facto standard communication protocol to get positioning data from a GPS receiver is developed and controlled by the US National Marine Electronics

Dept. of Computer Science & Engineering College of Engineering, Munnar

Major Project ‘09 15 Fleet Management System

Association, NMEA. The standard is aimed at marine electronics, and GPS

7) FAA mode indicator (NMEA 2.3 and later) 8) Checksum

communications is a subset of it. The most common version, NMEA 0183, is quite simple and allows one talker (in this case the GPS receiver) to send ASCII character ‗sentences‘ to one or more passive listeners, for example a navigation device. Apart from the physical matters the standard defines a set of sentences to declare, for example; position, current time, system status, etc. These are transmitted in a loop by the talker. The sentences can be decoded by a compatible listener, (computer, PDA) which can then process the data further. Below is an example of the NMEA sentence GLL, Geographic Position – Latitude/Longitude.

2.3.5 systems

Competing

positioning

A global navigation system similar to GPS was developed in Russia in parallel with the US development. The Russian system is called GLONASS, Global'naya

Navigatsionnaya Sputnikovaya Sistema. It was fully operational for a while in the mid nineties, but declined along with Russian economy. The system is again gaining momentum, with planned world coverage by 2010. The European Union is developing their own navigation system, Galileo, with

1 | $--

2 3 | |

4 5 | |

67 8 || |

partners including China and Israel. Galileo is planned to be operational in 2008. Both of these systems provide roughly the same accuracy as GPS, but it will be some time after their launch dates before the market for receivers is as developed as that for GPS. Because of this, these systems will not be real competitors to GPS for a long time. A different approach to positioning which is under development, is through GSM-

GLL,llll.ll,a,yyyyy.yy,a,hhmmss.ss,a,m,*hh Field Number: 1) Latitude 2) N or S (North or South) 3) Longitude 4) E or W (East or West) 5) Universal Time Coordinated (UTC) 6) Status A - Data Valid, V - Data Invalid

networks. It is based on a number of techniques involving radio frequency signal

Dept. of Computer Science & Engineering College of Engineering, Munnar

Major Project ‘09 16 Fleet Management System

strength from different GSM base stations. Coverage of the system is limited to GSMnetwork coverage, and accuracy today is about 200 m in urban areas, decreasing to 4 km in rural zones, compared to about 15 meters for an ordinary GPS. The conclusion is that as of today and coming years, there are no real competitors to GPS.

bit rate and ability to supply current to the peripheral unit. An advantage of RS-232 is that it requires less software support than USB, making it a good option for devices with limited resources, where it is still in wide use. One case could for example be to connect a GPS to a PDA. As mentioned above, a set back of the standard is that it defines a large voltage swing. -15 ÷ -3 V for logic one and

2.4 Input/Output
The following paragraphs gives a description of different input and output, IO, standards supported by the module Telit GM862 GPS.

3 ÷ 15 V for logic zero. This large swing limits the maximum bit rate due to limited slew of the signal generator. Also, an ordinary TTL9 or CMOS10 circuit can not produce these levels, so external level converters are required to such a circuit. The standard defines 20 signals, but more common is a four signal plus ground subset.

2.4.1 RS232
[Paragraph 2.4.1 is based on ref 7]

The EIA232 standard, generally called RS232, defines electrical and mechanical properties of a serial data link. The standard does not define character encoding or bit rates; these can be chosen by the application. Feasible bit rates do not exceed 256 kBit/s due to the large voltage swing requirements of the signal. The first version of the standard was released in 1969, and an RS232 port was standard equipment on PCs until the nineties. USB8 has now replaced RS-232 in the PC area because of its higher

It allows a full duplex link with flow control. A two signal plus ground full duplex link without flow control is also common. The remaining signals are defined for, for example, common clock and secondary data lines. For historical reasons, the signals of the standard are labelled by a Data Terminal Equipment, DTE, sending data to a Data Communicator Equipment, DCE. The DTE is referring to a computer and the DCE is

Dept. of Computer Science & Engineering College of Engineering, Munnar

Major Project ‘09 17 Fleet Management System

referring to a modem, which was the set up that the standard was originally intended for.

two bidirectional wires for clock and data, and can in the latest revision transfer data in rates up to 3.4 Mbit/s, with 100 and 400

The 4 +1 signal sub set is: TD RD RTS CTS Transmitted Data from DTE to DCE Received Data from DCE to DTE Request To Send. Clear To Send.

Kbit/s being more common. The standard uses 10 bit addressing, enabling up to 1000 unique nodes to be pointed out on the bus, as long as the total bus capacitances don‘t exceed 400 pF. Since capacitance of a wire is proportional to its width and length, 1000 nodes might not be possible in practice. The capacitance restriction also shows that the bus is not optimal for off PCB

In half duplex mode, RTS and CTS make a full handshake. In full duplex mode, DCE transmits whenever RTS is high and DTE transmits whenever CTS is high. GND Common Ground (this might not be true if the signalling cable is long). The two plus one signal implementation consists of TD, RD and GND.

communication, since cables tend to have relatively large capacitance. SPI is another simple serial bus intended for use on PCB. It is a single master bus with chip select instead of addressing. This

2.4.2 Buses
Telit GM862 GPS supports Inter Integrated Circuit, I2C, and Serial Peripheral Interface, SPI, buses. These buses are mainly intended for on-PCB, Printed Circuit Board, use. They could come into practice in a design with a dedicated PCB to connect e.g. a GPS receiver to the GSM-module and will therefore be describe briefly. I2C is a multi-master bus invented by Philips. It features a simple flow

makes it suitable for longer data streams from one or a few slaves, rather then reading and writing many addressed nodes. SPI allows higher data rates than I2C, 10 Mbit/s and more. SPI does not specify any acknowledgement higher-level or flow control, to so be

protocols

have

implemented by the user.

2.4.3 General input/output pins
Telit GM862 GPS has a range of pins that can be used as either digital inputs or

controlmechanism. Signalling is done over
Dept. of Computer Science & Engineering College of Engineering, Munnar

Major Project ‘09 18 Fleet Management System

outputs. The direction of the pins can be configured in application software. Hence they are called General Purpose Input Output, GPIO. Digital pins could for example be used to connect an alarm button to the module, or some indication Light Emitting Diodes, LED‘s. An output pin, in general, does not supply much current, so additional driving is needed to drive the external item, e.g. LED.Telit GM862 GPS has one input pin, an output pin and 11 GPIO pins.

variables. Therefore, values, not variables carry type. This enables shorter code, but is also a great error source. The feature takes some time to get used to if one is used to for example Java programming. Python is designed with the intention of being highly readable. To attain this it has a simple visual layout, English keywords instead of

punctuation, and fewer syntactic constructs than for example C. White space is used as delimiter instead of brackets. Python is the only major language with this approach. This enforces the

2.5 Python Programming
The first version of Python was released in the early nineties. It is now developed by The Python Software Foundation as an Open Source project. Although used for some popular programs like the original

indentation convention used in many other languages with the motivation of making the language more readable. This can be seen in Appendix B,‗Source Code‘. Space and tab indentations are interpreted differently at runtime. If they are mixed they will generate errors.Since space and tab are visually similar, these errors can be hard to detect when debugging.The Python language is multi-paradigm, permitting several

BitTorrent tracker, Python is not as widely adopted as the other languages in this review. Python is an interpreted language, meaning that it is compiled at runtime. Unlike most mainstream languages, it is dynamically typed with no predefinition of

programming styles; object-,functional- or structural-orientated. Exception handling is supported.

Dept. of Computer Science & Engineering College of Engineering, Munnar

Major Project ‘09 19 Fleet Management System

3
HARDWARE PLATFORM
3.1 GSM Module
access very easy. As of today there are modules available from half a

G
During enhanced

SM-modems have been around for some 10 years. A GSMmodem is simply speaking a

dozen producers. An example of what a GSM-module looks like is shown in figure 3.1.

mobile phone that has been stripped of its display and keyboard, leaving only the actual radio device, control circuits and IO. The device can then be embedded into a product as a communication link to cellphone networks and onwards to the internet the past three-four of years, an has GSM modules allow highly integrated embedded systems with Internet
Figure 3.1: Telit GM 862 GPS

3.1.1 General applications

type

GSM-modem

emerged. They will be called GSM-modules in this project. The difference to an ordinary modem is that the module allows the running of third party application code within the unit, eliminating the need of an external controller. The GSM-modules also host internal IP-stacks, making Internet

connectivity, where component count can be kept to a minimum. They target products that need connectivity with each other or a central server from remote locations. The main property to keep in mind when designing a system where the intelligence is

Dept. of Computer Science & Engineering College of Engineering, Munnar

Major Project ‘09 20 Fleet Management System

embedded into a GSM-module is the limited modules have limited resources, their tasks should be kept simple and non-time-critical. Possible applications include collecting and sending positioning information from a vehicle, reporting stock of a vending machine, weather data from a weather station, etc. In addition to the stand-alone mode, all modules evaluated in this report can also be controlled by an external CPU, like a traditional GSM-terminal. The two different architectures are shown in figure 3.2.

CPU

power

and

memory.

Since

the

GSM-terminal, the module also provides means to execute third party application code. The application could either be run on spare capacity in the module‘s baseband CPU, or in a dedicated application CPU.

The target applications of GSM-modules often include positioning. To meet this demand, GSM-modules with internal GPS have been released. The GPS receiver chip is fitted into the module and connected to the application CPU. In all released

implementations, the link in between the CPU and GPS is a RS-232 line and it decreases the number of external serial ports of the module by one, compared to the respective models without GPS. The connector of the modules is either a ball grid array, BGA, or a multi pin board-toboard connector. A dedicated Printed Circuit
Figure 3.2: Comparison of architectures

Board, PCB, is then needed to use the module. The PCB should contain proper IO

3.1.2 Hardware
A GSM module contains a baseband CPU that maintains the GSM/GPRS protocols. The CPU communicates with a high frequency radio transceiver that modulates the signal from the baseband CPU and transmits it into the ether. In difference to a
Dept. of Computer Science & Engineering College of Engineering, Munnar

connectors, peripheral circuitry such as RS232 level converters, and power supply. A GSM device has some particular powering demands. Though its average power

consumption is rather low, the unit can need up to two ampere when transmitting in its

Major Project ‘09 21 Fleet Management System

time slot. This should be accounted for in the power supply design. Developing a PCB takes time. To speed up prototyping, and to allow parallel hardware and software development, all GSM-module producers provide test boards for their models. These boards offer complete

and can‘t be accessed. Mechanism for the remote update in the FMS is using the FTP feature of Telit GM862 GPS. Appendix B has the detailed code for the purpose.

3.3 Telit GM862 GPS
Telit is based in Trieste, Italy, with Arrow and Round Solutions as Swedish sales agents. Telit has developed cellular based products since the mid eighties. Their product ranges today include both GSM handsets and modules. Their most suitable

support for a module, so that the application programmer can start to work at once. However the EVK2 board combatible with the Telit GM862 GPS being as expensive as the module itself was ruled out.

3.2 Remote Update
Remote update is a way to update

module for this project is the GM862-GPS. It has an embedded Python script interpreter for embedded applications and a GPS receiver.

application code from a remote location by downloading new code and replacing the old one. In the case of GSM-modules, this is also called Over The Air, OTA update, since the new code is downloaded wirelessly. Most modules of the review of this report support remote update of application code. An update could be required to change the use of the module, or to correct a bug in the application code. To update a large fleet of trucks spread over a vast geographical area by ‗cable‘ is very costly. Remote update could be risky though, if the device accidentally ends up in some deadlock state
Dept. of Computer Science & Engineering College of Engineering, Munnar

3.3.1 Overview
The application code of the Telit modules is run as a single thread in the baseband CPU. This is a cost efficient solution, but decreases performance since the baseband CPU‘s main priority is to keep the GSM protocol. For example IO operations of an application, that need not to interfere with the radio unit at all, now has to compete with it for resources.

Major Project ‘09 22 Fleet Management System

The GM862-GPS has only one external RS232 port. With RS232 being the preferred link to a CAN-bus interface, this single port will be dedicated to CAN. The port is a ‗full‘ 9- pin RS-232, but no flow control is available when the module is in the Python script mode, and the hardware buffer of the port is only 256 bytes. The module features an internal SIM-card reader. This eliminates the need for an external one, but gives constraints on module placement in a housing box, so that the SIM-card slot can be accessed. The module is connected to the PCB trough a 50 pin board to board connector. The module is also available in a version with ball grid array connector, and no internal SIM-card reader. If the module is installed in accordance with Telit instructions, no further approvals on EMC or radio spectrum are needed.

3.3.3 Antenna Requirements

3.3.2 Logic Levels
Where not specifically stated, all the interface circuits work at 2.8V CMOS logic levels. The GM862-GPS supports Python Scripts. Telit chose the Python language because it is high level and open source, i.e. no royalties to be included in the module price, and the
Dept. of Computer Science & Engineering College of Engineering, Munnar

3.3.4 Software

Major Project ‘09 23 Fleet Management System

interpreter engine takes less resources than a Java engine. The script and the interpreter have 1.5 MB of RAM available. Script and data files can be written and read on a single level file system with a total size of 3 MB. Figure 3.3 shows the software environment of the module. The Python script is run as a thread in the baseband CPU. It has the lowest priority, allowing all other tasks to interrupt it. This ensures proper operation of the GSM/GPRS protocol but reduces the application performance. Telit has removed substantial parts of the Python API to ease the requirements of the interpreter engine. Some specific features have also been added for control of the hardware in the module: GPS, serial port, timers and IP connectivity. The module can only keep a single IP socket open at a time. Most of the Telit added API is based on AT-commands which are sent to the GSM baseband CPU through a virtual serial link. The CPU in turn, handles the hardware. Software can be debugged either in an emulator or directly on the module when it‘s connected to the serialport of a PC. All Python outputs and error messages can then be viewed in a Terminal window. Minicom was used for this purpose.
Figure 3.3: Software Environment of the Telit GM862 GPS

Dept. of Computer Science & Engineering College of Engineering, Munnar

Major Project ‘09 24 Fleet Management System

4

HARDWARE DEVELOPMENT

F

The prototype is designed using the 'Telit
or the developement of hardware, the block diagram was first formulated and then each block was designed and made

GM862 GPS' as the basic module and additional hardware is incorporated to realise the functionalities desired. The 'Ignition Block' determines whether the ignition of the vehicle is on/off and feeds the corresponding signal to the GPIO pin of the

functional.The developement approach chosen was an agile methodology called 'Scrum'

4.1 Block Diagram

module. The 'Tampering Block' is so designed to alert the control room in case of any tamper, incident to the module by sending a high priority SMS to the control number specified in the configuration file. The 'Fuel Block' is used to calculate the percentage of fuel in the vehicle.The output voltage from the float sensor in the fuel tank of the vehicle is dropped using suitable resistance circuits and then fed to the ADC

Dept. of Computer Science & Engineering College of Engineering, Munnar

Major Project ‘09 25 Fleet Management System

of the module.The input data is then processed within the module. The 'Call Control Logic' defines the manner in which the 'Call Block' functions.The call block consists of a microphone and speaker used in conjunction so as to implement a 'primitive' mobile phone.The 'Call Control Logic' is implemented for the following reasons: i. Misuse of Phone ii. Cost reduction iii. Avoid distractions Once the module is powered on ,the initialisation procedure is carried out. A continuous check is for incoming or outgoing calls is done and if the condition is met the control is passed on to the call control centre. Else a variable engaged is set to false and the routine task of reading the GPIO pins and logging data to the web server is performed.

4.2.1 Flow Chart

The tasks involved are: i. Disconnect unwanted calls without user knowledge ii. Button association with control
Start of Device Perform Initialisation process

centre numbers

Once

the

block

diagram

was

designed, a control flow diagram was drawn up to characterise the work flow and then each block's working was specified using a flow chart.
If Enga ged= False Y Ring =Tru e Y

4.2 Control Flow Diagram

fals e

Perform Routine Tasks Dept. of Computer Science & Engineering College of Engineering, Munnar

Initiate Call Handler

Major Project ‘09 26 Fleet Management System

The initialisation procedure is as follows:

Initialisation :

1. The Baud Rate for communication is set to 115200
Initialisation Start

2. The variable engaged is set to true so as to avoid the passing of control to

Set SER Baud rate=115200 Set ENGAGED=True Set Port Directions Set International Format Set CLID to True Mute SPKR & RING Set RTC time from GPS Report Live Status Set ENGAGED=False

the call control centre 3. The GPIO pins are set as input pins with a dummy value zero 4. The Format of calling is set to the international format of +91 5. The caller ID feature is turned on to distinguish calls 6. The speaker and microphone

volumes are muted 7. The internal clock of the module is set to the UTC value extracted from the GPS string 8. A string with remarks set as ―live‖ is then sent to the web server 9. The engaged variable is then to set to false
Initialisation Stop

and

the

control

is

then

transferred to the routine loop

Dept. of Computer Science & Engineering College of Engineering, Munnar

Major Project ‘09 27 Fleet Management System

information is stored in a dictionary Routine Loop :
Enter Loop

variable 3 The current battery status of the module is checked using AT

commands and the value updated in
Make Port status dictionary

the specific variable 4 The ADC input is read and converted to a percentage value 5 The server URL is then created using these values and the GPRS function

Make GPS status dictionary

Extract Velocity

is called. 5.1 The GPRS function sets the module to the GPRS mode. 5.2 The socket timeout is set Checksum is computed and hexdigest is appended to server URL

Log battery status

Log Fuel:ADC conversion

5.3

Generate Server URL

5.4

The socket is then dialled and the serverlog.php page is called passing arguments in GET.

Return From Loop

5.5 not

The result is analysed and if successful the data is

The routine loop of the program consists of the following functions: 1 The GPIO pins are scanned and the read values are stored in a dictionary variable 2 The GPS data is extracted and the Latitude,Longitude,Time,Velocity 5.6

warehoused. Any updates are also checked for.(The

warehoused data is resent at a later stage and the entry deleted if transfer is successful ) The socket is then closed.

6 The loop is exited only if a call has to be handled

Dept. of Computer Science & Engineering College of Engineering, Munnar

Major Project ‘09 28 Fleet Management System

Call Control Flow :

The incoming call is identified and if a valid number, the speaker and microphone

Initiate Call Handler

volumes are maximised and the user allowed to attend the call by the press of a switch.

Identify CLID

The outgoing calls are limited to two control numbers,the calls are initiated at the press of the respective switches.

CLID in list

Y Set Volume high,Eng=true

Wait for Call Aceptance

Call Disc ?

Y Set Volume low,Eng=False Stop Call Handling

Dept. of Computer Science & Engineering College of Engineering, Munnar

Major Project ‘09 29 Fleet Management System

MicLevel = ( -45) + (-4.7) = -49.7

4.3 Sound System
The Base Band Chip of the GM862-GPS Telit Module provides two different audio blocks; both in transmit (Uplink) and in receive (Downlink) direction: ―MT lines‖ should be used for handset function, ―HF lines‖ is suited for hands -free function (car kit). These two blocks can be active only one at a time, selectable by AXE hardware line or by AT command. The audio characteristics are equivalent in transmit blocks, but are different in the receive ones. The nominal sensitivity of the microphone lines indicates the voltage level on the GM862-GPS pins present during "normal spoken" conditions. For a handset , the "normal spoken‖ conditions take place when the talker mouth is 7cm far from the microphone ; under these conditions the voice will produce an acoustic pressure of 4,7dBPa @1kHz on the microphone

dBVrms that means : MicVoltage = 10 ( -49.7 / 20 ) = 3.3* 10 -3 Vrms During a call, this level varies according to the volume of the talker voice; usually the following rough thumb rule for the dynamic range may be used : 1) The talker is screaming . This is the strongest voice level condition: the signal increases by +20dB 2)The talker is whispering. This is the lowest voice level condition: the voice level decreases by – 50dB . These changes the were considered for

designing amplifier.

external

microphone

For hands-free/car kit microphone, the voice attenuation, due to the distance between the microphone itself and the talker, when designing the external microphone amplifier must be taken into account. The microphone will also pick up ambient noise; to overcome this problem it is preferable to set the gain of

membrane . At "normal spoken" conditions, a

the microphone 10dB lower with respect to the calculated value for a nominal

microphone having the suggested nominal sensitivity of -45dBVrms/Pa,will produce the electrical equivalent signal :

sensitivity. The corresponding reduction in signal level will be compensated by an increased voice volume of the talker which

Dept. of Computer Science & Engineering College of Engineering, Munnar

Major Project ‘09 30 Fleet Management System

will speak louder because of the ambient noise. The handsfree mode was chosen while designing the Audio Section. A THAT audio amplifier circuit was used to provide the requisite gain.

below:Depending on the gain required the value of the resistance RG was varied. The equation being the same as that of a simple differential amplifier.

Audio Paths In The 'Telit GM862 GPS'

Figure 4.2 THAT Audio Amplifier

Figure 4.1 AudioPaths in Telit GM862 GPS

The THAT audio amplifier was wired up in the configuration as shown

Dept. of Computer Science & Engineering College of Engineering, Munnar

Major Project ‘09 31 Fleet Management System

The output from the module was fed to an amplifier and speaker circuitry in order to hear the voice with clarity. The amplifier circuit was wired up in the following manner using a D6283 IC

Figure 4.3 Speaker Amplifier Circuit

4.4 Tamper System
The tamper system is so designed that if the box is opened the input at a specific GPIO pin becomes high and a SMS is sent to the control number.The message settings are configured and a high priority SMS is sent.

Dept. of Computer Science & Engineering College of Engineering, Munnar

Major Project ‘09 32 Fleet Management System

5
WEB RESOURCE DEVELOPMENT

5.1 Google Maps API

The google maps API requires one to initially register for an API key, before one

T
multiple

he Google Maps API was used to embed Maps in the web pages with JavaScript. The API provides

can start putting maps on a site. An extensive documentation is available with the google documentation site for google maps, which was used in the development process.

a number of utilities for manipulating maps and adding content to the map through a variety of services, allowing the creation of robust maps applications on the website. The Maps API is a free service, available for any web site that is free to consumers. The Google Maps API is now integrated with the Google AJAX API loader, which creates a common namespace for loading and using Google AJAX APIs. This

5.2 MySQL
MySQL is the world's most popular open source database software, with over 100 million copies of its software downloaded or distributed throughout its history. With its superior speed, reliability, and ease of use, MySQL has become the preferred choice for Web, Web 2.0, SaaS, ISV, Telecom

framework allows you to use the optional google.maps.* namespace for all
The pages were hosted as a subdomain in the official website of the college, as http://maraudersmap.cemunnar.ac.in

classes, methods and properties currently used in the Google Maps API.

Dept. of Computer Science & Engineering College of Engineering, Munnar

Major Project ‘09 33 Fleet Management System

companies and forward-thinking corporate IT Managers because it eliminates the major problems associated with downtime,

programming was mostly done using the PHP language.

maintenance and administration for modern, online applications.

5.3 PHP
PHP is a scripting language originally designed for producing dynamic web pages.

Many of the world's largest and fastestgrowing organizations use MySQL to save time and money powering their high-volume Web sites, critical business systems, and packaged software — including industry leaders such as Yahoo!, Alcatel-Lucent, Google, Nokia, YouTube, Wikipedia, and Booking.com. The flagship MySQL offering is MySQL Enterprise, a comprehensive software, set of

It has evolved to include a command line interface capability and can be used in standalone graphical applications. While PHP was originally created by Rasmus Lerdorf in 1995, the main

implementation of PHP is now produced by The PHP Group and serves as the de facto standard for PHP as there is no formal specification. PHP is free software released under the PHP License, however it is incompatible with the GNU General Public License (GPL), due to restrictions on the usage of the term PHP. PHP is a widely-used general-purpose scripting language that is especially suited for web development and can be embedded into HTML. It generally runs on a web server, taking PHP code as its input and creating web pages as output. It can be deployed on most web servers and on almost every operating system and platform free of charge.PHP is installed on more than 20 million websites and 1 million web servers.

production-tested

proactive

monitoring tools, and premium support services available in an affordable annual subscription. MySQL is a key part of LAMP (Linux, Apache, MySQL, PHP / Perl / Python), the fast-growing open source enterprise

software stack. More and more companies are using LAMP as an alternative to expensive proprietary software stacks

because of its lower cost and freedom from platform lock-in. The same software stack was used in the development of this project. The web

Dept. of Computer Science & Engineering College of Engineering, Munnar

Major Project ‘09 34 Fleet Management System

5.4 Software Requirement Specifications
5.4.1 Overall Description The purpose of the software section of the project is to provide an interface to log the data into a database, to retrieve it in the format required for various applications, plot the data on a map and also to configure the vehicle mounted unit remotely. 5.4.4 Design and Implementation constraints The design and implementation of the web resources is constrained by the design of the hardware unit and the availability of the specifications in the previous section and also the Google Maps.

5.4.2 User Classes and Characteristics The access to the website is closely linked with the hardware unit described in the previous sections. The current prototype includes the user class ‗Client‘ which will refer to the owner of the fleet or any authorized representative of the owner, like the fleet manager, with administrative privileges.

5.4.5 Assumptions and Dependencies It is assumed that prior to the use of the web module, the Google Maps API Key is obtained from

http://code.google.com/apis/maps /signup.html

It is also required that the Hardware unit is up and running. The browser used by the client must be capable of displaying google

5.4.3 Operating Environment The operating environment will include two parts –the server side and the client side. The server should have PHP, MySQL and JavaScript to be installed and enabled. The client side requirement would be a web browser capable of displaying Google Maps.

maps

Dept. of Computer Science & Engineering College of Engineering, Munnar

Major Project ‘09 35 Fleet Management System

5.4.4 Product Description

The data received at the serverlog.php page is processed by that page as follows

The Web-side of the project has the following pages serverlog.php index.html top.html right.php mapArea.html mapplot.php loginValidation.php setCuky.php home.html moduleconfig.php processModuleUpdate.php The Hardware Unit accesses the After that the Password Sent by the unit is compared with the data from the database. If there is any disparity a DBU:AUTHERROR is signaled. Once the authenticity and integrity of the data is ensured, it is logged into the ‗mapping‘ table in the ‗cemunnar_marauders‘ database. On success ‗DBU:SUCCESS‘ is signaled and if it fails ‗DBU:ERROR‘ is signaled. Whenever there is an update available for the unit, as signaled by the corresponding Boolean true value from the table a ‗cemunnar_marauders‘.‗credentials‘, Initially, it concatenates all the data received at the serverside and computes its MD5 Hash. This is then compared with the check Sum sent by the unit. Any disparity signals the DBU:INTEGRITYERROR. Then the latitude and longitude values are converted into the geographical coordinates required by the Google Maps to plot the data. This is followed by the Data validation procedures and rejects null data.

serverlog.php via GPRS and sends the following data. • • • • • • • • • • • Device Id Password Latitude Longitude Time Velocity Fuel Ignition Tamper Remark Check Sum

‗DBU:UPDATE‘ is signaled. So is the case with Alert:OVERSPEED and

Alert:GEOFENCEVIOLATION.

Dept. of Computer Science & Engineering College of Engineering, Munnar

Major Project ‘09 36 Fleet Management System

5.4.5 Page Hierarchy

Dept. of Computer Science & Engineering College of Engineering, Munnar

Major Project ‘09 37 Fleet Management System

Dept. of Computer Science & Engineering College of Engineering, Munnar

Major Project ‘09 38 Fleet Management System

6
OPENERP INTEGRATION

I
key

nformation Systems have played an increasingly visible role over the past several years in improving the

Resource Planning) system makes the ideal platform for this common reference point.

competitiveness of business. More than just tools for handling repetitive tasks, they‘re used to guide and advance all of a company‘s‗ daily activities. Integrated

6.1 Open Source Software at the Service of Management
Risks and integration costs are important barriers to all the advantages you gain from such systems. That‘s why, today, few smalland medium-sized companies use ERP. In addition, the larger ERP vendors such as SAP, Microsoft and Oracle haven‘t been able to reconcile the power and

management software is today very often a source of significant competitive

advantage.

The standard response to a need for responsiveness, reliability, and rapidly

increasing expectations is to create an organization based on departments with a clear linear structure, integrated around your operating processes. To increase efficiency amongst salespeople, accountants, logistics staff and everyone else you should have a common understanding of your problems.

comprehensive cover of an ERP system with the simplicity and flexibility wanted by the users. But this is exactly what small and medium enterprises are looking for.

The development processes of open source software, and the new business models adopted by their developers, provide

For this you need a common language for shared references, policies and

a new way of resolving such problems of cost and quality for this kind of enterprise software.

communication. An ERP (Enterprise

Dept. of Computer Science & Engineering College of Engineering, Munnar

Major Project ‘09 39 Fleet Management System

To make an ERP system fully available to small and medium enterprise, cost reduction is the first priority. Open source software makes it possible to greatly reduce

results exceed any reasonable expectations when such work is well organized.

But the real challenge of development is to make this solution simple and flexible, as well as complete. And to reach this level of quality you need a leader and co-ordinator who can organize all of these activities. So the development team of Tiny ERP, today called Open ERP, is responsible for most of the organization, synchronization and

development costs by aggressive reuse of open source software libraries; to eliminate intermediaries (the distributors), with all of their expensive sales overhead; to cut out selling costs by free publication of the software; and to considerably reduce the marketing overhead.

coherence of the software. Since there is open interaction among thousands of contributors and partners working on the same project, the quality of the resulting software benefits greatly from the scrutiny. And you can‘t be everything at once: accountant, software developer, Because of its modularity, collaborative developments in Open ERP have been cleanly integrated, enabling any company to choose from a large list of available functions. As with most open source software, Faced with these wide-ranging requirements, what could be better than a world network of partners and contributors? Everyone adds their own contribution according to their professional competence. Throughout this book you‘ll see that the accessibility, flexibility, and And Open ERP offers great performance in all these areas!

6.2 The OpenERP Solution

salesperson, ISO 9001 quality professional, specialist in agricultural products, expert in the customs and habits of pharmaceutical vendors, just as a start.

simplicity are important keywords for development. Experience has shown that there‘s no need to train users for several months on the system, because they can just download it and use it directly.

Dept. of Computer Science & Engineering College of Engineering, Munnar

Major Project ‘09 40 Fleet Management System

So you‘ll find the modules for all types of needs, allowing your company to build its customized system by simply grouping and configuring the most suitable modules. Hundreds of modules are available.

companies. This diversity is an illustration of the software‘s flexibility: a rather elegant coordination between people‘s functional expectations of the software and great simplicity in its use.

They range from specific modules like the EDI interface for agricultural products, which has been used to interface with Match and Leclerc stores, up to the generic demonstration automation module for

And this diversity is also found in the various sectors and trades which use the software, including agricultural products, textiles, public auctions, IT, and trade associations.

ordering sandwiches, which can take care of the eating preference of your staff. Lastly, such software has arisen from the blend of high code quality, well-judged The results are quite impressive. Open ERP (once called Tiny ERP when it started out) is management software that is architecture and use of free technologies. In fact, you may be surprised (if you‘re an IT person) to find that the size of Open ERP is less than 4 MB when you‘ve installed the software. Implementation of IT has moved a long way from the days when the only people who could be expected to benefit from ERP were the owners of a widget factory on some remote industrial estate.

downloaded more than any other in the world, with over 600 downloads per day. It‘s available today in 18 languages and has a world network of partners and

contributors. More than 800 developers participate in the projects on the

collaborative development system of Tiny Forge.

6.3 Fleet Management Module
Inspite of the popularity and expertise in various verticals, Open ERP still lacks the fleet management functionality. Hence this

To our knowledge, Open ERP is the only management system which is routinely used not only by big companies but also by very small companies and independent

Dept. of Computer Science & Engineering College of Engineering, Munnar

Major Project ‘09 41 Fleet Management System

project incorporates a fleet_manager module for Open ERP. The features of the module are: Vehicle Management: 1. Vehicle Details 2. Vehicle Records & Documentation 3. Purchase, Insurance, Dues etc. 4. Loan Payment Scheduler 5. Asset Management 6. Depreciation

Spares Management 1. Spares/Tyre serialised management 2. Stock management 3. Warranty tracking

GPS Integration 1. GPS based order management 2. GPS based tracking and predictive movement 3. GPS based tracking for customer

Fuel Master 1. Fuelling Information 2. Fuel/Vendor wise mileage 3. Fuel Card Manager

The module is version controlled at the Launchpad. Launchpad is a unique

collaboration and hosting platform for software projects. Most open source projects including the popular Linux Distribution

Partner Management 1. Customer Relationship Management 2. Supplier Relationship Management 3. Automatic Invoicing on Shipping 4. Order Management with GPS

Ubuntu

is

hosted

at

the

launchpad.

Launchpad integrates the Bazaar version control system and makes release

management, bug tracking and community building easier than ever. The bazaar branch for the project is Branch lp:~sharoonthomas/openobject -addons/fleetmanagement The bazaar version control system is an easy to use open source tool. .

integration

Fleet Maintainance 1. Preventive Maintainance 2. Scheduled Maintainance 3. Work Order management 4. Repair Cost tracker

Dept. of Computer Science & Engineering College of Engineering, Munnar

Major Project ‘09 42 Fleet Management System

Conclusion

The project was successfully completed and the prototype was implemented using Telit GM862 GPS. The web interface was implemented and hosted in the college subdomain 'maraudersmap.cemunnar.ac.in'. The Fleet Management System is a feasible concept which we believe would be answer to most of the problems discussed in the initial study of this project.

The lack of integration in Indian fleet industry can be completely addressed by this solution. Future

enhancements for the project include 1. 2. 3. Accelerometer based accident detector Geofencing Route mapping & predictive path algorithm.

Thus the project achieved its goals not to be terminated at this stage, but to be developed as a future gadget automating auto-mobiles and the Indian fleet industry

Dept. of Computer Science & Engineering College of Engineering, Munnar

Major Project ‘09 43 Fleet Management System

References

[1.] The World Bank., Transport in South Asia Permanent URL:http://go.worldbank.org/FUE8JM6E40 [2.] Nils Hellström., Fleet Management Services in GSM-modules, Master thesis in Electronics Dept. of Electrical Engineering at Linköpings Universitet [3.] Magnus Ewert, 2001, GPRS 1:st ed.,

Studentlitteratur Lund [4.] Miller Philip, 1997, TCP/IP Explained,

Butterworth-Heinmann, Newton MA [5.] Hofmann-Wellenhof Bernard et al., 2001, Global positioning system : theory and practice. 5:th ed., Springer Wien [6.] Markku Mikael Hautamäki, USING GPRS AS A WIRELESS CORE NETWORK FOR WIRELESS LOCAL AREA NETWORKS [7.] 'Open ERP Book' By Fabien Pinckaers

Dept. of Computer Science & Engineering College of Engineering, Munnar

Major Project ‘09 44 Fleet Management System

Index
Global Positioning System, 3, 9, 10, 11, 12, 13, 14, 15, 17, 18, 19, 20, 23, 24, 26, 38 Google Maps API, 29 Google Maps API Key, 31 GPRS, 5, 6, 7, 8, 17, 20, 24, 32 GSM, 1, 5, 6, 7, 8, 11, 12, 14, 16, 17, 18, 20

A
AT command, 26 AUTHERROR, 32

O
OpenERP, 4, 35 OVERSPEED, 32

B
battery, 24

P
PHP, 30, 31 processModuleUpdate.php, 32 Project Marauders Map, 1 Python, 1, 15, 18, 19, 20, 30

C
Call Control Logic, 22 Check Sum, 32 Checksum, 12, 24 Control Flow, 22, 25

H
home.html, 32

I
Ignition Block, 21 index.html, 32 INTEGRITYERROR, 32 IP address, 8

R
Remote Update, 18 right.php, 32 RS232, 13, 19

D
Domain Name System, 8

E
ERROR, 32

L
Latitude, 12, 24, 32 loginValidation.php, 32 Longitude, 12, 24, 32

S
serverlog.php, 24, 32 setCuky.php, 32 SUCCESS, 32

F
Fleet Management System, 1, 2, 3 Fuel Block, 21

M
mapArea.html, 32 mapplot.php, 32 moduleconfig.php, 32 MySQL, 29, 30, 31

T
Tampering Block, 21 Telit GM862 GPS, 1, 13, 14, 18, 20, 21, 27 Time Division Multiple Access, 6 top.html, 32

G
General Purpose Input Output, 15, 21, 22, 23, 24, 28 GEOFENCEVIOLATION, 32

N
NMEA, 11, 12

U
UPDATE, 32

Dept. of Computer Science & Engineering College of Engineering, Munnar

Telit GM862 GPS Datasheet
Appendix A

This is the Datasheet of the Telit GM862 GPS as available from www.telit.com

Source Code -1
Appendix B

This appendix contains the source code of the web part of the project. The page hierarchy and organization is detailed in the chapter 5 of this report. The source code of the homepage is exempted.

serverlog.php

<!--DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"--> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Server Log</title> </head> <body> <?php $devId= $_GET['devId']; $pass= $_GET['pass']; $lat= $_GET['lat']; $lon= $_GET['lon']; $tim= $_GET['tim']; $vel= $_GET['vel']; $fuel= $_GET['fuel']; $ign= $_GET['ign']; $tamper= $_GET['tamper']; $remark= $_GET['remark']; $csum= $_GET['csum']; $validate=$devId.$lat.$lon.$tim.$vel.$fuel.$ign.$tamper.$remark; if(strcmp(md5($validate),$csum)!=0) { echo $validate." ".md5($validate)." ".$csum."\n"; die("DBU:INTEGRITYERROR"); } if(strstr($lat,"N")) { $lat=str_replace("N","",$lat); } if(strstr($lon,"E")) { $lon=str_replace("E","",$lon); } if(strstr($lat,"S")) { $lat=str_replace("S","",$lat); $lat=-1*$lat; } if(strstr($lon,"W")) { $lon=str_replace("W","",$lon); $lon=-1*$lon; } if($lat=='' and $lon=='' and $vel=='') die("DBU:SUCCESS"); $lat=$lat/100;

$lon=$lon/100; mysql_connect("cemunnar.ac.in","cemunnar_madmin","iamuptonogood") or die ('I cannot connect to database because : '. mysql_error()); mysql_select_db("cemunnar_marauders"); $query2="select passw from credentials where devId='".$devId."' limit 1;"; $ps=mysql_query($query2) or die(mysql_error()); $pswd=mysql_fetch_row($ps); echo mysql_affected_rows()." "; if(strcmp($pswd[0],$pass)!=0) { die("DBU:AUTHERR"); } $query="insert into mapping values('NULL', '".$devId."', '".$pass."', '".$lat."', '".$lon."', '".$tim."', '".$vel."', '".$fuel."', '".$ign."', '".$tamper."', '".$remark."', NULL);"; mysql_query($query) or die("DBU:ERROR ".mysql_error()); echo "Database Updated : ".$devId." ".$pass." ".$lat." ".$lon." "; echo "DBU:SUCCESS"; $query2="select * from deviceAlert where devId='".$devId."' limit 1;"; $da=mysql_query($query2) or die(mysql_error()); $devAlert=mysql_fetch_row($da); $upd=$devAlert["upd"]; $oAlert=$devAlert["oalert"]; $gfAlert=$devAlert["gfalert"]; if($upd==1) echo "DBU:UPDATE"; if($oAlert==1) echo "Alert:OVERSPEED"; if($gfAlert==1) echo "Alert:GEOFENCEVIOLATION"; ?> </body> </html>

End of serverlog.php

cnxn.php
<? $username="cemunnar_madmin"; $password="iamuptonogood"; $database="cemunnar_marauders"; ?>

End of cnxn.php

loginValidation.php
<html> <head> <title>Login Verification</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body> <?php $clientId=$_REQUEST["loginClientId"]; $loginPswd=$_REQUEST["loginPswd"]; $pswdHash=md5($loginPswd); // Opens a connection to a MySQL server $connection=mysql_connect("cemunnar.ac.in","cemunnar_madmin","iamuptono good"); if (!$connection) { die('Not connected : ' . mysql_error()); } // Set the active MySQL database $db_selected = mysql_select_db("cemunnar_marauders", $connection); if (!$db_selected) { die ('Can

t use db : ' . mysql_error()); } $query = "SELECT passw FROM credentials WHERE clientid='".$clientId."'"; $result = mysql_query($query); if (!$result) { die('Invalid query: ' . mysql_error()); } $row = mysql_fetch_array($result, MYSQL_ASSOC); if(strcmp($row["passw"],$loginPswd)!=0) { //echo "<script type=###BOT_TEXT###quot;text/javascript###BOT_TEXT###quot;> alert(###BOT_TEXT###quot;Authentication Failure###BOT_TEXT###quot;); history.go(-1);<\script>"; echo "<script> history.go(-1)</script>";die(); } else {

echo "Success"; //header("Location:http://maraudersmap.cemunnar.ac.in/setCuky.php?c=".$ clientid);*/ echo "<script type=###BOT_TEXT###quot;text/javascript###BOT_TEXT###quot;>location.replace(###BOT_TEXT###quot;http://maraudersmap.cemunnar.ac.i n/setCuky.php?c=".$clientId."###BOT_TEXT###quot;);</script>"; } ?> </body> </html>

End of loginValidation.php

mapArea.html
<?xml version="1.0" encoding="utf-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <title>Project Marauders Map</title> <script src="http://maps.google.com/maps?file=api&amp;v=2&amp;key=ABQIAAAA7eNAFmGdfrH A6udKO8tiehRabvw7QOXmJw-C3n4r9VIzvHtdHRRo_xk3KixgoswICIZKx6c0Wg9mHw" type="text/javascript"></script> <script type="text/javascript"> //<![CDATA[ var iconBlue = new GIcon(); iconBlue.image = 'http://labs.google.com/ridefinder/images/mm_20_blue.png'; iconBlue.shadow = 'http://labs.google.com/ridefinder/images/mm_20_shadow.png'; iconBlue.iconSize = new GSize(12, 20); iconBlue.shadowSize = new GSize(22, 20); iconBlue.iconAnchor = new GPoint(6, 20); iconBlue.infoWindowAnchor = new GPoint(5, 1); var iconRed = new GIcon(); iconRed.image = 'http://labs.google.com/ridefinder/images/mm_20_red.png'; iconRed.shadow = 'http://labs.google.com/ridefinder/images/mm_20_shadow.png'; iconRed.iconSize = new GSize(12, 20); iconRed.shadowSize = new GSize(22, 20); iconRed.iconAnchor = new GPoint(6, 20); iconRed.infoWindowAnchor = new GPoint(5, 1); var customIcons = [];

customIcons["restaurant"] = iconBlue; customIcons["bar"] = iconRed; function load(devId) { if (GBrowserIsCompatible()) { var map = new GMap2(document.getElementById("map")); var bounds = new GLatLngBounds(); map.addControl(new GSmallMapControl()); map.addControl(new GMapTypeControl()); map.setCenter(new GLatLng(10.074671,77.13501), 10); GDownloadUrl("mapplot.php?deviceId="+devId, function(data) { var xml = GXml.parse(data); var markers = xml.documentElement.getElementsByTagName("marker"); for (var i = 0; i < markers.length; i++) { var devId = markers[i].getAttribute("devId"); var point = new GLatLng(parseFloat(markers[i].getAttribute("lat")), parseFloat(markers[i].getAttribute("lng"))); var marker = createMarker(point, devId); bounds.extend(point); map.setZoom(map.getBoundsZoomLevel(bounds)); map.addOverlay(marker); map.setCenter(bounds.getCenter()); } }); } } function createMarker(point, devId) { var marker = new GMarker(point, iconRed); var html = "<b>" + devId + "</b> <br/>"; GEvent.addListener(marker, 'click', function() { marker.openInfoWindowHtml(html); }); return marker; } //]]> </script> <style type="text/css"> <!-body { margin-top: 20px; } --> </style></head> <body leftmargin="0" marginwidth="0" onload="load()" onunload="GUnload()"> <div id="map" style="width: 750px; height: 350px"> <div align="center"></div> </div> </body> </html>

End of mapArea.html

mapplot.php
<?php require("cnxn.php"); $deviceId=@$_REQUEST['deviceId']; function parseToXML($htmlStr) { $xmlStr=str_replace('<','&lt;',$htmlStr); $xmlStr=str_replace('>','&gt;',$xmlStr); $xmlStr=str_replace('"','&quot;',$xmlStr); $xmlStr=str_replace("'",'&#39;',$xmlStr); $xmlStr=str_replace("&",'&amp;',$xmlStr); return $xmlStr; } // Opens a connection to a MySQL server $connection=mysql_connect("cemunnar.ac.in","cemunnar_madmin","iamuptonogood") ; if (!$connection) { die('Not connected : ' . mysql_error()); } // Set the active MySQL database $db_selected = mysql_select_db($database, $connection); if (!$db_selected) { die ('Can

Related Interests

t use db : ' . mysql_error()); } // Select all the rows in the markers table $query = "SELECT * FROM mapping WHERE devId='".$deviceId."'"; $result = mysql_query($query); if (!$result) { die('Invalid query: ' . mysql_error()); } header("Content-type: text/xml"); // Start XML file, echo parent node echo '<markers>'; // Iterate through the rows, printing XML nodes for each while ($row = @mysql_fetch_assoc($result)){ // ADD TO XML DOCUMENT NODE echo '<marker '; echo 'devId="' . parseToXML($row['devId']) . '" '; echo 'lat="' . $row['lat'] . '" '; echo 'lng="' . $row['lon'] . '" '; echo '/>'; } // End XML file echo '</markers>'; ?>

End of mapplot.php

moduleconfig.php
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>Module Configuration Utility</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body> <?php $clientid=$_COOKIE["clientid"]; require("cnxn.php"); // Opens a connection to a MySQL server $connection=mysql_connect("cemunnar.ac.in","cemunnar_madmin",$password); if (!$connection) { die('Not connected : ' . mysql_error()); } // Set the active MySQL database $db_selected = mysql_select_db($database, $connection); if (!$db_selected) { die ('Can

Related Interests

t use db : ' . mysql_error()); } // Select all the rows in the markers table $query = "SELECT devId from credentials WHERE clientid='".$clientid."'"; $query2 = "SELECT provide from serviceProvider"; $resultDevId = mysql_query($query); if (!$resultDevId) { die('Invalid query: ' . mysql_error()); } ?> <form name="customerConfig" action="processModuleUpdate.php"> <table width="48%" border="1"> <tr> <td width="34%">Unit ID</td> <td width="66%"><select name="cmbUnitId" id="cmbUnitId"> <?php if(mysql_num_rows($resultDevId)) { // we have at least one user, so show all users as options in select form while($rowDevId = mysql_fetch_row($resultDevId)) { if(strcmp($rowDevId[0],$dev)!=0) print("<option value=###BOT_TEXT###quot;$rowDevId[0]###BOT_TEXT###quot;>$rowDevId[0]</option>"); else print("<option value=###BOT_TEXT###quot;$rowDevId[0]###BOT_TEXT###quot; selected>$rowDevId[0]</option>"); } } else { print("<option value=###BOT_TEXT###quot;###BOT_TEXT###quot;>No Devices Assigned</option>"); }?> </select></td> </tr>

<tr> <td>Control No 1</td> <td><input name="cn1" type="text" id="cn1"></td> </tr> <tr> <td>Control No 2</td> <td><input name="cn2" type="text" id="cn2"></td> </tr> <tr> <td>Valid Nos +91</td> <td><p> <input name="validNos" type="text" id="validNos"><br> (separate each number by commas)</p> </td> </tr> <tr> <td>Service Provider</td> <td><select name="cmbService" id="cmbService"> <?php $resultService=mysql_query($query2); if(mysql_num_rows($resultDevId)) { while($rowService = mysql_fetch_row($resultService)) { print("<option value=###BOT_TEXT###quot;$rowService[0]###BOT_TEXT###quot;>$rowService[0]</option>"); } } else { print("<option value=###BOT_TEXT###quot;###BOT_TEXT###quot;>No Service Provider</option>"); } ?> </select></td> </tr> <tr> <td><input type="reset" name="Submit2" value="Reset"></td> <td> <input type="submit" name="Submit" value="Update Module"></td> </tr> </table> </form> </body> </html>

End of moduleconfig.php

processModuleUpdate.php
<?php $cmbUnitId=$_REQUEST["cmbUnitId"]; $cn1=$_REQUEST["cn1"]; $cn2=$_REQUEST["cn2"]; $validNos=$_REQUEST["validNos"]; $cmbService=$_REQUEST["cmbService"]; $clientid=$_COOKIE["clientid"]; require("cnxn.php"); // Opens a connection to a MySQL server $connection=mysql_connect("cemunnar.ac.in","cemunnar_madmin",$password); if (!$connection) { die('Not connected : ' . mysql_error()); } // Set the active MySQL database $db_selected = mysql_select_db($database, $connection); if (!$db_selected) { die ('Can

Related Interests

t use db : ' . mysql_error()); } $query = "SELECT apn,usname,pasw from serviceProvider where provide='".$cmbService."'"; $result= mysql_query($query); if (!$result) { die('Invalid query: ' . mysql_error()); } $row = mysql_fetch_array($result, MYSQL_ASSOC); $apn=$row["apn"]; $un=$row["usname"]; $passw=$row["pasw"]; $replace=array('[',']',','); $replaceby=array('[

Related Interests

','

Related Interests

]','

Related Interests

,

Related Interests

'); $validNos="[".$validNos."]"; $validNos = str_replace($replace, $replaceby, $validNos); $myFile = "updates/config".$cmbUnitId.".py"; $fh = fopen($myFile, 'w') or die("Can't open file"); $stringData = "import SER\n#This is the config file\ndef main():\n SER.send(###BOT_TEXT###quot;\r\nConfig file import success\r\n###BOT_TEXT###quot;)\n return\n#This is the config file\nunitid=###BOT_TEXT###quot;".$cmbUnitId."###BOT_TEXT###quot;\ncontrolno1=###BOT_TEXT###quot;".$cn1."###BOT_TEXT###quot;\ncontrolno2=###BOT_TEXT###quot;".$cn2 ."###BOT_TEXT###quot;\nvalidnos=".$validNos."\nrepeatunit=15\ntimeoffset=###BOT_TEXT###quot;+22###BOT_TEXT###quot;\napn='".$apn. "'\npassw='".$passw."'\nui='".$un."'\ndi='sl12'\npas='sl12'\nmain()\n # I am forced to put some dumb code here also. Please bear with me all those who read this code.\n"; fwrite($fh, $stringData); //echo $stringData; fclose($fh);

$query2="UPDATE deviceAlert SET upd=1 where devid='".$cmbUnitId."'"; $da=mysql_query($query2) or die(mysql_error()); echo "<script type=###BOT_TEXT###quot;text/javascript###BOT_TEXT###quot;>location.replace(###BOT_TEXT###quot;http://maraudersmap.cemunnar.ac.i n/right.php###BOT_TEXT###quot;);</script>"; ?>

End of processModuleUpdate.php

right.php
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>Untitled Document</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <style type="text/css"> <!-body { margin-left: 0px; margin-top: 20px; margin-right: 5px; margin-bottom: 0px; } --> </style></head> <body> <form name="recompute" action="right.php"> <?php if(isset($selectDevice)) { $dev=$_REQUEST["selectDevice"]; echo "<script>parent.mainFrame.load('".$dev."')</script>"; } if(isset($config)) { echo "<script type=###BOT_TEXT###quot;text/javascript###BOT_TEXT###quot;>location.replace(###BOT_TEXT###quot;http://maraudersmap.cemunnar.ac.i n/moduleconfig.php###BOT_TEXT###quot;);</script>"; } $connection=mysql_connect("cemunnar.ac.in","cemunnar_madmin","iamuptono good"); if (!$connection) { die('Not connected : ' . mysql_error()); } // Set the active MySQL database $db_selected = mysql_select_db('cemunnar_marauders', $connection); if (!$db_selected) { die ('Can

Related Interests