Skip to content

Commit

Permalink
Merge pull request #889 from projecthorus/testing
Browse files Browse the repository at this point in the history
1.7.3 Release
  • Loading branch information
darksidelemm authored Jun 16, 2024
2 parents 8583dff + 8a23b2d commit b8f4335
Show file tree
Hide file tree
Showing 43 changed files with 1,152 additions and 2,713 deletions.
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ auto_rx/fsk_demod
auto_rx/imet1rs_dft
auto_rx/iq_dec
auto_rx/lms6Xmod
auto_rx/lms6mod
auto_rx/m10mod
auto_rx/m20mod
auto_rx/mk2a1680mod
Expand All @@ -61,7 +60,6 @@ mk2a_lms1680
demod/dfm09ecc
demod/mod/dfm09mod
demod/mod/lms6Xmod
demod/mod/lms6mod
demod/mod/meisei100mod
demod/mod/rs41mod
demod/mod/rs92mod
Expand Down
46 changes: 15 additions & 31 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 @@ -244,7 +243,7 @@ def start_decoder(freq, sonde_type, continuous=False):
_exp_sonde_type = sonde_type

if continuous:
_timeout = 0
_timeout = 3600*6 # 6 hours before a 'continuous' decoder gets restarted automatically.
else:
_timeout = config["rx_timeout"]

Expand Down Expand Up @@ -445,7 +444,8 @@ def clean_task_list():

else:
# Shutdown the SDR, if required for the particular SDR type.
shutdown_sdr(config["sdr_type"], _task_sdr)
if _key != 'SCAN':
shutdown_sdr(config["sdr_type"], _task_sdr, sdr_hostname=config["sdr_hostname"], frequency=_key)
# Release its associated SDR.
autorx.sdr_list[_task_sdr]["in_use"] = False
autorx.sdr_list[_task_sdr]["task"] = None
Expand Down Expand Up @@ -505,6 +505,12 @@ def stop_all():
for _task in autorx.task_list.keys():
try:
autorx.task_list[_task]["task"].stop()

# Release the SDR channel if necessary
_task_sdr = autorx.task_list[_task]["device_idx"]
if _task != 'SCAN':
shutdown_sdr(config["sdr_type"], _task_sdr, sdr_hostname=config["sdr_hostname"], frequency=_task)

except Exception as e:
logging.error("Error stopping task - %s" % str(e))

Expand Down Expand Up @@ -759,9 +765,6 @@ def main():
)
args = parser.parse_args()

# Copy out timeout value, and convert to seconds,
_timeout = args.timeout * 60

# Copy out RS92 ephemeris value, if provided.
if args.ephemeris != "None":
rs92_ephemeris = args.ephemeris
Expand All @@ -784,7 +787,7 @@ def main():
autorx.logging_path = logging_path

# Configure logging
_log_suffix = datetime.datetime.utcnow().strftime("%Y%m%d-%H%M%S_system.log")
_log_suffix = datetime.datetime.now(datetime.timezone.utc).strftime("%Y%m%d-%H%M%S_system.log")
_log_path = os.path.join(logging_path, _log_suffix)

system_log_enabled = False
Expand Down Expand Up @@ -820,6 +823,11 @@ def main():
logging.getLogger("engineio").setLevel(logging.ERROR)
logging.getLogger("geventwebsocket").setLevel(logging.ERROR)

# Copy out timeout value, and convert to seconds.
if args.timeout > 0:
logging.info(f"Will shut down automatically after {args.timeout} minutes.")
_timeout = args.timeout * 60

# Check all the RS utilities exist.
logging.debug("Checking if required binaries exist")
if not check_rs_utils(config):
Expand Down Expand Up @@ -926,30 +934,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
3 changes: 0 additions & 3 deletions auto_rx/auto_rx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,4 @@
# change into appropriate directory
cd $(dirname $0)

# Clean up old files
rm log_power*.csv

python3 auto_rx.py -t 180
3 changes: 1 addition & 2 deletions auto_rx/autorx/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@
# MINOR - New sonde type support, other fairly big changes that may result in telemetry or config file incompatability issus.
# PATCH - Small changes, or minor feature additions.

__version__ = "1.7.2"

__version__ = "1.7.3"

# Global Variables

