Dump1090toMQTT is a Python script that monitors data from a dump1090 server, which provides information about airplanes, and publishes this data to an MQTT broker for further processing. The script can be run as a service, continuously collecting data and publishing it to the MQTT broker.
- Monitors data from a dump1090 server.
- Publishes airplane data to an MQTT broker.
- Can be run as a service for continuous monitoring.
- Python 3.x
- paho-mqtt library (
pip install paho-mqtt
)
The configuration for the script is stored in a config.ini
file. This file contains the following sections:
host
: The IP address of the dump1090 server.port
: The port number of the dump1090 server.
host
: The IP address of the MQTT broker.port
: The port number of the MQTT broker.
Example config.ini
:
[dump1090]
host = 172.25.164.232
port = 30003
[mqtt]
host = 172.25.96.250
port = 1883
-
Install the required dependencies:
pip install paho-mqtt
-
Configure the
config.ini
file with the appropriate IP addresses and port numbers. -
Run the script:
python Dump1090toMQTT.py
The script will connect to the dump1090 server, collect airplane data, and publish it to the MQTT broker.
To run the script as a service, follow these steps:
-
Create a systemd service unit file named
dump1090tomqtt.service
:[Unit] Description=Dump1090toMQTT Service After=network.target [Service] Type=simple User=your_username WorkingDirectory=/path/to/your/script/directory ExecStart=/usr/bin/python3 /path/to/your/Dump1090toMQTT.py Restart=always [Install] WantedBy=multi-user.target
Replace
your_username
with your username and/path/to/your/script
with the actual path where your Python script is located. -
Save the file and reload the systemd manager configuration:
sudo systemctl daemon-reload
-
Start and enable the service:
sudo systemctl start dump1090tomqtt sudo systemctl enable dump1090tomqtt
Now your script will run as a service and automatically start whenever your system boots up.