DIY Vehicle Tracking, GPS and GPRS with PC/104, Ubuntu and Ruby

Over the 2005/2006 summer holiday, I had been looking around for a new project to keep me amused. DIY Vehicle Tracking seemed suitably difficult to attempt. Here is that project. To see the results, you can see some output here

After considering and discounting the mini ITX board (because of high power requirements) I settled on the PC/104 board as a preferred solution. It's considerably simpler and a good range of modules, is basically just a Pentium 1 PC and it's power requirements are tiny.

I purchased mine from Micro Technic in Denmark. Be careful if you purchase there though. The specs detailed on the web site are not the same as the specs of the board actually shipped. Given my time again I'd probably purchase from Robotics Connection in the USA. In fact when if I ever build Mr Green (for Gabba's car), that's where I will be purchasing my next PC/104.

The Micronix PV-6072 is actually an ICOP 6072. Cost was US$272 plus US$37 for shipped. No duty or GST landed into New Zealand.

After finding that the damn thing wouldn't boot off USB as advertised, I chose a 4.3GB hard drive and installed Debian Sarge. The PC/104 board booted just fine and Debian ran nicely on only 64MB of RAM.

Linux Wifi Connection
Next step was to get an ethernet connection working. I researched for hours trying to find a USB Wifi adapter that was going to work with some measure of success. Not finding anything that was going to work guaranteed I plonked my cash down and gambled on a D-Link DWL-G122 from Ascent.

After lots of fiddling, I finally got the RT2750 RAUSB driver compiled and working well. This was a spectacular victory given every attempt I've ever made at getting a driver to work well has been an abysmal failure. I was pretty happy with my progress to this point.

Out with Debian, in with Ubuntu
Some problems started to appear with versions of some of the apps I wanted to run, so I decided to upgrade to Debian Etch. The upgrade worked fine, but the damn module refused to boot it. After dicking around for a morning, I decided to bite the bullet and have a go with Ubuntu based on some advice from J. The install worked perfectly on a new (old) 6GB drive. I compiled the Wifi driver again perfectly first time and everything else was working within a couple of hours. A huge step forward. I'm a Ubuntu Convert now for certain. It was so much easier than Debian.

Supporting applications
I've used a pile of existing Open Source applications to make everything work. Most notably:

Out with PHP, in with Ruby
Coding the application was proving tough. I'd decided to code the interface with PHP because that's what I know best. I had all the individual bits working just fine. But as a non-coder, I was having difficulty getting them all to fit together in a way that worked at all, let alone well. Then Steve suggested I use Ruby.

I had been reading about Ruby for quite a while, but was reluctant to learn yet another programming language. But given this whole project is all about learning and playing with new stuff, I thought I should give it a go. And I'm glad I did. I managed to figure out the syntax and got enough code to replace what I had done in PHP in about half the time. Not only that, but I could see a way forward. Now I just need to get my head around the whole object thing.

Car Power Supply
I calculated all the components would use about 12 watts of power from 5VDC and 12VDC. I hung around on the forums on to see how to power everything, and eventually settled on an 80 Watt Morex Car Power Supply from LOGIC Supply.

Putting it all together
I screwed all the components onto the cover of an old DVD player we have laying around (after throwing the rest of the player into the trash). There is 12VDC supplied direct from the car battery to the Morex Power Supply. It is then distributed to all the compenents. A 4 port USB hub gives me space to plug everything in. A Griffin Powermate is the only input device. It gives me left and right and short and long clicks as my main input methods. Output is by way of a Matrix Orbital 25 chararacter 4 line LCD. Currently sending my location back to the website is entirely manual. GPRS data charges are just too high here still ($10 per MB) to allow it to run automatically. 1 long press on the Powermate kicks off a request to the GPS for our location. Then the location, speed and altitude are poked into a shell script. Next my ruby script runs another shell script that fires up PPP to call Vodafone. ip-up runs the wget script and then PPP shuts down the GPRS connection 30 seconds after a successful connect.

Issues to solve
Mostly for my own benefit, I record here the issues still to solve

Item Total Cost of the Project
PC/104 6072$472.37
D-Link DWL-G122$66.47
DSE USB GPS Receiver$198.00
80 Watt Morex Car Power Supply$101.00
4 Port USB Hub$38.60
USB Cable for the cell phone$14.00
Sony Ericsson T610 Cell Phone$155.00
Misc hardware and cable ties etc$25.00
Griffin PowermateFreebie
Matrix Orbital Serial LCDPrior Project
6GB Hard DriveFreebie
This cost is offset by me selling some stuff from previous projects (Driving suit and boots, the WAG54G) which returned me just over $600.

Copyright 2018 - Spudooli Investments Ltd