safer modem manager commands (#25999)

Co-authored-by: Comma Device <device@comma.ai>
pull/26007/head
Adeeb Shihadeh 3 years ago committed by GitHub
parent cfabae28e7
commit 1f5187892f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      selfdrive/sensord/rawgps/rawgpsd.py
  2. 2
      selfdrive/sensord/rawgps/test_rawgps.py
  3. 2
      system/hardware/tici/hardware.py

@ -88,7 +88,7 @@ def try_setup_logs(diag, log_types):
def mmcli(cmd: str) -> None:
for _ in range(5):
try:
subprocess.check_call(f"mmcli -m 0 {cmd}", shell=True)
subprocess.check_call(f"mmcli -m any --timeout 30 {cmd}", shell=True)
break
except subprocess.CalledProcessError:
cloudlog.exception("rawgps.mmcli_command_failed")
@ -151,7 +151,7 @@ def main() -> NoReturn:
# wait for ModemManager to come up
cloudlog.warning("waiting for modem to come up")
while True:
ret = subprocess.call("mmcli -m 0 --location-status", stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL, shell=True)
ret = subprocess.call("mmcli -m any --timeout 10 --location-status", stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL, shell=True)
if ret == 0:
break
time.sleep(0.1)

@ -40,7 +40,7 @@ class TestRawgpsd(unittest.TestCase):
time.sleep(s)
managed_processes['rawgpsd'].stop()
ls = subprocess.check_output("mmcli -m 0 --location-status --output-json", shell=True, encoding='utf-8')
ls = subprocess.check_output("mmcli -m any --location-status --output-json", shell=True, encoding='utf-8')
loc_status = json.loads(ls)
assert set(loc_status['modem']['location']['enabled']) <= {'3gpp-lac-ci'}

@ -480,7 +480,7 @@ class Tici(HardwareBase):
# blue prime config
if sim_id.startswith('8901410'):
os.system('mmcli -m 0 --3gpp-set-initial-eps-bearer-settings="apn=Broadband"')
os.system('mmcli -m any --3gpp-set-initial-eps-bearer-settings="apn=Broadband"')
def get_networks(self):
r = {}

Loading…
Cancel
Save