Verified Commit 5cd8c403 authored by Angus Ainslie's avatar Angus Ainslie Committed by Clayton Craft
Browse files don't fail if one of the AGPS files is missing (MR 2)

Fixes #2
Signed-off-by: default avatarAngus Ainslie <>
parent 99093892
......@@ -133,17 +133,18 @@ class STM_AGPS:
almanac_path = os.path.join(dir, 'almanac.txt')
ephemeris_path = os.path.join(dir, 'ephemeris.txt')
for file in [almanac_path, ephemeris_path]:
if not os.path.exists(file):
self.__log.warn(f"AGPS file not found: {file}")
self.__log.warn("*NOT* loading AGPS data")
# reset device in case it is stuck, and set time
await self.reset()
await self.set_time()
if not os.path.exists(almanac_path):
self.__log.warn(f"AGPS almanac file not found: {almanac_path}")
await self._load_almanac(almanac_path)
if not os.path.exists(ephemeris_path):
self.__log.warn(f"AGPS ephemeris file not found: {ephemeris_path}")
await self._load_ephemeris(ephemeris_path)
async def _store_ephemeris(self, file='ephemeris.txt'):
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment