Skip to content

Commit 48abc57

Browse files
adeebshihadehComma Device
andauthored
more esim config (#30480)
* load single conn * high priority --------- Co-authored-by: Comma Device <[email protected]> old-commit-hash: 460d9af
1 parent f627f0c commit 48abc57

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

system/hardware/tici/esim.nmconnection

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ type=gsm
55
permissions=
66
autoconnect=true
77
autoconnect-retries=100
8+
autoconnect-priority=2
89

910
[gsm]
1011
apn=

system/hardware/tici/hardware.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -540,15 +540,16 @@ def configure_modem(self):
540540

541541
# eSIM prime
542542
if sim_id.startswith('8985235'):
543-
with open('/data/openpilot/system/hardware/tici/esim.nmconnection') as f, tempfile.NamedTemporaryFile(mode='w') as tf:
543+
dest = "/etc/NetworkManager/system-connections/esim.nmconnection"
544+
with open(Path(__file__).parent/'esim.nmconnection') as f, tempfile.NamedTemporaryFile(mode='w') as tf:
544545
dat = f.read()
545546
dat = dat.replace("sim-id=", f"sim-id={sim_id}")
546547
tf.write(dat)
547548
tf.flush()
548549

549550
# needs to be root
550-
os.system(f"sudo cp {tf.name} /data/etc/NetworkManager/system-connections/esim.nmconnection")
551-
os.system("sudo nmcli con reload")
551+
os.system(f"sudo cp {tf.name} {dest}")
552+
os.system(f"sudo nmcli con load {dest}")
552553

553554
def get_networks(self):
554555
r = {}
@@ -617,5 +618,6 @@ def recover_internal_panda(self):
617618

618619
if __name__ == "__main__":
619620
t = Tici()
621+
t.configure_modem()
620622
t.initialize_hardware()
621623
t.set_power_save(False)

0 commit comments

Comments
 (0)