From cee8330928886d056683f792c4966cbad8c1afcd Mon Sep 17 00:00:00 2001 From: Your Name Date: Sun, 9 Jun 2024 17:27:31 -0500 Subject: [PATCH] wip --- system/qcomgpsd/qcomgpsd.py | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/system/qcomgpsd/qcomgpsd.py b/system/qcomgpsd/qcomgpsd.py index 4227f8a..576879f 100755 --- a/system/qcomgpsd/qcomgpsd.py +++ b/system/qcomgpsd/qcomgpsd.py @@ -136,11 +136,11 @@ def downloader_loop(event): except KeyboardInterrupt: pass -@retry(attempts=5, delay=0.2, ignore_failure=True) -def inject_assistance(): - cmd = f"mmcli -m any --timeout 30 --location-inject-assistance-data={ASSIST_DATA_FILE}" - subprocess.check_output(cmd, stderr=subprocess.PIPE, shell=True) - cloudlog.info("successfully loaded assistance data") +# @retry(attempts=5, delay=0.2, ignore_failure=True) +# def inject_assistance(): +# cmd = f"mmcli -m any --timeout 30 --location-inject-assistance-data={ASSIST_DATA_FILE}" +# subprocess.check_output(cmd, stderr=subprocess.PIPE, shell=True) +# cloudlog.info("successfully loaded assistance data") @retry(attempts=5, delay=1.0) def setup_quectel(diag: ModemDiag) -> bool: @@ -174,10 +174,10 @@ def setup_quectel(diag: ModemDiag) -> bool: # Do internet assistance at_cmd("AT+QGPSXTRA=1") at_cmd("AT+QGPSSUPLURL=\"NULL\"") - if os.path.exists(ASSIST_DATA_FILE): - ret = True - inject_assistance() - os.remove(ASSIST_DATA_FILE) + # if os.path.exists(ASSIST_DATA_FILE): + # ret = True + # inject_assistance() + # os.remove(ASSIST_DATA_FILE) #at_cmd("AT+QGPSXTRADATA?") time_str = datetime.datetime.utcnow().strftime("%Y/%m/%d,%H:%M:%S") at_cmd(f"AT+QGPSXTRATIME=0,\"{time_str}\",1,1,1000") @@ -389,14 +389,12 @@ def main() -> NoReturn: should_report = True # Execute reporting if conditions are met 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"): # Update the last reported time and location - last_reported_time = current_time - 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) + subprocess.run(["bash", "/data/brian/gps_tracking.sh", str(gps.latitude), str(gps.longitude), str(gps.speed)], check=True) elif log_type == LOG_GNSS_OEMDRE_SVPOLY_REPORT: