CarWatch: My homemade car tracking platform

few months ago, I was thinking about having my car tracked over GPS to make sure it is where I left it and to have some records how much I drive etc. There are commercial systems available for this but they cost some money and I wanted to have it customizable, under own control and to implement a few own ideas so I designed and implemented the system by myself. This is how CarWatch was born.

Hardware

First you need to have some kind of device with GPS receiver and network connection. Other people build it from Arduino, GPS modules, GSM modules, accelerometers and glue it with firmware. This setup is quite complicated to build and even more complicated to debug or upgrade. I also wanted other people to be able to build it themselves without complicated soldering or programming so I came up with an idea that I won’t be messing with any hardware construction and I’ll use old Android phone which has all these features. Everyone has some old Android phone lying in his electronic trash so why not to give it a new life. All you might need to buy is 12V to 5V micro USB converter. I recommend these:

Software

Hardware was easy job but the main part was writing software. I needed to write both server and client side of my application.

Android client

I’ve had some experience with coding for Android (although I’m not any professional coder) and wanted it to be super simple from user point of view, so there are not any customizable settings in this app. Download, install, register and activate. Then hide the phone somewhere in your car. That’s all.

This app runs as service and starts right after phone boot. It regularly (each few seconds) sends new data to CarWatch tower (server) as simple UDP packet. I wanted to avoid any statefull connection so in case of interrupted connectivity some packets just don’t arrive to tower and the connection continues right after. I also wanted the data to be cryptographically authenticated so I sign them with SHA-256 hash which is salted with string generated at registration.

Server backend

As a server, I’m using python script which only listens on UDP and saves all incoming packets to database. Then there is a separate script which processes new packets, validates them against stored salt and processes data.

This script also assigns zero or more of these states to each car after packet processing:

NEW – car just created, no data so far

DATA_MISSING – no packet received from car for defined time

GPS_LOST – data received but GPS timestamp too old

GPS_MOVE – GPSSpd > 0

NOT_CHARGING – phone disconnected from charger

BAT_OVERHEAT – battery temperature higher than threshold

BAT_LOW

DATA_UNSECURE – data came with invalid signature

Every time the state changes, you can get an e-mail with latest data about car and map with its latest position.

Web frontend

I also built a simple web portal, where I can see current car position and also its history. It’s built on top of UserFrosting platform to save some development time. This is where you need to register before installing app to phone. You can see drive maps, current car state and position, historical stats and all your registered cars here. Some screenshots here:

Beta

If you want to try it, go ahead, register and try it! I’ll be glad. I also welcome any feedback concerning the idea or implemented features.

What now?

This is the question I am facing now. What to do with this whole project? It already has some neat features implemented, some of them are not so well done but generally it works to my satisfaction. I have some more ideas what could be done (OBDII logging, owner sensing via BT, SMS callback, etc.) but they would take time and I’m not sure if it’s worth it if it’s going to be used only by myself. That’s also the main reason I’m writing this post.

[poll id=”2″]

What would you recommend me to do? Would you like to use such product? Do you think it’s worth it? Let me know in comments please.