-- Leo's gemini proxy

-- Connecting to colincogle.name:1965...

-- Connected

-- Sending request

-- Meta line: 20 text/gemini; lang=en

Colin Cogle's Blog


"APRS Weather Reporting By Hand"


Written Tuesday, April 2, 2019.

Updated Sunday, December 10, 2023 with Linux install instructions.


Ever since I got my amateur radio license back in 2017, 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 (APRS Internet Service). 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.

APRS 1.01 Specification

APRS 1.1 Addendum

APRS 1.2 Addendum


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 C 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


Source:

APRS 1.2 New Weather Types


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 KC1HBK                       # my call sign
	--latitude 41.1234 --longitude -73.5678 # my location
	--server igate.example.com --port 12345 # IGate server info
	--username colin --password secret      # IGate authentication
	--temperature 32                        # the temperature (°F)
	--rainfall-since-midnight 0             # 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:

Ubuntu PPA: aprs-weather-submit by Colin Cogle


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

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

GitHub Repository


73 and thanks for reading.


=================================================================

Previous Blog: "A Kick in the Glass"

Next Blog: "Much Ado about Electrons" >>

=================================================================

"APRS Weather Reporting by Hand" by Colin Cogle is licensed under Creative Commons Attribution-ShareAlike 4.0 International (CC-BY-SA).

https://creativecommons.org/licenses/by-sa/4.0/?ref=chooser-v1

-- Response ended

-- Page fetched on Mon May 20 14:38:02 2024