Skip to content

Commit

Permalink
Merge pull request #860 from argilo/remove-habitat
Browse files Browse the repository at this point in the history
Remove unused Habitat code
  • Loading branch information
darksidelemm authored Jan 31, 2024
2 parents 468712e + 765947c commit 8e20b72
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 949 deletions.
25 changes: 0 additions & 25 deletions auto_rx/auto_rx.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
from autorx.decode import SondeDecoder, VALID_SONDE_TYPES, DRIFTY_SONDE_TYPES
from autorx.logger import TelemetryLogger
from autorx.email_notification import EmailNotification
from autorx.habitat import HabitatUploader
from autorx.aprs import APRSUploader
from autorx.ozimux import OziUploader
from autorx.sondehub import SondehubUploader
Expand Down Expand Up @@ -933,30 +932,6 @@ def main():
exporter_objects.append(_email_notification)
exporter_functions.append(_email_notification.add)

# Habitat Uploader - DEPRECATED - Sondehub DB now in use (>1.5.0)
# if config["habitat_enabled"]:

# if config["habitat_upload_listener_position"] is False:
# _habitat_station_position = None
# else:
# _habitat_station_position = (
# config["station_lat"],
# config["station_lon"],
# config["station_alt"],
# )

# _habitat = HabitatUploader(
# user_callsign=config["habitat_uploader_callsign"],
# user_antenna=config["habitat_uploader_antenna"],
# station_position=_habitat_station_position,
# synchronous_upload_time=config["habitat_upload_rate"],
# callsign_validity_threshold=config["payload_id_valid"],
# url=config["habitat_url"],
# )

# exporter_objects.append(_habitat)
# exporter_functions.append(_habitat.add)

# APRS Uploader
if config["aprs_enabled"]:

Expand Down
35 changes: 3 additions & 32 deletions auto_rx/autorx/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,10 @@
# Web interface credentials
web_password = "none"

# Fixed minimum update rates for APRS & Habitat
# These are set to avoid congestion on the APRS-IS network, and on the Habitat server
# Please respect other users of these networks and leave these settings as they are.
# Fixed minimum update rate for APRS
# This is set to avoid congestion on the APRS-IS network
# Please respect other users of the network and leave this setting as it is.
MINIMUM_APRS_UPDATE_RATE = 30
MINIMUM_HABITAT_UPDATE_RATE = 30


def read_auto_rx_config(filename, no_sdr_test=False):
Expand Down Expand Up @@ -98,12 +97,9 @@ def read_auto_rx_config(filename, no_sdr_test=False):
"radius_temporary_block": False,
# "sonde_time_threshold": 3, # Commented out to ensure warning message is shown.
# Habitat Settings
"habitat_enabled": False,
"habitat_upload_rate": 30,
"habitat_uploader_callsign": "SONDE_AUTO_RX",
"habitat_uploader_antenna": "1/4-wave",
"habitat_upload_listener_position": False,
"habitat_payload_callsign": "<id>",
# APRS Settings
"aprs_enabled": False,
"aprs_upload_rate": 30,
Expand Down Expand Up @@ -166,12 +162,6 @@ def read_auto_rx_config(filename, no_sdr_test=False):
"save_system_log": False,
"enable_debug_logging": False,
"save_cal_data": False,
# URL for the Habitat DB Server.
# As of July 2018 we send via sondehub.org, which will allow us to eventually transition away
# from using the habhub.org tracker, and leave it for use by High-Altitude Balloon Hobbyists.
# For now, sondehub.org just acts as a proxy to habhub.org.
# This setting is not exposed to users as it's only used for unit/int testing
"habitat_url": "https://habitat.sondehub.org/",
# New Sondehub DB Settings
"sondehub_enabled": True,
"sondehub_upload_rate": 30,
Expand Down Expand Up @@ -298,12 +288,6 @@ def read_auto_rx_config(filename, no_sdr_test=False):
auto_rx_config["max_altitude"] = config.getint("filtering", "max_altitude")
auto_rx_config["max_radius_km"] = config.getint("filtering", "max_radius_km")

# Habitat Settings
# Deprecated from v1.5.0
# auto_rx_config["habitat_enabled"] = config.getboolean(
# "habitat", "habitat_enabled"
# )
# auto_rx_config["habitat_upload_rate"] = config.getint("habitat", "upload_rate")
auto_rx_config["habitat_uploader_callsign"] = config.get(
"habitat", "uploader_callsign"
)
Expand All @@ -314,19 +298,6 @@ def read_auto_rx_config(filename, no_sdr_test=False):
"habitat", "uploader_antenna"
).strip()

# try: # Use the default configuration if not found
# auto_rx_config["habitat_url"] = config.get("habitat", "url")
# except:
# pass

# Deprecated from v1.5.0
# if auto_rx_config["habitat_upload_rate"] < MINIMUM_HABITAT_UPDATE_RATE:
# logging.warning(
# "Config - Habitat Update Rate clipped to minimum of %d seconds. Please be respectful of other users of Habitat."
# % MINIMUM_HABITAT_UPDATE_RATE
# )
# auto_rx_config["habitat_upload_rate"] = MINIMUM_HABITAT_UPDATE_RATE

# APRS Settings
auto_rx_config["aprs_enabled"] = config.getboolean("aprs", "aprs_enabled")
auto_rx_config["aprs_upload_rate"] = config.getint("aprs", "upload_rate")
Expand Down
7 changes: 2 additions & 5 deletions auto_rx/autorx/decode.py
Original file line number Diff line number Diff line change
Expand Up @@ -1871,7 +1871,6 @@ def running(self):
if __name__ == "__main__":
# Test script.
from .logger import TelemetryLogger
from .habitat import HabitatUploader

logging.basicConfig(
format="%(asctime)s %(levelname)s:%(message)s", level=logging.DEBUG
Expand All @@ -1883,22 +1882,21 @@ def running(self):
urllib3_log.setLevel(logging.CRITICAL)

_log = TelemetryLogger(log_directory="./testlog/")
_habitat = HabitatUploader(user_callsign="VK5QI_AUTO_RX_DEV", inhibit=False)

try:
_decoder = SondeDecoder(
sonde_freq=401.5 * 1e6,
sonde_type="RS41",
timeout=50,
rtl_device_idx="00000002",
exporter=[_habitat.add, _log.add],
exporter=[_log.add],
)

# _decoder2 = SondeDecoder(sonde_freq = 405.5*1e6,
# sonde_type = "RS41",
# timeout = 50,
# rtl_device_idx="00000001",
# exporter=[_habitat.add, _log.add])
# exporter=[_log.add])

while True:
time.sleep(5)
Expand All @@ -1911,5 +1909,4 @@ def running(self):
traceback.print_exc()
pass

_habitat.close()
_log.close()
Loading

0 comments on commit 8e20b72

Please sign in to comment.