by Bill Mitchell, AE0EE
APRSDB is a set of programs and code that work together to provide a way to store APRS data. Analysis of this data can provide insight on radio propagation, network traffic, and identify potential problems in digipeater configuration.
This project was inspired by NG0E's VHF Propagation website, which uses APRS-IS data. Unlike that system, APRSDB uses only local data, and is designed to be fully independent of the internet. Furthermore, it analyzes all the packets it reeceives, where APRS-IS seems to remove duplicates---throwing out perfectly good data.
At this time APRSDB takes some work to set up and is only operational on Linux. I am not prepared to support other operating systems, but all the tools are cross-platform so it should be feasible.
This platform is split into two major parts: the collection/database back-end, and the yet-to-be-released web front-end (aprs-moose). These two parts are split because it should make keeping things updated easier. For now, most GIS software should be able to interact with the data; QGIS certainly can. Common queries have been saved as views for easy access.
How It Works
There are several steps involved in the storage, analysis, and display of APRS data. Different open-source programs are used for these steps.
- aprsdb (back-end) ** Direwolf (soundcard packet decoder) ** aprs-python (Python3-based APRS parser) ** aprsdb (Python3 code for database insertion) ** Postgres (database) with PostGIS extensions
If you are interested in more detailed spatial analysis, use a full GIS program, e.g. QGIS
Additional scripts, configuration files, and mapfiles provide a base from which to work without requiring expert knowledge of each of the programs in the stack.
The above programs need to be installed. On Debian-based systems try
sudo apt-get install postgres postgis qgis apache2 git
Get Direwolf and the Python dependencies
mkdir ~/Install cd ~/Install git clone https://github.com/wsmitchell3/aprs-python git clone https://github.com/wsmitchell3/aprsdb git clone https://github.com/wb2osz/direwolf sudo pip3 install ~/Install/aprs-python sudo pip3 install psycopg2
cd ~/Install/direwolf make sudo make install make install-conf cd ~
You will need to edit the installed direwolf configuration to add your callsign, etc.
Enable PostGIS (as a superuser), then create the users moose and radio. We will later restrict permissions for these users. If you want to customize the passwords for these accounts, edit the db_roles.sql file before running it.
$ sudo su postgres # createdb aprs # psql -d aprs -f /home/[user]/Install/aprsdb/enable_postgis.sql # psql -d aprs -f /home/[user]/Install/aprsdb/db_roles.sql # exit
Create the database tables, views, and indexes. The default password for the radio user is found in db_roles.sql
$ psql -d aprs -h 127.0.0.1 -p 5432 --user radio -f ~/Install/aprsd/aprsdb_creation.sql
Update (restrict) the moose access privileges (read-only) and grant the radio access privileges (write, but not DB admin) NOTE! This script is intended for use on a single-database system, and may well have adverse side-effects on other databases. Use with care.
$ sudo su postgres postgres$ psql -d aprs -f /home/[user]/Install/aprsdb/db_access_privs.sql postgres$ exit
Copy generic_aprsdb.conf to ~/aprsdb.conf, and update ~/aprsdb.conf with the appropriate Receive station info and any configuration customizations you made. If you don't want the config file in your home directory, it can be specified via the command line --config (-c) option.
Provide an audio input for direwolf. This can either be through an SDR or by hooking up a radio's output to the line-in of your soundcard. You will likely need to set this in the direwolf.conf file.
Start direwolf. I usually prefer to do this using the screen command, in a way that invokes direwolf then immediately detaches:
$ screen -S direwolf -d -m direwolf
You can get back to the screen with
$ screen -r direwolf
Once direwolf is running, we can use the kissutil program to give us the plaintext. This can be sent to a file for later processing, sent straight into the database, or both.
$ # Option 2: direct to database $ screen -S kissutil $ kissutil | python ~/Install/aprsdb/aprsdb.py
Text output from kissutil or other raw APRS text can be fed directly into the database:
$ cat [input] | python ~/Install/aprsdb/aprsdb.py