From 88d0b253d938531b1cf89b0fd605a7c637c7bb82 Mon Sep 17 00:00:00 2001 From: Willem Melching Date: Tue, 22 Jun 2021 15:29:02 +0200 Subject: [PATCH] tici: log stuck registered old-commit-hash: 68e562454ed6f928134240d55789936929ee5968 --- selfdrive/thermald/thermald.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/selfdrive/thermald/thermald.py b/selfdrive/thermald/thermald.py index c2e613587..87379e564 100755 --- a/selfdrive/thermald/thermald.py +++ b/selfdrive/thermald/thermald.py @@ -156,6 +156,7 @@ def thermald_thread(): network_type = NetworkType.none network_strength = NetworkStrength.unknown network_info = None + registered_count = 0 current_filter = FirstOrderFilter(0., CURRENT_TAU, DT_TRML) cpu_temp_filter = FirstOrderFilter(0., CPU_TEMP_TAU, DT_TRML) @@ -235,6 +236,15 @@ def thermald_thread(): network_type = HARDWARE.get_network_type() network_strength = HARDWARE.get_network_strength(network_type) network_info = HARDWARE.get_network_info() # pylint: disable=assignment-from-none + + if TICI and (network_info.get('state', None) == "REGISTERED"): + registered_count += 1 + else: + registered_count = 0 + + if registered_count > 10: + cloudlog.warning(f"Modem stuck in registered state {network_info}") + except Exception: cloudlog.exception("Error getting network status")