Giter VIP home page Giter VIP logo

gps-tracker-server's Introduction

GPS Tracker Server

Manage and display locations of GPS tracking devices

Screenshot

This was from my demo system just before decomissioning, with live data from my actual device. Screenshot of GPS Thingo

Why

My motorcycle was stolen, and I really wished I had a way to track it down.

I knew it had an OBDII port (like most cars, not so many bikes), which I had previously used to flash the ECU and log engine data, and thought, wouldn't it be cool if it was fitted with a GPS tracker which just plugged into that (i.e. no cutting/soldering required).

I found just such devices (specifically the Coban GPS306) available on eBay for USD$60 and bought one.

By default the devices come configured to use www.gpstrackerxy.com. That system is hosted by some unknown-to-me company in China, plus you only get 30 days free access.

The other open source solutions out there looked ugly, heavy, or clunky. So I made my own.

So the primary use case is: "as myself, I want to find where my bike is, so that I can get it the hell back" =)

Current Status

Currently the device gateway handles device initialization, heartbeat, and location request/response.

Now I have the basics working (location request/report/view on map), I've stopped active development. The main reason for this is that I can't see they system being widely useful to myself or others (I now keep my bike locked in the garage). Still, it was a fun thing to do.

Currently only works for the Coban GPS306, since that's what I bought.
HOWEVER - the system /is/ architected to make additional device support easy to add.

For anyone interested, the other things I thought would be cool to do are on the Trello board

Overview

GPS Tracker Device <--> Device Gateway <--> MongoDB <--> REST API <--> Web Frontend

Devices

These devices use GPRS (so you need a SIM with some credit) to talk over the net to an admin server (which I call "device gateway") via TCP or UDP.
The protocols are pretty simple strings containing commands (e.g. send me your location) and responses (e.g. my location is lat.x long.y)

You configure them by sending an SMS
e.g. to tell my device to use my home gateway, I sent it an SMS containing "adminip8888 59.167.194.249 9000" (9000 is the port)
After that, it's talking to my device gateway.

Device Gateway

TCP socket server using gevent, mongoengine for ODM/ORM

The gateway can send commands to the devices (mongodb used to store these, as well as all other data)

REST API

Then there's a REST API (python flask, mongoengine for ORM/ODM) talking to the DB

I did initially try eve-mongoengine and flask-mongorest. Though they were great to quickly get basics up, I found them too restrictive (plus, from past experience I know the latter has some serious bugs and is horribly unmaintained).
Plus - for Version Zero I only needed a few endpoints quickly knocked up, hence DIY!

Web Frontend

Angular, Bootstrap, Jade, Sass, Bower, Gulp
TBH web's not my strong point, but with these excellent tools I managed!

Server Setup

This is very shorthand and assumes you're familiar with the stuff in use.

Using virtualenv recommended = no system-wide packages

  • mkdir venv && virtualenv venv/gps
  • . venv/gps/bin/activate
  • pip install -r requirements.txt

Running the Device Gateway

Nothing fancy yet!

  • . venv/gps/bin/activate
  • ./device_gateway.py Should now be listening on port 9000

Trying the Device Gateway

In another tab: cat sample-reqs/tkip102-1.txt | nc localhost 9000

Running Tests

With virtualenv activated, from repo root just run 'nosetests'

Links

gps-tracker-server's People

Contributors

rdkls avatar

Watchers

Md. Shariful Islam avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.