# 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

## Configuration

This first version reads the telemetry files as generated by APRS server software. This software can be found here: https://git.meezenest.nl/marcel/pe1rxf-aprs-server

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 files to read. 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

topics:
    # MQTT topic: each telemtry node has its own name (sub root) and must be unique
    - name: solar_generator
      telemetry_file: /home/marcel/ham/aprs_utils/aprs_log/latest_telemetry_PE1RXF-9.dat
      description:
        - percentage
        - voltage
        - power
        - temperature

```
The configuration entry 'global:retry' sets the amount of APRS message retries we attempt before giving up. The configuration entry 'global:transmit_rate' sets the time between retries.

When a node is added to the poll: call: entry its status will be polled on a regular base. The poll rate is set in the global entry. This is the poll interval between every transmision. When three nodes are defined, a node is polled every 3*poll_rate seconds.

## Requirements

- Python3
- Python AX.25 Module for Python3 (https://github.com/ha5di/pyax25)
- pathlib
- yaml
- paho-mqtt
- Linux AX.25 stack

