APRS Weather Reporting By Hand

You can use aprs-weather-submit to share weather data without a smart weather station.

Written .
Updated with Linux install instructions.

Backstory

Ever since I got my amateur radio license back in , I've taken an interest in APRS, the Automatic Packet Reporting System, which allows hams to use a radio or an Internet connection to share useful data on a map, such as location tracking and weather data. However, I don't have a fancy weather station that can automatically upload data. Why should weather station owners or builders have all the fun? I set out to change that.

I already had the app PocketPacket on my phone, which can connect to the APRS network via a radio or via APRS-IS. The latter method connects to a server called an IGate and uploads its data there, and I saw PocketPacket came with a list of APRS-IS servers. Once I authenticated my callsign, I got a username and password, and was ready to start uploading data.

I'm going to tell the story of how I wrote this app. If you're just looking for directions on how to use it, scroll to the end of this article, or read its man page.

Writing the App

First, I needed to learn how to make an APRS packet. Between looking at raw packets on APRS.fi, reading the official APRS specification and its addenda (1.1 and 1.2), and some example Python code that I came across, I figured it out and created a mock-up in PHP.

However, I decided to make the final app a command-line app in the C programming language, so that it could run on almost anything with as few dependencies as possible, in case I should ever build my own weather station with an Arduino or Raspberry Pi. (Plus, I wanted to shake off some of my rust, having not touched since college.)

I spent some time rediscovering old friends such as Xcode, strncat(), and sprintf(). The very first version of this app could only create the APRS packet and print it on the screen, which I pasted into raw PHP code which I then pasted into a terminal (php -i). Once I saw my weather reports showing up on the map, the hard part was learning sockets programming. Before long, it was complete.

The following pieces of weather data are defined in APRS 1.2.1, all of which I was able to support in my app:

  • Barometric pressure
  • Humidity
  • Luminosity (how strong the sunshine is)
  • Radiation
  • Rainfall (in the last hour, last 24 hours, and since midnight)
  • Snowfall (in the last 24 hours)
  • Temperature
  • Weather station battery voltage
  • Wind speed, gust speed, and direction

Examples

I looked at my "dumb" thermometer and saw it was 32°F outside. My "dumb" rain gauge was as dry as my snow shovel, as both have been for a few days. I reported both pieces of weather data with the following command:

$ aprs-weather-submit
	--callsign W1DNS                       # my call sign
	--latitude 41.1234 --longitude -73.5678 # my location
	--server igate.example.com --port 12345 # IGate connection info
	--username colin --password secret      # IGate authentication
	--temperature 32                        # current temperature (°F)
	--rainfall-since-midnight 0             # my rain gauge is empty
	--rainfall-last-hour 0                  # it's dry
	--rainfall-last-24-hours 0              # it's been dry
	--snowfall-last-24-hours 0              # it also hasn't snowed

And that's it!

Get the App

If you use a Debian-based Linux distribution (such as Ubuntu), I now have a PPA available on Launchpad. To add it to your system and install aprs-weather-submit, do this:

$ sudo add-apt-repository ppa:signofzeta/aprs-weather-submit
$ sudo apt install aprs-weather-submit
Install my app using a PPA. This way, it gets updated automatically. If you're using another Debian-based distribution, click the link above to find the deb and deb-src URLs.

You can download or contribute to the code of aprs-weather-submit on GitHub. It compiles on , , and MS-DOS (the latter with some features disabled). A future version might support Windows.

73 and thanks for reading.

Links

This article:
https://colincogle.name/aprswx
APRS.fi
https://aprs.fi
Automatic Position Reporting System (APRS) Protocol Reference Version 1.0.1
http://aprs.org/doc/APRS101.PDF
APRS Spec 1.1 Addendum
http://aprs.org/aprs11.html
APRS Spec Addendum 1.2 Proposals
http://aprs.org/aprs12.html
APRS Version 1.2.1 Weather Updates to the Spec
http://aprs.org/aprs12/weather-new.txt
aprs-weather-submit on GitHub
https://github.com/rhymeswithmogul/aprs-weather-submit
aprs-weather-submit on Launchpad
https://launchpad.net/~signofzeta/+archive/ubuntu/aprs-weather-submit