mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-07-11 20:32:13 +08:00
comma three: correctly set initial EPS bearer settings for AT&T sim cards (#24175)
* 3g sunset * only for blue prime * pass * full att code Co-authored-by: Comma Device <device@comma.ai> old-commit-hash: c1388636a28b880e5c9b07bcaa8fbf867e23f02a
This commit is contained in:
@@ -152,6 +152,9 @@ class HardwareBase(ABC):
|
||||
def initialize_hardware(self):
|
||||
pass
|
||||
|
||||
def configure_modem(self):
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
def get_networks(self):
|
||||
pass
|
||||
|
||||
@@ -463,6 +463,25 @@ class Tici(HardwareBase):
|
||||
sudo_write("performance", "/sys/class/devfreq/soc:qcom,memlat-cpu0/governor")
|
||||
sudo_write("performance", "/sys/class/devfreq/soc:qcom,memlat-cpu4/governor")
|
||||
|
||||
def configure_modem(self):
|
||||
sim_id = self.get_sim_info().get('sim_id', '')
|
||||
|
||||
# blue prime config
|
||||
if sim_id.startswith('8901410'):
|
||||
cmds = [
|
||||
'AT+QNVW=5280,0,"0102000000000000"',
|
||||
'AT+QNVFW="/nv/item_files/ims/IMS_enable",00',
|
||||
'AT+QNVFW="/nv/item_files/modem/mmode/ue_usage_setting",01',
|
||||
]
|
||||
modem = self.get_modem()
|
||||
for cmd in cmds:
|
||||
try:
|
||||
modem.Command(cmd, math.ceil(TIMEOUT), dbus_interface=MM_MODEM, timeout=TIMEOUT)
|
||||
except Exception:
|
||||
pass
|
||||
os.system('mmcli -m 0 --3gpp-set-initial-eps-bearer-settings="apn=Broadband"')
|
||||
|
||||
|
||||
def get_networks(self):
|
||||
r = {}
|
||||
|
||||
|
||||
@@ -101,6 +101,7 @@ def hw_state_thread(end_event, hw_queue):
|
||||
|
||||
modem_version = None
|
||||
modem_nv = None
|
||||
modem_configured = False
|
||||
|
||||
while not end_event.is_set():
|
||||
# these are expensive calls. update every 10s
|
||||
@@ -143,6 +144,12 @@ def hw_state_thread(end_event, hw_queue):
|
||||
os.system("nmcli conn up lte")
|
||||
registered_count = 0
|
||||
|
||||
# TODO: remove this once the config is in AGNOS
|
||||
if not modem_configured and len(HARDWARE.get_sim_info().get('sim_id', '')) > 0:
|
||||
cloudlog.warning("configuring modem")
|
||||
HARDWARE.configure_modem()
|
||||
modem_configured = True
|
||||
|
||||
prev_hw_state = hw_state
|
||||
except Exception:
|
||||
cloudlog.exception("Error getting hardware state")
|
||||
|
||||
Reference in New Issue
Block a user