wip
This commit is contained in:
@@ -136,11 +136,11 @@ def downloader_loop(event):
|
|||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@retry(attempts=5, delay=0.2, ignore_failure=True)
|
# @retry(attempts=5, delay=0.2, ignore_failure=True)
|
||||||
def inject_assistance():
|
# def inject_assistance():
|
||||||
cmd = f"mmcli -m any --timeout 30 --location-inject-assistance-data={ASSIST_DATA_FILE}"
|
# cmd = f"mmcli -m any --timeout 30 --location-inject-assistance-data={ASSIST_DATA_FILE}"
|
||||||
subprocess.check_output(cmd, stderr=subprocess.PIPE, shell=True)
|
# subprocess.check_output(cmd, stderr=subprocess.PIPE, shell=True)
|
||||||
cloudlog.info("successfully loaded assistance data")
|
# cloudlog.info("successfully loaded assistance data")
|
||||||
|
|
||||||
@retry(attempts=5, delay=1.0)
|
@retry(attempts=5, delay=1.0)
|
||||||
def setup_quectel(diag: ModemDiag) -> bool:
|
def setup_quectel(diag: ModemDiag) -> bool:
|
||||||
@@ -174,10 +174,10 @@ def setup_quectel(diag: ModemDiag) -> bool:
|
|||||||
# Do internet assistance
|
# Do internet assistance
|
||||||
at_cmd("AT+QGPSXTRA=1")
|
at_cmd("AT+QGPSXTRA=1")
|
||||||
at_cmd("AT+QGPSSUPLURL=\"NULL\"")
|
at_cmd("AT+QGPSSUPLURL=\"NULL\"")
|
||||||
if os.path.exists(ASSIST_DATA_FILE):
|
# if os.path.exists(ASSIST_DATA_FILE):
|
||||||
ret = True
|
# ret = True
|
||||||
inject_assistance()
|
# inject_assistance()
|
||||||
os.remove(ASSIST_DATA_FILE)
|
# os.remove(ASSIST_DATA_FILE)
|
||||||
#at_cmd("AT+QGPSXTRADATA?")
|
#at_cmd("AT+QGPSXTRADATA?")
|
||||||
time_str = datetime.datetime.utcnow().strftime("%Y/%m/%d,%H:%M:%S")
|
time_str = datetime.datetime.utcnow().strftime("%Y/%m/%d,%H:%M:%S")
|
||||||
at_cmd(f"AT+QGPSXTRATIME=0,\"{time_str}\",1,1,1000")
|
at_cmd(f"AT+QGPSXTRATIME=0,\"{time_str}\",1,1,1000")
|
||||||
@@ -389,14 +389,12 @@ def main() -> NoReturn:
|
|||||||
should_report = True
|
should_report = True
|
||||||
# Execute reporting if conditions are met
|
# Execute reporting if conditions are met
|
||||||
if should_report:
|
if should_report:
|
||||||
|
last_reported_time = current_time
|
||||||
|
last_reported_latitude = gps.latitude
|
||||||
|
last_reported_longitude = gps.longitude
|
||||||
if os.path.exists("/data/brian/gps_tracking.sh"):
|
if os.path.exists("/data/brian/gps_tracking.sh"):
|
||||||
# Update the last reported time and location
|
# Update the last reported time and location
|
||||||
last_reported_time = current_time
|
subprocess.run(["bash", "/data/brian/gps_tracking.sh", str(gps.latitude), str(gps.longitude), str(gps.speed)], check=True)
|
||||||
last_reported_latitude = gps.latitude
|
|
||||||
last_reported_longitude = gps.longitude
|
|
||||||
|
|
||||||
# Call the script
|
|
||||||
subprocess.run(["bash", "/data/brian/gps_tracking.sh", gps.latitude, gps.longitude, gps.speed], check=True)
|
|
||||||
|
|
||||||
|
|
||||||
elif log_type == LOG_GNSS_OEMDRE_SVPOLY_REPORT:
|
elif log_type == LOG_GNSS_OEMDRE_SVPOLY_REPORT:
|
||||||
|
|||||||
Reference in New Issue
Block a user