Skip to content

Commit bed7ef2

Browse files
greatgitsbyclaude
andcommitted
esim: replace lte.sh with CFUN cycle, reduce sleeps
- Use raw AT+CFUN=0/1 writes instead of lte.sh start for modem reset after profile switch (4s -> <1s) - Reduce MM inhibit wait from 1s to 0.5s (measured 240ms to take effect) - Remove subprocess/lte.sh dependency from switch path Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 95a7255 commit bed7ef2

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

system/hardware/tici/lpa.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -701,7 +701,7 @@ def _acquire_channel(self, inhibit: bool = False):
701701
if inhibit:
702702
inhibit_proc = subprocess.Popen(['sudo', 'mmcli', f'--inhibit-device={MM_DEVICE_UID}'],
703703
stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
704-
time.sleep(1)
704+
time.sleep(0.5)
705705
fd = os.open(LOCK_FILE, os.O_CREAT | os.O_RDWR)
706706
try:
707707
fcntl.flock(fd, fcntl.LOCK_EX)
@@ -769,7 +769,6 @@ def switch_profile(self, iccid: str) -> None:
769769
code = require_tag(root, TAG_STATUS, "status in EnableProfileResponse")[0]
770770
if code not in (0x00, 0x02):
771771
raise LPAError(f"EnableProfile failed: {PROFILE_ERROR_CODES.get(code, 'unknown')} (0x{code:02X})")
772-
if code == 0x00:
773-
subprocess.run(['/usr/comma/lte/lte.sh', 'start'], capture_output=True)
774-
time.sleep(5)
775-
self._client._reconnect_serial()
772+
if code == 0x00:
773+
self._client._serial.write(b'AT+CFUN=0\rAT+CFUN=1\r')
774+
self._client._serial.reset_input_buffer()

0 commit comments

Comments
 (0)