GPS tracking fleet project (part. 1)
About a year ago I was talking to a friend that was working for a company that offered a fleet tracking service, he described the process and I just got curious about how could I implement the entire system easily, I did some research and there wasn’t a lot of information about the entire picture, there were bits here and there but nothing concrete.
After a couple of days of researching I came up with a Plan to write a platform in one month in my spare time, the intention was to create a fully functional backend and front end pieces, with the ability to track any number of units.
It was a bit challenging because :
- The short time span I wanted to have this ready.
- I didn’t have any hardware to test (GPS receivers, GPRS modems, or even a dedicated server to put the backend), and I didn’t want to spent any money buying any of this.
- I didn’t had a lot of experience with Google maps API.
The first thing I did was a diagram of how the system should work:
I’m not good with drawings so bear with me, let me explain the diagram:
There will be a tracking device in every truck that will be sending periodic updates about its location, speed, and other events trough a GPRS link, provided by a conventional GSM network, the device must be programmed to send this updates to a certain ip address (Application server), at specified periods of time.
The application server (background process) will have a daemon running on a specific port waiting for requests from tracking devices, if the tracking device is authorized it will accept the stream and save the info received from the device to a db.
The requirements for the backend application were:
- It should be able to run on Linux.
- The process should be able to handle a large number of requests.
- It needed to be run as a daemon, interfacing with a system to logger.
- It must be able to decode NMEA sentences and save them in a MySQL Db.
The front end application, requirements were:
- Handle user authentication.
- Present the gathered data in real time.
- Generate reports.
Technology selection:
With basic requirements on hand, the next thing was to look the technologies I should be using and this were my choices:
For the backend:
- Gentoo Linux
- Java 1.6
- Mysql 5.0
For the frontend:
- Gentoo Linux
- PHP 5.2
- Jquery 1.3
- Mysql 5.0
In my next post I will describe the approach I took on the back end process and how I started building it.