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")