diff --git a/frogpilot/common/frogpilot_utilities.py b/frogpilot/common/frogpilot_utilities.py old mode 100644 new mode 100755 index a5c79a768..91eccef72 --- a/frogpilot/common/frogpilot_utilities.py +++ b/frogpilot/common/frogpilot_utilities.py @@ -4,13 +4,11 @@ import json import math import numpy as np import requests -import shutil import subprocess import tarfile import threading import time import urllib.error -import urllib.request import zipfile from functools import cache @@ -40,7 +38,6 @@ locks = { "lock_doors": threading.Lock(), "update_checks": threading.Lock(), "update_maps": threading.Lock(), - "update_openpilot": threading.Lock(), "update_tinygrad": threading.Lock() } @@ -324,44 +321,6 @@ def update_maps(now): params.put("LastMapsUpdate", todays_date) -def update_openpilot(): - def update_available(): - run_cmd(["pkill", "-SIGUSR1", "-f", "system.updated.updated"], "Checking for updates...", "Failed to check for update...", report=False) - - while params.get("UpdaterState", encoding="utf-8") != "checking...": - time.sleep(1) - - while params.get("UpdaterState", encoding="utf-8") == "checking...": - time.sleep(1) - - if not params.get_bool("UpdaterFetchAvailable"): - return False - - while params.get_bool("IsOnroad") or running_threads.get("lock_doors", threading.Thread()).is_alive(): - time.sleep(60) - - run_cmd(["pkill", "-SIGHUP", "-f", "system.updated.updated"], "Update available, downloading...", "Failed to download update...", report=False) - - while not params.get_bool("UpdateAvailable"): - time.sleep(60) - - return True - - if params.get("UpdaterState", encoding="utf-8") != "idle": - return - - while params.get_bool("IsOnroad") or running_threads.get("lock_doors", threading.Thread()).is_alive(): - time.sleep(60) - - if not update_available(): - return - - while True: - if not update_available(): - break - - HARDWARE.reboot() - @cache def use_konik_server(): return KONIK_PATH.is_file() diff --git a/frogpilot/frogpilot_process.py b/frogpilot/frogpilot_process.py old mode 100644 new mode 100755 index 59aef4ae2..86d62df67 --- a/frogpilot/frogpilot_process.py +++ b/frogpilot/frogpilot_process.py @@ -10,8 +10,8 @@ from openpilot.common.time import system_time_valid from openpilot.frogpilot.assets.model_manager import MODEL_DOWNLOAD_ALL_PARAM, MODEL_DOWNLOAD_PARAM, ModelManager from openpilot.frogpilot.assets.theme_manager import THEME_COMPONENT_PARAMS, ThemeManager from openpilot.frogpilot.common.frogpilot_functions import backup_toggles -from openpilot.frogpilot.common.frogpilot_utilities import capture_report, flash_panda, is_url_pingable, lock_doors, run_thread_with_lock, update_maps, update_openpilot -from openpilot.frogpilot.common.frogpilot_variables import ERROR_LOGS_PATH, FrogPilotVariables, get_frogpilot_toggles, params, params_cache, params_memory +from openpilot.frogpilot.common.frogpilot_utilities import capture_report, flash_panda, is_url_pingable, lock_doors, run_thread_with_lock, update_maps +from openpilot.frogpilot.common.frogpilot_variables import ERROR_LOGS_PATH, FrogPilotVariables, get_frogpilot_toggles, params_cache, params_memory from openpilot.frogpilot.controls.frogpilot_planner import FrogPilotPlanner from openpilot.frogpilot.system.frogpilot_tracking import FrogPilotTracking @@ -49,9 +49,6 @@ def update_checks(model_manager, now, theme_manager, frogpilot_toggles, boot_run run_thread_with_lock("update_maps", update_maps, (now,)) - if frogpilot_toggles.automatic_updates: - run_thread_with_lock("update_openpilot", update_openpilot) - time.sleep(1) def frogpilot_thread(): @@ -69,7 +66,7 @@ def frogpilot_thread(): model_manager = ModelManager() theme_manager = ThemeManager() - toggles_last_updated = datetime.datetime.now(datetime.timezone.utc) + toggles_last_updated = datetime.datetime.now(datetime.UTC) pm = messaging.PubMaster(["frogpilotPlan"]) sm = messaging.SubMaster(["carControl", "carState", "controlsState", "deviceState", "driverMonitoringState", @@ -86,7 +83,7 @@ def frogpilot_thread(): while True: sm.update() - now = datetime.datetime.now(datetime.timezone.utc) + now = datetime.datetime.now(datetime.UTC) started = sm["deviceState"].started