Friday, February 1, 2019

GPS Tracker with Pi and UV-5R

I wanted to build a cheap, easy APRS tracker with a Raspberry Pi and a Baofeng radio. Fortunately someone already did and left a trail behind! (Thanks to "Midnight Cheese" blog for the bulk of the details. The blog appears dead, so I copied much of the info here to maintain it.)

Setting up GPS

A simple USB GPS receiver will do just fine for this project. I'm using an old Microsoft USB GPS. In order for the Pi to read the GPS data we'll install gpsd.

sudo apt-get install gpsd gpsd-clients

Setting up the local web server

The main PHP script will read the gpsd information through a JSON file. We'll need to install apache and PHP to serve the JSON file locally.
sudo apt-get install apache2 -y
sudo apt-get install php5 libapache2-mod-php5 -y
Drop this file from the gpsd project into the web server directory, /var/www/ and name it gpsd.php

Execute gpsd.php from the command line to build a needed configuration file.
cd /var/www
sudo php gpsd.php
If you open a web browser on your Pi and navigate to http://localhost/gpsd.php?