APRSD Plugin for OpenWeatherMap APIs
Project description
Features
This plugin provides two APRSD plugins that use the OpenWeatherMap API:
WeatherPlugin - Returns current weather conditions based on GPS beacon location
TimePlugin - Returns current time in the timezone of the GPS beacon location
Both plugins use aprs.fi to look up the GPS coordinates of APRS stations, then use OpenWeatherMap to fetch weather and timezone information.
Requirements
APRSD server (version 4.2.0 or higher)
OpenWeatherMap API key (free tier available)
aprs.fi API key (for location lookup)
Installation
You can install APRSD Plugin for OpenWeatherMap APIs via pip from PyPI:
$ pip install aprsd-openweathermap-plugin
Configuration
Getting an OpenWeatherMap API Key
Visit https://home.openweathermap.org/users/sign_up to create a free account
Once logged in, navigate to https://home.openweathermap.org/api_keys
Generate a new API key (or use the default one provided)
The free tier includes 1,000 API calls per day, which is sufficient for most use cases
Note: It may take a few minutes for a newly created API key to become active.
Configuring the Plugin
Add the following to your APRSD configuration file (typically aprsd.conf):
[aprsd_openweathermap_plugin]
enabled = True
apiKey = YOUR_OPENWEATHERMAP_API_KEY_HERE
[aprs_fi]
apiKey = YOUR_APRS_FI_API_KEY_HERE
You can get an aprs.fi API key from https://aprs.fi/account/
Usage
Weather Plugin
The WeatherPlugin provides current weather conditions at the location of an APRS station’s GPS beacon.
Command Format: * w or weather - Get weather at your own location (based on your callsign’s last GPS beacon) * w CALLSIGN or weather CALLSIGN - Get weather at the specified callsign’s location
Example Usage:
Send a message to your APRSD server:
weather
Response:
clear sky 20.5C/15.2C Wind 10@180 65%
Or query weather for a specific station:
weather N0CALL
Response:
partly cloudy 22.0C/18.0C Wind 15@270G25 70%
The response includes: * Weather description (e.g., “clear sky”, “partly cloudy”) * Temperature and dew point in Celsius or Fahrenheit (based on configured units) * Wind speed, direction, and optional gust * Humidity percentage
Time Plugin
The TimePlugin provides the current time in the timezone of an APRS station’s GPS beacon location.
Command Format: * t or time - Get time at your own location * t CALLSIGN or time CALLSIGN - Get time at the specified callsign’s location
Example Usage:
Send a message to your APRSD server:
time
Response:
2024-01-15 14:30:00 PST
Or query time for a specific station:
time N0CALL
Response:
2024-01-15 16:30:00 EST
The plugin automatically determines the timezone based on the GPS coordinates and returns the local time. If OpenWeatherMap API is unavailable, it defaults to UTC time.
How It Works
Both plugins follow a similar workflow:
Extract the callsign from the message (or use the sender’s callsign if not specified)
Query aprs.fi API to get the GPS coordinates (latitude/longitude) of the callsign’s last beacon
Use the GPS coordinates to query OpenWeatherMap API for: * WeatherPlugin: Current weather conditions * TimePlugin: Timezone information
Format and return the results
The plugins require both APIs to be functional: * If aprs.fi lookup fails, the plugin returns “Failed to fetch location” * If OpenWeatherMap API fails, WeatherPlugin returns “Unable to get weather” * If OpenWeatherMap API fails, TimePlugin defaults to UTC timezone
Contributing
Contributions are very welcome. To learn more, see the Contributor Guide.
License
Distributed under the terms of the MIT license, APRSD Plugin for OpenWeatherMap APIs is free and open source software.
Issues
If you encounter any problems, please file an issue along with a detailed description.
Credits
This project was generated from @hemna’s APRSD Plugin Python Cookiecutter template.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file aprsd_openweathermap_plugin-1.0.0.tar.gz.
File metadata
- Download URL: aprsd_openweathermap_plugin-1.0.0.tar.gz
- Upload date:
- Size: 21.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e0a09502433e07eb32b69d8577ba7bbba98fe5dcb134f6c820e716773e9dc762
|
|
| MD5 |
8ce1b25bca74fde7adc546094226c639
|
|
| BLAKE2b-256 |
0880fa11cda53f5eb389dcf4f6d09cd4be89f491e1d4e6aa841f43d4743b72aa
|
File details
Details for the file aprsd_openweathermap_plugin-1.0.0-py3-none-any.whl.
File metadata
- Download URL: aprsd_openweathermap_plugin-1.0.0-py3-none-any.whl
- Upload date:
- Size: 11.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7ee7f79db4ad027f03f19dda0573cb187e44a4909077ff528820a2b20b09d4bf
|
|
| MD5 |
9d46ab7a779666a8fd666587f7ba0fd9
|
|
| BLAKE2b-256 |
12d075af607a106c58522a9bbc7d6c25ff82940dd138a932ecc62bed79314235
|