Tribal Chicken

Security. Malware Research. Digital Forensics.

GSM Tracker Code Available

Here is the code for my GSM Tracker, which I am no longer working on. This is a hobby project and a lot of things are either unfinished, undocumented or just not very good. But, my hope is that it will help someone, somewhere rather than collecting the virtual equivalent of dust in my “projects” folder.

This is all provided strictly as-is and licensed as beerware.

The project is split up into several parts, each part can be accessed individually, or you can download the entire zip here:

Arduino MCU

I seem to have misplaced my Fritzing wiring diagram, so more info to come on that later, but here’s a brief overview, with some pictures instead.

IMG_20141220_163501

IMG_20141220_163550

The hardware consists of:

  • Arduino Mega MCU
  • GSM Shield for Arduino
  • Custom shield with power circuitry (regulator, control relay) and GPS Module
  • GPS Module attached to aforementioned shield.
  • SD Card Reader

This was wired into the car with a 12VDC power feed from the auxiliary battery (always on) and a 12VDC ignition signal, as well as various temperature sensor inputs (inside, outside).

Although the power feed was constant, the ignition signal was wired to the relay which switched power to the Arduino. Once powered on, the MCU would pull the relay signal HIGH. This ensures that once the car is powered on (IGN signal drops LOW) the MCU continues to run. Power off sequence is setting the relay pin to LOW.

Firmware (Arduino code))

Link here: /files/goodies/gsm_tracker/firmware/firmware_rev6/

I am fairly sure that being an unfinished hobby project, the code isn’t going to make a whole lot of sense to anyone. Especially since I use a custom communications protocol, but, The Arduino stuff is split up into several files, to help with readability and comprehension:

  • firmware_rev6: This is the meat of the firmware. Also has misc functions such as GPS update, GSM connection routines, interrupt handling and shutdown routines.
  • data_collection: As the name implies, handles the collection of data from various sensors (GPS, thermistors, etc), and writes out to the SD Card
  • device_initialisation: Some basic setup work. Also restores saved values from EEPROM.
  • device_status: Routines to handle the various status lights depending on what is going on.
  • eepromOps: Functions which deal with the non-volatile memory. Mainly reading-in and writing-out.
  • send_data: Handles the transmission of data to the collector via TCP (GSM connection).

Collector

Python script which runs a network server and collects data sent from the tracker then puts into a database. I would not consider this a good example of anything.

Link: /files/goodies/gsm_tracker/collector/

trip-analyser

This is a C++ application which analyses the data from the database and splits into different “trips”. It does this by assessing the conditions put forward by the data and assigning confidence values to determine the trip boundaries.

Link: /files/goodies/gsm_tracker/trip-analyser/

Web App

My first attempt at a Django app + Bootstrap. I need to clean this up a tad and ensure it’s the latest version. Will upload in the next week or two.