Skip to content

Commit

Permalink
new sim connection settings (#30457)
Browse files Browse the repository at this point in the history
* new sim connection settings

* fix att conflict

* sim id

* clenaup

---------

Co-authored-by: Comma Device <device@comma.ai>
  • Loading branch information
adeebshihadeh and Comma Device authored Nov 14, 2023
1 parent cc32a6b commit e323191
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 1 deletion.
28 changes: 28 additions & 0 deletions system/hardware/tici/esim.nmconnection
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
[connection]
id=esim
uuid=fff6553c-3284-4707-a6b1-acc021caaafb
type=gsm
permissions=
autoconnect=true
autoconnect-retries=100

[gsm]
apn=
home-only=false
auto-config=true
sim-id=

[ipv4]
route-metric=1000
dns-priority=1000
dns-search=
method=auto

[ipv6]
ddr-gen-mode=stable-privacy
dns-search=
route-metric=1000
dns-priority=1000
method=auto

[proxy]
15 changes: 14 additions & 1 deletion system/hardware/tici/hardware.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import os
import subprocess
import time
import tempfile
from enum import IntEnum
from functools import cached_property, lru_cache
from pathlib import Path
Expand Down Expand Up @@ -532,11 +533,23 @@ def configure_modem(self):
except Exception:
pass

# blue prime config
# blue prime
blue_prime = sim_id.startswith('8901410')
initial_apn = "Broadband" if blue_prime else ""
os.system(f'mmcli -m any --3gpp-set-initial-eps-bearer-settings="apn={initial_apn}"')

# eSIM prime
if sim_id.startswith('8985235'):
with open('/data/openpilot/system/hardware/tici/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")

def get_networks(self):
r = {}

Expand Down

0 comments on commit e323191

Please sign in to comment.