From 2134bab6fb76997097dcba5089e24745eac41394 Mon Sep 17 00:00:00 2001 From: Mark Jessop Date: Thu, 31 Aug 2023 22:13:39 +0930 Subject: [PATCH] More vebose logging when attempting to reset rtlsdrs --- auto_rx/autorx/__init__.py | 2 +- auto_rx/autorx/utils.py | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/auto_rx/autorx/__init__.py b/auto_rx/autorx/__init__.py index 2fe6131..08ce90f 100644 --- a/auto_rx/autorx/__init__.py +++ b/auto_rx/autorx/__init__.py @@ -12,7 +12,7 @@ from queue import Queue # 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.6.3-beta3" +__version__ = "1.6.3-beta4" # Global Variables diff --git a/auto_rx/autorx/utils.py b/auto_rx/autorx/utils.py index 330d2ea..4656749 100644 --- a/auto_rx/autorx/utils.py +++ b/auto_rx/autorx/utils.py @@ -780,8 +780,10 @@ def reset_usb(bus, device): try: fcntl.ioctl(usb_file, _USBDEVFS_RESET) - except IOError: - logging.error("RTLSDR - USB Reset Failed.") + # This was just catching IOError, just catch everything and print. + except Exception as e: + logging.error(f"RTLSDR - USB Reset Failed - {str(e)}") + def is_rtlsdr(vid, pid): @@ -963,7 +965,7 @@ def rtlsdr_test(device_idx="0", rtl_sdr_path="rtl_sdr", retries=5): # This exception means the subprocess has returned an error code of one. # This indicates either the RTLSDR doesn't exist, or some other error. if e.returncode == 127: - # 127 - File not found + # 127 = File not found logging.critical("rtl_sdr utilities (rtl_sdr, rtl_fm, rtl_power) not found!") return False else: @@ -983,7 +985,7 @@ def rtlsdr_test(device_idx="0", rtl_sdr_path="rtl_sdr", retries=5): # Decrement out retry count, then wait a bit before looping _rtlsdr_retries -= 1 - time.sleep(2) + time.sleep(5) # If we run out of retries, clearly the RTLSDR isn't working. logging.error(