more esim config (#30480)

* load single conn

* high priority

---------

Co-authored-by: Comma Device <device@comma.ai>
old-commit-hash: 460d9af5b7
testing-closet
Adeeb Shihadeh 1 year ago committed by GitHub
parent f627f0c12e
commit 48abc579b0
  1. 1
      system/hardware/tici/esim.nmconnection
  2. 8
      system/hardware/tici/hardware.py

@ -5,6 +5,7 @@ type=gsm
permissions=
autoconnect=true
autoconnect-retries=100
autoconnect-priority=2
[gsm]
apn=

@ -540,15 +540,16 @@ class Tici(HardwareBase):
# eSIM prime
if sim_id.startswith('8985235'):
with open('/data/openpilot/system/hardware/tici/esim.nmconnection') as f, tempfile.NamedTemporaryFile(mode='w') as tf:
dest = "/etc/NetworkManager/system-connections/esim.nmconnection"
with open(Path(__file__).parent/'esim.nmconnection') as f, tempfile.NamedTemporaryFile(mode='w') as tf:
dat = f.read()
dat = dat.replace("sim-id=", f"sim-id={sim_id}")
tf.write(dat)
tf.flush()
# needs to be root
os.system(f"sudo cp {tf.name} /data/etc/NetworkManager/system-connections/esim.nmconnection")
os.system("sudo nmcli con reload")
os.system(f"sudo cp {tf.name} {dest}")
os.system(f"sudo nmcli con load {dest}")
def get_networks(self):
r = {}
@ -617,5 +618,6 @@ class Tici(HardwareBase):
if __name__ == "__main__":
t = Tici()
t.configure_modem()
t.initialize_hardware()
t.set_power_save(False)

Loading…
Cancel
Save