Skip to content

hardwared: give stuck LTE connections a kick #34995

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions system/hardware/hardwared.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ def touch_thread(end_event):
def hw_state_thread(end_event, hw_queue):
"""Handles non critical hardware state, and sends over queue"""
count = 0
registered_count = 0
prev_hw_state = None

modem_version = None
Expand Down Expand Up @@ -149,6 +150,16 @@ def hw_state_thread(end_event, hw_queue):
except queue.Full:
pass

if AGNOS and (hw_state.network_info is not None) and (hw_state.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 {hw_state.network_info}, bringing connection back up")
os.system("nmcli conn up esim")
registered_count = 0

if not modem_configured and HARDWARE.get_modem_version() is not None:
cloudlog.warning("configuring modem")
HARDWARE.configure_modem()
Expand Down
Loading