eg25-control: dump fix data as part of --dump-debug-info
This commit is contained in:
parent
8c4caab995
commit
4dbb656a34
|
@ -58,6 +58,7 @@ import sys
|
||||||
import time
|
import time
|
||||||
|
|
||||||
POWER_ENDPOINT = "/sys/class/modem-power/modem-power/device/powered"
|
POWER_ENDPOINT = "/sys/class/modem-power/modem-power/device/powered"
|
||||||
|
GPS_STREAM_ENDPOINT = "/dev/ttyUSB1"
|
||||||
# GNSS-AP-Note 1.4:
|
# GNSS-AP-Note 1.4:
|
||||||
# also at xtrapath5 and xtrapath6 subdomains.
|
# also at xtrapath5 and xtrapath6 subdomains.
|
||||||
# the AGPS data here is an almanac good for 7 days.
|
# the AGPS data here is an almanac good for 7 days.
|
||||||
|
@ -108,7 +109,7 @@ class Executor:
|
||||||
def __init__(self, dry_run: bool = False):
|
def __init__(self, dry_run: bool = False):
|
||||||
self.dry_run = dry_run
|
self.dry_run = dry_run
|
||||||
|
|
||||||
def read_file(self, path: str, default: bytes) -> bytes:
|
def read_file(self, path: str, default: bytes = b'') -> bytes:
|
||||||
try:
|
try:
|
||||||
with open(path, 'rb') as f:
|
with open(path, 'rb') as f:
|
||||||
return f.read()
|
return f.read()
|
||||||
|
@ -237,7 +238,6 @@ class AutoGps:
|
||||||
enable = "1"
|
enable = "1"
|
||||||
|
|
||||||
class Sequencer:
|
class Sequencer:
|
||||||
AGPS_DATA_URI_BASE = AGPS_DATA_URI_BASE
|
|
||||||
def __init__(self, executor: Executor, modem: str, power_endpoint: str):
|
def __init__(self, executor: Executor, modem: str, power_endpoint: str):
|
||||||
self.executor = executor
|
self.executor = executor
|
||||||
self.modem = modem
|
self.modem = modem
|
||||||
|
@ -301,7 +301,7 @@ class Sequencer:
|
||||||
self.executor.mkdir("new")
|
self.executor.mkdir("new")
|
||||||
out_path = f"new/{variant}"
|
out_path = f"new/{variant}"
|
||||||
try:
|
try:
|
||||||
self.executor.exec(["curl", f"{self.AGPS_DATA_URI_BASE}/{variant}", "-o", out_path])
|
self.executor.exec(["curl", f"{AGPS_DATA_URI_BASE}/{variant}", "-o", out_path])
|
||||||
return out_path
|
return out_path
|
||||||
except subprocess.CalledProcessError as e:
|
except subprocess.CalledProcessError as e:
|
||||||
logger.warning(f"AGPS data download failed: {e}")
|
logger.warning(f"AGPS data download failed: {e}")
|
||||||
|
@ -410,6 +410,10 @@ class Sequencer:
|
||||||
self._at_structured_cmd('QGPSLOC', value='0', check=False)
|
self._at_structured_cmd('QGPSLOC', value='0', check=False)
|
||||||
logger.debug('dumping AGPS positioning mode bitfield')
|
logger.debug('dumping AGPS positioning mode bitfield')
|
||||||
self._at_structured_cmd('QGPSCFG', 'agpsposmode')
|
self._at_structured_cmd('QGPSCFG', 'agpsposmode')
|
||||||
|
logger.debug('dumping last modem GPS output, if available')
|
||||||
|
gpsout = self.executor.read_file(GPS_STREAM_ENDPOINT)
|
||||||
|
gpslines = gpsout.decode('utf-8').split('\n')[-12:]
|
||||||
|
logger.debug('\n'.join(gpslines))
|
||||||
|
|
||||||
@log_scope("configuring audio...", "audio configured")
|
@log_scope("configuring audio...", "audio configured")
|
||||||
def enable_audio(self) -> None:
|
def enable_audio(self) -> None:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user