marcel
b4f4fc351f
|
12 months ago | |
---|---|---|
python-ax25 | 1 year ago | |
CHANGELOG.md | 12 months ago | |
README.md | 1 year ago | |
aprs_telemetry_to_mqtt.py | 12 months ago | |
aprs_telemetry_to_mqtt.yml | 1 year ago | |
impression.odg | 1 year ago | |
impression.png | 1 year ago | |
impression.svg | 1 year ago | |
impression2.png | 1 year ago |
README.md
APRS telemetry to MQTT bridge
The APRS telemetry to MQTT bridge can relay PE1RXF telemetry to an MQTT broker.
This program is a utility for the APRS telemetry system used by PE1RXF. The telemetry is embedded in an APRS message which can travel over the existing APRS network. For more information about this open protocol visit this link: https://www.meezenest.nl/mees-elektronica/projects/aprs_telemetry/APRS_protocol_nodes_PE1RXF.pdf
An APRS node (can be anything that can send standard APRS messages) sends telemetry data to an APRS digipeater (Linux computer with AX.25 stack and suitable transceiver). This Python program filters out any valid telemetry (as defined in a YAML file) and forwards it to the specified MQTT broker. From there the possibilities are endless.
Example of an APRS node sending data to Grafana
Configuration
The program is configured via a YAML file. The global section defines the MQTT broker to which to publish the data.
The topic section specifies the telemetry nodes to listen to. The descriptions of the fields are defined here as well.
# Global settings apply to all other entries
global:
broker: pe1rxf.ampr.org # The MQTT broker we are going to use
port: 1883 # The tcp port of the MQTT broker
topic_root: hamnet_aprs_nodes # MQTT topic root
poll_rate: 300 # Number of second between polling
topics:
# MQTT topic: each telemtry node has its own name (sub root) and must be unique
- name: solar_generator
# telemetry_file is obsolete. Use call instead.
#telemetry_file: /home/marcel/ham/aprs_utils/aprs_log/latest_telemetry_PE1RXF-9.dat
# Call of the telemetry node
call: PE1RXF-9
# AX.25 port to listen on (all for all ports)
ax_port: all
# Defines the names of the values in the telemetry data. These names are used to publish to the MQTT broker.
# Make sure the number of descriptions match the number of values in the telemetry data!
description:
- soc
- voltage
- power
- temperature
Usage
The program can only be run as root, due to the contrains of pyax25. Add aprs_telemetry_to_mqtt.py to /etc/sudoers by editing it via visudo so it can start with sudo at boot time without the need to enter a password. Example of line to add:
user ALL = (root) NOPASSWD: /home/user/ham/aprs_utils/aprs_telemetry_to_mqtt/aprs_telemetry_to_mqtt.py
Requirements
- Python3
- pathlib
- yaml
- paho-mqtt
- Python AX.25 Module for Python3 (https://github.com/ha5di/pyax25 - also supplied with the source of this program)
- Linux AX.25 stack enabled