More vebose logging when attempting to reset rtlsdrs

pull/804/head
Mark Jessop 2023-08-31 22:13:39 +09:30
rodzic 4805348347
commit 2134bab6fb
2 zmienionych plików z 7 dodań i 5 usunięć

Wyświetl plik

@ -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

Wyświetl plik

@ -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(