diff --git a/system/ui/mici_setup.py b/system/ui/mici_setup.py index 51feb63c0..6c73f14e3 100755 --- a/system/ui/mici_setup.py +++ b/system/ui/mici_setup.py @@ -51,11 +51,10 @@ exec ./launch_openpilot.sh class NetworkConnectivityMonitor: - def __init__(self, should_check: Callable[[], bool] | None = None, check_interval: float = 1.0): + def __init__(self, should_check: Callable[[], bool] | None = None): self.network_connected = threading.Event() self.wifi_connected = threading.Event() self._should_check = should_check or (lambda: True) - self._check_interval = check_interval self._stop_event = threading.Event() self._thread: threading.Thread | None = None @@ -80,7 +79,7 @@ class NetworkConnectivityMonitor: if self._should_check(): try: request = urllib.request.Request(OPENPILOT_URL, method="HEAD") - urllib.request.urlopen(request, timeout=1.0) + urllib.request.urlopen(request, timeout=2.0) self.network_connected.set() if HARDWARE.get_network_type() == NetworkType.wifi: self.wifi_connected.set() @@ -89,7 +88,7 @@ class NetworkConnectivityMonitor: else: self.reset() - if self._stop_event.wait(timeout=self._check_interval): + if self._stop_event.wait(timeout=1.0): break diff --git a/system/ui/tici_setup.py b/system/ui/tici_setup.py index 39f95cc8a..8098e9ea2 100755 --- a/system/ui/tici_setup.py +++ b/system/ui/tici_setup.py @@ -218,7 +218,7 @@ class Setup(Widget): while not self.stop_network_check_thread.is_set(): if self.state == SetupState.NETWORK_SETUP: try: - urllib.request.urlopen(OPENPILOT_URL, timeout=2) + urllib.request.urlopen(OPENPILOT_URL, timeout=2.0) self.network_connected.set() if HARDWARE.get_network_type() == NetworkType.wifi: self.wifi_connected.set() @@ -226,7 +226,7 @@ class Setup(Widget): self.wifi_connected.clear() except Exception: self.network_connected.clear() - time.sleep(1) + time.sleep(1.0) def start_network_check(self): if self.network_check_thread is None or not self.network_check_thread.is_alive():