feat: allow changing oziplotter and summary target host

pull/912/head
Luna Simons 2024-09-22 15:11:10 +02:00
rodzic 84d33599d0
commit b3d819af91
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: FAB9C1BCA0FED262
5 zmienionych plików z 38 dodań i 8 usunięć

Wyświetl plik

@ -971,18 +971,30 @@ def main():
# OziExplorer
if config["ozi_enabled"] or config["payload_summary_enabled"]:
if config["ozi_enabled"]:
if config["ozi_host"]:
_ozi_host = config["ozi_host"]
else:
_ozi_host = None
if config["ozi_port"]:
_ozi_port = config["ozi_port"]
else:
_ozi_port = None
if config["payload_summary_enabled"]:
if config["payload_summary_host"]:
_summary_host = config["payload_summary_host"]
else:
_summary_host = None
if config["payload_summary_port"]:
_summary_port = config["payload_summary_port"]
else:
_summary_port = None
_ozimux = OziUploader(
ozimux_host=_ozi_host,
ozimux_port=_ozi_port,
payload_summary_host=_summary_host,
payload_summary_port=_summary_port,
update_rate=config["ozi_update_rate"],
station=config["habitat_uploader_callsign"],

Wyświetl plik

@ -152,8 +152,10 @@ def read_auto_rx_config(filename, no_sdr_test=False):
# OziExplorer Settings
"ozi_enabled": False,
"ozi_update_rate": 5,
"ozi_host": "<broadcast>",
"ozi_port": 55681,
"payload_summary_enabled": False,
"payload_summary_host": "<broadcast>",
"payload_summary_port": 55672,
# Debugging settings
"save_detection_audio": False,

Wyświetl plik

@ -48,7 +48,9 @@ class OziUploader(object):
def __init__(
self,
ozimux_host="<broadcast>",
ozimux_port=None,
payload_summary_host="<broadcast>",
payload_summary_port=None,
update_rate=5,
station="auto_rx",
@ -56,12 +58,16 @@ class OziUploader(object):
""" Initialise an OziUploader Object.
Args:
ozimux_host (str): UDP host to push ozimux/oziplotter messages to.
ozimux_port (int): UDP port to push ozimux/oziplotter messages to. Set to None to disable.
payload_summary_host (str): UDP host to push payload summary messages to.
payload_summary_port (int): UDP port to push payload summary messages to. Set to None to disable.
update_rate (int): Time in seconds between updates.
"""
self.ozimux_host = ozimux_host
self.ozimux_port = ozimux_port
self.payload_summary_host = payload_summary_host
self.payload_summary_port = payload_summary_port
self.update_rate = update_rate
self.station = station
@ -106,7 +112,7 @@ class OziUploader(object):
try:
_ozisock.sendto(
_sentence.encode("ascii"), ("<broadcast>", self.ozimux_port)
_sentence.encode("ascii"), (self.ozimux_host, self.ozimux_port)
)
# Catch any socket errors, that may occur when attempting to send to a broadcast address
# when there is no network connected. In this case, re-try and send to localhost instead.
@ -184,7 +190,7 @@ class OziUploader(object):
try:
_s.sendto(
json.dumps(packet).encode("ascii"),
("<broadcast>", self.payload_summary_port),
(self.payload_summary_host, self.payload_summary_port),
)
# Catch any socket errors, that may occur when attempting to send to a broadcast address
# when there is no network connected. In this case, re-try and send to localhost instead.

Wyświetl plik

@ -341,7 +341,11 @@ ozi_update_rate = 5
# Note - this cannot be enabled in a multi-SDR configuration.
ozi_enabled = False
# OziMux UDP Broadcast output port.
# OziMux UDP target host.
# Defaults to broadcasting
ozi_host = <broadcast>
# OziMux UDP output port.
# Set to 8942 to send packets directly into OziPlotter, or set to 55681 to send via OziMux
ozi_port = 8942
@ -349,6 +353,7 @@ ozi_port = 8942
# Using this output allows multiple sondes to be plotted in Chasemapper.
# As of 2019-05, this is enabled by default.
payload_summary_enabled = True
payload_summary_host = <broadcast>
payload_summary_port = 55673
@ -640,4 +645,4 @@ radius_temporary_block = False
# Discard positions if the sonde's reported time is more than X hours from the system time.
# This helps catch glitches around 00Z UTC from iMet & LMS6 sondes, and bad CRC checks from
# DFM sondes.
sonde_time_threshold = 3
sonde_time_threshold = 3

Wyświetl plik

@ -342,7 +342,11 @@ ozi_update_rate = 5
# Note - this cannot be enabled in a multi-SDR configuration.
ozi_enabled = False
# OziMux UDP Broadcast output port.
# OziMux UDP target host.
# Defaults to broadcasting
ozi_host = <broadcast>
# OziMux UDP output port.
# Set to 8942 to send packets directly into OziPlotter, or set to 55681 to send via OziMux
ozi_port = 8942
@ -350,6 +354,7 @@ ozi_port = 8942
# Using this output allows multiple sondes to be plotted in Chasemapper.
# As of 2019-05, this is enabled by default.
payload_summary_enabled = True
payload_summary_host = <broadcast>
payload_summary_port = 55673
@ -639,4 +644,4 @@ radius_temporary_block = False
# Discard positions if the sonde's reported time is more than X hours from the system time.
# This helps catch glitches around 00Z UTC from iMet & LMS6 sondes, and bad CRC checks from
# DFM sondes.
sonde_time_threshold = 3
sonde_time_threshold = 3