diff --git a/auto_rx/auto_rx.py b/auto_rx/auto_rx.py index d9442ed..901550f 100644 --- a/auto_rx/auto_rx.py +++ b/auto_rx/auto_rx.py @@ -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"], diff --git a/auto_rx/autorx/config.py b/auto_rx/autorx/config.py index 6502e13..37e3093 100644 --- a/auto_rx/autorx/config.py +++ b/auto_rx/autorx/config.py @@ -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": "", "ozi_port": 55681, "payload_summary_enabled": False, + "payload_summary_host": "", "payload_summary_port": 55672, # Debugging settings "save_detection_audio": False, diff --git a/auto_rx/autorx/ozimux.py b/auto_rx/autorx/ozimux.py index db841bd..4832946 100644 --- a/auto_rx/autorx/ozimux.py +++ b/auto_rx/autorx/ozimux.py @@ -48,7 +48,9 @@ class OziUploader(object): def __init__( self, + ozimux_host="", ozimux_port=None, + payload_summary_host="", 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"), ("", 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"), - ("", 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. diff --git a/auto_rx/station.cfg.example b/auto_rx/station.cfg.example index d7177ef..07d9c26 100644 --- a/auto_rx/station.cfg.example +++ b/auto_rx/station.cfg.example @@ -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 = + +# 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 = 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 \ No newline at end of file +sonde_time_threshold = 3 diff --git a/auto_rx/station.cfg.example.network b/auto_rx/station.cfg.example.network index c02b4d6..e5d7461 100644 --- a/auto_rx/station.cfg.example.network +++ b/auto_rx/station.cfg.example.network @@ -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 = + +# 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 = 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 \ No newline at end of file +sonde_time_threshold = 3