Expand Down
18 changes: 9 additions & 9 deletions auto_rx/autorx/aprs.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ def generate_station_object(
_datum = "!w%s%s!" % (_lat_prec, _lon_prec)

# Generate timestamp using current UTC time
_aprs_timestamp = datetime.datetime.utcnow().strftime("%H%M%S")
_aprs_timestamp = datetime.datetime.now(datetime.timezone.utc).strftime("%H%M%S")

# Add version string to position comment, if requested.
_aprs_comment = comment
Expand Down Expand Up @@ -807,10 +807,10 @@ def log_warning(self, line):
# ['frame', 'id', 'datetime', 'lat', 'lon', 'alt', 'temp', 'type', 'freq', 'freq_float', 'datetime_dt']
test_telem = [
# These types of DFM serial IDs are deprecated
# {'id':'DFM06-123456', 'frame':10, 'lat':-10.0, 'lon':10.0, 'alt':10000, 'temp':1.0, 'type':'DFM', 'freq':'401.520 MHz', 'freq_float':401.52, 'heading':0.0, 'vel_h':5.1, 'vel_v':-5.0, 'datetime_dt':datetime.datetime.utcnow()},
# {'id':'DFM09-123456', 'frame':10, 'lat':-10.0, 'lon':10.0, 'alt':10000, 'temp':1.0, 'type':'DFM', 'freq':'401.520 MHz', 'freq_float':401.52, 'heading':0.0, 'vel_h':5.1, 'vel_v':-5.0, 'datetime_dt':datetime.datetime.utcnow()},
# {'id':'DFM15-123456', 'frame':10, 'lat':-10.0, 'lon':10.0, 'alt':10000, 'temp':1.0, 'type':'DFM', 'freq':'401.520 MHz', 'freq_float':401.52, 'heading':0.0, 'vel_h':5.1, 'vel_v':-5.0, 'datetime_dt':datetime.datetime.utcnow()},
# {'id':'DFM17-12345678', 'frame':10, 'lat':-10.0, 'lon':10.0, 'alt':10000, 'temp':1.0, 'type':'DFM', 'freq':'401.520 MHz', 'freq_float':401.52, 'heading':0.0, 'vel_h':5.1, 'vel_v':-5.0, 'datetime_dt':datetime.datetime.utcnow()},
# {'id':'DFM06-123456', 'frame':10, 'lat':-10.0, 'lon':10.0, 'alt':10000, 'temp':1.0, 'type':'DFM', 'freq':'401.520 MHz', 'freq_float':401.52, 'heading':0.0, 'vel_h':5.1, 'vel_v':-5.0, 'datetime_dt':datetime.datetime.now(datetime.timezone.utc)},
# {'id':'DFM09-123456', 'frame':10, 'lat':-10.0, 'lon':10.0, 'alt':10000, 'temp':1.0, 'type':'DFM', 'freq':'401.520 MHz', 'freq_float':401.52, 'heading':0.0, 'vel_h':5.1, 'vel_v':-5.0, 'datetime_dt':datetime.datetime.now(datetime.timezone.utc)},
# {'id':'DFM15-123456', 'frame':10, 'lat':-10.0, 'lon':10.0, 'alt':10000, 'temp':1.0, 'type':'DFM', 'freq':'401.520 MHz', 'freq_float':401.52, 'heading':0.0, 'vel_h':5.1, 'vel_v':-5.0, 'datetime_dt':datetime.datetime.now(datetime.timezone.utc)},
# {'id':'DFM17-12345678', 'frame':10, 'lat':-10.0, 'lon':10.0, 'alt':10000, 'temp':1.0, 'type':'DFM', 'freq':'401.520 MHz', 'freq_float':401.52, 'heading':0.0, 'vel_h':5.1, 'vel_v':-5.0, 'datetime_dt':datetime.datetime.now(datetime.timezone.utc)},
{
"id": "DFM-19123456",
"frame": 10,
Expand All @@ -827,7 +827,7 @@ def log_warning(self, line):
"heading": 0.0,
"vel_h": 5.1,
"vel_v": -5.0,
"datetime_dt": datetime.datetime.utcnow(),
"datetime_dt": datetime.datetime.now(datetime.timezone.utc),
},
{
"id": "DFM-123456",
Expand All @@ -845,7 +845,7 @@ def log_warning(self, line):
"heading": 0.0,
"vel_h": 5.1,
"vel_v": -5.0,
"datetime_dt": datetime.datetime.utcnow(),
"datetime_dt": datetime.datetime.now(datetime.timezone.utc),
},
{
"id": "N1234567",
Expand All @@ -863,7 +863,7 @@ def log_warning(self, line):
"heading": 0.0,
"vel_h": 5.1,
"vel_v": -5.0,
"datetime_dt": datetime.datetime.utcnow(),
"datetime_dt": datetime.datetime.now(datetime.timezone.utc),
},
{
"id": "M1234567",
Expand All @@ -881,7 +881,7 @@ def log_warning(self, line):
"heading": 0.0,
"vel_h": 5.1,
"vel_v": -5.0,
"datetime_dt": datetime.datetime.utcnow(),
"datetime_dt": datetime.datetime.now(datetime.timezone.utc),
},
]

Expand Down
44 changes: 7 additions & 37 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 Expand Up @@ -457,7 +428,8 @@ def read_auto_rx_config(filename, no_sdr_test=False):
"MEISEI": True,
"MTS01": False, # Until we test it
"MRZ": False, # .... except for the MRZ, until we know it works.
"WXR301": True, # No fsk_demod chain for this yet.
"WXR301": True,
"WXRPN9": True,
"UDP": False,
}

Expand Down Expand Up @@ -564,7 +536,7 @@ def read_auto_rx_config(filename, no_sdr_test=False):
logging.warning(
"Config - Did not find kml_refresh_rate setting, using default (10 seconds)."
)
auto_rx_config["kml_refresh_rate"] = 11
auto_rx_config["kml_refresh_rate"] = 10

# New Sondehub db Settings
try:
Expand Down Expand Up @@ -867,7 +839,7 @@ def read_auto_rx_config(filename, no_sdr_test=False):
return None

for _n in range(1, auto_rx_config["sdr_quantity"] + 1):
_sdr_name = f"KA9Q{_n:02d}"
_sdr_name = f"KA9Q-{_n:02d}"
auto_rx_config["sdr_settings"][_sdr_name] = {
"ppm": 0,
"gain": 0,
Expand All @@ -876,8 +848,6 @@ def read_auto_rx_config(filename, no_sdr_test=False):
"task": None,
}

logging.critical("Config - KA9Q SDR Support not implemented yet - exiting.")
return None

else:
logging.critical(f"Config - Unknown SDR Type {auto_rx_config['sdr_type']} - exiting.")
Expand Down
Loading

0 comments on commit b8f4335

Please sign in to comment.