From 50d7e18bed5645579c9eed2ab2ec378e1a08a2da Mon Sep 17 00:00:00 2001 From: Mark Jessop Date: Sun, 18 Dec 2022 17:14:22 +1030 Subject: [PATCH] Disable habitat uploader, add warning when uploading 4FSKTEST telemetry --- horusdemodlib/__init__.py | 2 +- horusdemodlib/sondehubamateur.py | 12 +++++++++++- horusdemodlib/uploader.py | 27 ++++++++++++++------------- pyproject.toml | 2 +- user.cfg.example | 3 +-- 5 files changed, 28 insertions(+), 18 deletions(-) diff --git a/horusdemodlib/__init__.py b/horusdemodlib/__init__.py index 771bc6e..aa4cd15 100755 --- a/horusdemodlib/__init__.py +++ b/horusdemodlib/__init__.py @@ -1 +1 @@ -__version__ = "0.3.9" +__version__ = "0.3.10" diff --git a/horusdemodlib/sondehubamateur.py b/horusdemodlib/sondehubamateur.py index f342394..38938e4 100644 --- a/horusdemodlib/sondehubamateur.py +++ b/horusdemodlib/sondehubamateur.py @@ -169,7 +169,10 @@ class SondehubAmateurUploader(object): if telemetry["callsign"] == "UNKNOWN_PAYLOAD_ID": self.log_error("Not uploading telemetry from unknown payload ID. Is your payload ID list old?") return None - + + if '4FSKTEST' in telemetry['callsign']: + self.log_warning(f"Payload ID {telemetry['callsign']} is for testing purposes only, and should not be used on an actual flight. Refer here: https://github.com/projecthorus/horusdemodlib/wiki#how-do-i-transmit-it") + _output['payload_callsign'] = telemetry["callsign"] # Frame Number @@ -456,6 +459,13 @@ class SondehubAmateurUploader(object): """ logging.error("Sondehub Amateur Uploader - %s" % line) + def log_warning(self, line): + """ Helper function to log a warning message with a descriptive heading. + Args: + line (str): Message to be logged. + """ + logging.warning("Sondehub Amateur Uploader - %s" % line) + if __name__ == "__main__": # Test Script diff --git a/horusdemodlib/uploader.py b/horusdemodlib/uploader.py index 31eae93..2e03103 100644 --- a/horusdemodlib/uploader.py +++ b/horusdemodlib/uploader.py @@ -121,14 +121,15 @@ def main(): else: _listener_freq_str = "" - habitat_uploader = HabitatUploader( - user_callsign = user_config['user_call'], - listener_lat = user_config['station_lat'], - listener_lon = user_config['station_lon'], - listener_radio = user_config['radio_comment'] + _listener_freq_str, - listener_antenna = user_config['antenna_comment'], - inhibit=args.noupload - ) + # Habitat uploader disabled as of 2022-12-18 + # habitat_uploader = HabitatUploader( + # user_callsign = user_config['user_call'], + # listener_lat = user_config['station_lat'], + # listener_lon = user_config['station_lon'], + # listener_radio = user_config['radio_comment'] + _listener_freq_str, + # listener_antenna = user_config['antenna_comment'], + # inhibit=args.noupload + # ) if user_config['station_lat'] == 0.0 and user_config['station_lon'] == 0.0: _sondehub_user_pos = None @@ -183,7 +184,7 @@ def main(): # Add in frequency estimate, if we have been supplied a receiver frequency. if args.freq_hz: _decoded['f_centre'] = int(demod_stats.fest_mean) + int(args.freq_hz) - habitat_uploader.last_freq_hz = _decoded['f_centre'] + #habitat_uploader.last_freq_hz = _decoded['f_centre'] # Add in baud rate, if provided. if args.baud_rate: @@ -193,8 +194,8 @@ def main(): send_payload_summary(_decoded, port=user_config['summary_port']) # Upload the string to Habitat - _decoded_str = "$$" + data.split('$')[-1] + '\n' - habitat_uploader.add(_decoded_str) + #_decoded_str = "$$" + data.split('$')[-1] + '\n' + #habitat_uploader.add(_decoded_str) # Upload the string to Sondehub Amateur sondehub_uploader.add(_decoded) @@ -232,7 +233,7 @@ def main(): # Add in frequency estimate, if we have been supplied a receiver frequency. if args.freq_hz: _decoded['f_centre'] = int(demod_stats.fest_mean) + int(args.freq_hz) - habitat_uploader.last_freq_hz = _decoded['f_centre'] + #habitat_uploader.last_freq_hz = _decoded['f_centre'] # Add in baud rate, if provided. if args.baud_rate: @@ -258,7 +259,7 @@ def main(): except KeyboardInterrupt: logging.info("Caught CTRL-C, exiting.") - habitat_uploader.close() + #habitat_uploader.close() sondehub_uploader.close() if __name__ == "__main__": diff --git a/pyproject.toml b/pyproject.toml index 0ed422c..df79e97 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "horusdemodlib" -version = "0.3.9" +version = "0.3.10" description = "Project Horus HAB Telemetry Demodulators" authors = ["Mark Jessop"] license = "LGPL-2.1-or-later" diff --git a/user.cfg.example b/user.cfg.example index 25067db..0be2858 100644 --- a/user.cfg.example +++ b/user.cfg.example @@ -3,8 +3,7 @@ # [user] -# Your callsign - used when uploading to the HabHub Tracker. -# Note that we now also upload to the experimental SondeHub Amateur DB as well by default. +# Your callsign - used when uploading to the SondeHub-Amateur Tracker callsign = YOUR_CALL_HERE # Your station latitude/longitude, which will show up on tracker.habhub.org.