This is a detailed, step-by-step guide to using an Uputronics GPS board as the main component of a Pi based APRS position beacon. This project is very similar to my previous APRS beacon project using a USB GPS module. I worked very closely with Chris, K7AZ who was very gracious to lend out the GPS board for this project.
The Uputronics GPS board is typically used as a timing device/NTP server for the Pi in absence of a real time clock (using date and time info via GPS). For this project I'm more interested in the positional data coming from the board.
The board itself is a great piece of hardware. The GPS signal locks in almost instantly. Even in the house. It performs much better than the USB GPS modules I've used in the past. On to the guide.
Download Raspian Stretch Lite, write to SD card
I'm using the CLI only version to keep the system load low, but this should work just the same with the desktop environment version.
I used the Ubuntu Startup Disk Creator app that comes with Ubuntu to create my SD card.
Attach GPS board, antenna, SD card to Pi.
Configure Pi with raspi-config app
Set locale to en us UTF-8.
Keyboard: English (US), generic PC keyboard
Interfacing options menu
P6 Serial -> Login Shell (no) Hardware (yes)
I borrowed most of the GPS board setup from Anthony Stirk (M0UPU).
Add at the bottom:
Save and Quit Nano.
Go to the bottom of the file and add the following:
Update the Pi
Disable bluetooth serial support (I'm guessing the GPS serial connection conflicts with the Bluetooth serial interface)
Not sure what this one does
PPS tools (pulse per second) reads the GPS board which sends GPS/time info every second
Verifying PPS is working
Ensure the GPS has a signal lock and the green PPS LED on the Uputronics Pi+ GPS Expansion Board is blinking once per second.
Output should be similar to:
Output should be similar to:
If you see “Connection timed out,” the GPS may not have a solid signal or the board may not be properly set on the Pi. This tripped me up for a while.
Set up GPSD
Edit gpsd config
This took a while to figure out. The pi version assumes a USB GPS device will be attached, so we have to disable USB auto config and define the serial device in the config file.
You should see GPS info populated: Time, lat, lon, grid square, etc.
Reboot for good measure and run cgps -s again.
Setting up the local web server and gpsd script
Install apache web server which will read GPS info and feed the APRS script
Install PHP which will run our APRS script
Install gpsd script that feeds GPS info to APRS script
Rename gpsd script
Execute gpsd script
If successful, you should see a bunch of HTML in the console and navigating to http://localhost/gpsd.php?op=json in your Pi's web browser should produce a bunch of plaintext looking GPS information.
On line 100, change the 2000 value to 4000.
Install AFSK software modem
This is a Python librarythat generates Bell 202 AFSK audio samples and AFSK encoded APRS/AX.25 packets.
If you get a "TypeError: unsupported operand type(s) for -=: 'Retry' and 'int'", try rebooting and run sudo pip install afsk one more time.
Set your Pi's output audio to 60.
Press the 'up' key on your keyboard until you get to 60. Press 'esc.'
Force audio output through 3.5mm jack, not HDMI
Choose "Advanced Options"
Choose "A4 Audio"
Choose option 1
Install main APRS script
Download main beacon script from Github
Edit the script and add your callsign to line 13
Test run the script
You can ignore any "PHP Notice" messages. You'll see lat lon info on the screen. If the GPS board is unable to pick up a signal, you'll see "No GPS data is available."
When a GPS signal is acquired, you should see "Transmitting beacon" and "Playing WAV."
At that point you should see a "packet.wav" file show up in your home directory. That's another confirmation the script is working.
If you plug the Pi's audio into a speaker, you should hear the APRS/AFSK modem sounds.
For the HT, I plug the audio cable into the mic port and turn on VOX. Your HT should then transmit your position!
Next steps: Starting the beacon script on boot.