Warning
Legal operation of this software requires an amateur radio license and a valid call sign.
Note
Star this repo to follow our progress! This code is under active development, and contributions are both welcomed and appreciated. See CONTRIBUTING.md for details.
The APRSD MQTT Plugin publishes APRS packets to an MQTT broker, allowing you to integrate APRSD with MQTT-based systems. Key features include:
- MQTT Publishing: Automatically publishes all received APRS packets to a configured MQTT topic
- JSON Format: Packets are published as JSON for easy consumption by other systems
- Configurable Broker: Connect to any MQTT broker (local or remote)
- Authentication Support: Optional username/password authentication for MQTT broker
- Real-time Integration: Enables real-time APRS data streaming to MQTT subscribers
aprsd >= 3.0.0- A running APRSD instance
- Access to an MQTT broker (Mosquitto, HiveMQ, EMQX, etc.)
You can install APRSD MQTT Plugin via pip from PyPI:
$ pip install aprsd-mqtt-pluginOr using uv:
$ uv pip install aprsd-mqtt-pluginBefore using the MQTT plugin, you need to configure it in your APRSD configuration file. Generate a sample configuration file if you haven't already:
$ aprsd sample-configThis will create a configuration file at ~/.config/aprsd/aprsd.conf (or aprsd.yml).
Add the following section to your APRSD configuration file to configure the MQTT plugin:
[aprsd_mqtt_plugin]
# Enable the MQTT plugin (default: False)
enabled = True
# MQTT broker hostname or IP address (required)
host_ip = localhost
# MQTT broker port (default: 1883)
host_port = 1883
# MQTT topic to publish packets to (default: aprsd/packets)
topic = aprsd/packets
# Optional: MQTT username for authentication
user =
# Optional: MQTT password for authentication
password =Here's a complete example configuration:
[aprsd_mqtt_plugin]
enabled = True
host_ip = mqtt.example.com
host_port = 1883
topic = aprsd/packets
user = mqtt_user
password = mqtt_passwordTo enable the plugin, add it to the enabled_plugins section of your APRSD configuration:
[aprsd]
enabled_plugins = aprsd_mqtt_plugin.aprsd_mqtt_plugin.MQTTPluginOnce installed and configured, the MQTT plugin will automatically start when you run aprsd server.
The plugin:
- Connects to the configured MQTT broker on startup
- Subscribes to the configured topic
- Publishes all received APRS packets as JSON to the MQTT topic
- Maintains a persistent connection to the broker
Packets are published as JSON with the following structure:
{
"from": "CALLSIGN",
"to": "DESTINATION",
"message_text": "Message content",
"path": ["WIDE1-1", "WIDE2-2"],
"timestamp": "2024-01-01T12:00:00"
}Note: Additional fields may be present in the JSON payload.
After starting APRSD, check the logs for messages like:
INFO: Connecting to mqtt://localhost:1883
INFO: Connected to mqtt://localhost:1883/aprsd/packets (0)
You can also subscribe to the MQTT topic using an MQTT client:
$ mosquitto_sub -h localhost -t aprsd/packetsOr using mqtt-cli:
$ mqtt sub -t aprsd/packetsHome Assistant Integration:
mqtt:
sensor:
- name: "APRS Packet"
state_topic: "aprsd/packets"
value_template: "{{ value_json.message_text }}"Node-RED Integration:
Connect an MQTT input node to aprsd/packets and parse the JSON payload.
Custom Application:
Subscribe to the MQTT topic and process the JSON packets in your application.
For more details, see the Command-line Reference.
Contributions are very welcome. To learn more, see the Contributor Guide.
Distributed under the terms of the Apache Software License 2.0 license, APRSD MQTT Plugin is free and open source software.
If you encounter any problems, please file an issue along with a detailed description.
This project was generated from @hemna's APRSD Plugin Python Cookiecutter template.