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= permissions=
autoconnect=true autoconnect=true
autoconnect-retries=100 autoconnect-retries=100
autoconnect-priority=2
[gsm] [gsm]
apn= apn=

@ -540,15 +540,16 @@ class Tici(HardwareBase):
# eSIM prime # eSIM prime
if sim_id.startswith('8985235'): 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 = f.read()
dat = dat.replace("sim-id=", f"sim-id={sim_id}") dat = dat.replace("sim-id=", f"sim-id={sim_id}")
tf.write(dat) tf.write(dat)
tf.flush() tf.flush()
# needs to be root # needs to be root
os.system(f"sudo cp {tf.name} /data/etc/NetworkManager/system-connections/esim.nmconnection") os.system(f"sudo cp {tf.name} {dest}")
os.system("sudo nmcli con reload") os.system(f"sudo nmcli con load {dest}")
def get_networks(self): def get_networks(self):
r = {} r = {}
@ -617,5 +618,6 @@ class Tici(HardwareBase):
if __name__ == "__main__": if __name__ == "__main__":
t = Tici() t = Tici()
t.configure_modem()
t.initialize_hardware() t.initialize_hardware()
t.set_power_save(False) t.set_power_save(False)

Loading…
Cancel
Save