Skip to main content

Ship weather data from Ambient Weather API to APRS-IS/aprs.fi

Project description

Ambient-WDS (Weather Data Shipper)

A lightweight Python tool to query data from Ambient Weather's API, convert it, and upload it to APRS.fi. by Jake Barbieur, N9DMT ambient-wds-logo

Overview

This project started as a proof of concept for W9PVR, a ham radio club that recently voted to install a weather station at our D-Star site. While Ambient Weather provides HTML widgets for displaying data on websites, some club members wanted the data sent to aprs.fi, which is widely used in the amateur radio community.

ambient-wds is designed to:

  • Query data from the Ambient Weather API
  • Format the data appropriately for APRS weather packets
  • Upload the packets to APRS.fi in real time

It's a simple, configurable, and lightweight tool, ideal for hams who want their station data online once the station is installed.

Setup

To get started with ambient-wds, make sure you have the following:

1. Ambient Weather Station

This tool has been tested with the WS-2902. Other Ambient Weather models may work but are untested.

Installation Requirements:

  • Follow the Ambient Weather Network setup instructions to properly configure and register your station.
  • Ensure your station is powered on and connected to the internet.
  • Create an account on the Ambient Weather Network to access your station's data online.
  • Set a location for your station. These instructions go through that process.

2. Python Environment

Ensure you have Python 3.10 or higher installed. You can download it from python.org.

3. Install ambient-wds

Install the package via pip:

pip install ambient-wds

Usage

Once you have installed ambient-wds and configured your station and keys, you can run the tool from the command line:

ambient-wds [parameters]

Interactive Setup (Recommended)

To generate a configuration file in your home directory (~/ambient-wds/config.yaml) and set up your keys and callsign:

ambient-wds --setup

  • The tool will prompt you for your Ambient Weather APP_KEY and API_KEY, your APRS CALLSIGN, SSID, server, and other optional parameters.

  • Press Enter to accept the default values for each prompt.

  • If a configuration file already exists, you will be prompted before overwriting it.

Obtaining an APRS Passcode

To obtain an APRS passcode, go to https://apps.magicbug.co.uk/passcode/, and enter your callsign.

Obtaining an App Key and API Key

To obtain your Ambient Weather App and API keys, log into your Ambient Weather account and navigate to https://ambientweather.net/account/keys. From there you can create both an API key and an APP key. They are both necessary.

Running ambient-wds

After setup, start polling your weather station and sending data to APRS:

ambient-wds

You can override any configuration value using command-line options:

ambient-wds --poll-seconds 400

Running Continuously

ambient-wds is designed to run continuously and poll your weather station at the interval you specify (default: every 300 seconds).

For uninterrupted operation, you can run it in a background terminal, or set it up using your operating system's method for persistent tasks (e.g., systemd, launchd, Task Scheduler). The tool is intended to be fully cross-platform.

Configuration File

By default, ambient-wds reads a YAML configuration file at ~/ambient-wds/config.yaml. All parameters in the file can be overridden via environment variables or command-line options.

Example config.yaml:

APP_KEY: your_app_key_here
API_KEY: your_api_key_here
CALLSIGN: N9DMT
SSID: 13
APRS_PASSCODE: 12345
APRS_SERVER: noam.aprs2.net
APRS_PORT: 14580
POLL_SECONDS: 300

Parameters

This tool supports configuration from four sources, checked in the following priority order:

  1. Command-line options — Passed with --kebab-case flags (e.g., --app-key my_app_key).
  2. Environment variables — Uppercase snake case (e.g., APP_KEY=my_app_key).
  3. YAML config file (config.yaml) — Keys in uppercase snake case (e.g., APP_KEY: my_app_key).
  4. Default value (see table)

If a parameter is provided in multiple places, the command-line option will override the environment variable, which will override the YAML config file.

Parameter CLI Option Environment Variable YAML Config Key Default Value Description
API_KEY --api-key API_KEY API_KEY Your API key for accessing Ambient Weather's API.
APP_KEY --app-key APP_KEY APP_KEY Your application key for accessing Ambient Weather's API.
APRS_PASSCODE --aprs-passcode APRS_PASSCODE APRS_PASSCODE The APRS passcode for your callsign.
APRS_SERVER --aprs-server APRS_SERVER APRS_SERVER noam.aprs2.net The APRS server to connect to (e.g., noam.aprs2.net).
APRS_PORT --aprs-port APRS_PORT APRS_PORT 14580 The port number for the APRS server (e.g., 14580).
CALLSIGN --callsign CALLSIGN CALLSIGN Your APRS callsign.
SSID --ssid SSID SSID 13 The SSID (Secondary Station Identifier) for your APRS station.
POLL_SECONDS --poll-seconds POLL_SECONDS POLL_SECONDS 300 The interval (in seconds) for polling data from the API.
CONFIG_FILE --config-file CONFIG_FILE N/A config.yaml Path to the YAML config file.

License

This project is licensed under the MIT License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ambient_wds-0.2.2.tar.gz (6.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ambient_wds-0.2.2-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

Details for the file ambient_wds-0.2.2.tar.gz.

File metadata

  • Download URL: ambient_wds-0.2.2.tar.gz
  • Upload date:
  • Size: 6.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.13

File hashes

Hashes for ambient_wds-0.2.2.tar.gz
Algorithm Hash digest
SHA256 d4558a8382fd6073a4dbe86f664234c159c70d6182a5916afe005578b420ff50
MD5 275c27e8d27338fcab62a4f7c56e85a1
BLAKE2b-256 754cf0a0232fd6189973d696faa9d4ae8fad3717aa846d759b4db719adccca78

See more details on using hashes here.

File details

Details for the file ambient_wds-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: ambient_wds-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 7.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.13

File hashes

Hashes for ambient_wds-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 6aa8b63780f7e44f24d8ed728071a259f1e50cacdb41e3ab910687501ee3d7fd
MD5 f9ab2e067d774f1cc9b042598eb5ed8d
BLAKE2b-256 eed2f2fe058b113c638503b619e9c5b551ad4d2b39f4be3190bf76ab4bb83e36

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page