diff --git a/common/params.cc b/common/params.cc index 27cf76d96..bf3e054b8 100644 --- a/common/params.cc +++ b/common/params.cc @@ -238,6 +238,7 @@ std::unordered_map keys = { {"AlwaysOnLateral", PERSISTENT}, {"AlwaysOnLateralLKAS", PERSISTENT}, {"AlwaysOnLateralMain", PERSISTENT}, + {"AlwaysAllowUploads", PERSISTENT}, {"AMapKey1", PERSISTENT | DONT_LOG}, {"AMapKey2", PERSISTENT | DONT_LOG}, {"ApiCache_DriveStats", PERSISTENT}, diff --git a/common/params_pyx.so b/common/params_pyx.so index 1bb622562..b8cfe2c3b 100755 Binary files a/common/params_pyx.so and b/common/params_pyx.so differ diff --git a/frogpilot/common/frogpilot_variables.py b/frogpilot/common/frogpilot_variables.py index 488ac82fe..a09af2e12 100644 --- a/frogpilot/common/frogpilot_variables.py +++ b/frogpilot/common/frogpilot_variables.py @@ -148,6 +148,7 @@ frogpilot_default_params: list[tuple[str, str | bytes, int, str]] = [ ("AlwaysOnLateral", "1", 0, "0"), ("AlwaysOnLateralLKAS", "1", 0, "0"), ("AlwaysOnLateralMain", "1", 0, "0"), + ("AlwaysAllowUploads", "0", 2, "0"), ("AMapKey1", "", 0, ""), ("AMapKey2", "", 0, ""), ("AutomaticallyDownloadModels", "1", 1, "0"), @@ -804,6 +805,7 @@ class FrogPilotVariables: toggle.device_shutdown_time = (device_shutdown_setting - 3) * 3600 if device_shutdown_setting >= 4 else device_shutdown_setting * (60 * 15) toggle.increase_thermal_limits = device_management and (params.get_bool("IncreaseThermalLimits") if tuning_level >= level["IncreaseThermalLimits"] else default.get_bool("IncreaseThermalLimits")) toggle.low_voltage_shutdown = np.clip(params.get_float("LowVoltageShutdown"), VBATT_PAUSE_CHARGING, 12.5) if device_management and tuning_level >= level["LowVoltageShutdown"] else default.get_float("LowVoltageShutdown") + toggle.always_allow_uploads = device_management and (params.get_bool("AlwaysAllowUploads") if tuning_level >= level["AlwaysAllowUploads"] else default.get_bool("AlwaysAllowUploads")) toggle.no_logging = device_management and (params.get_bool("NoLogging") if tuning_level >= level["NoLogging"] else default.get_bool("NoLogging")) and not self.vetting_branch or toggle.force_onroad toggle.no_uploads = device_management and (params.get_bool("NoUploads") if tuning_level >= level["NoUploads"] else default.get_bool("NoUploads")) and not self.vetting_branch or toggle.use_higher_bitrate toggle.no_onroad_uploads = toggle.no_uploads and (params.get_bool("DisableOnroadUploads") if tuning_level >= level["DisableOnroadUploads"] else default.get_bool("DisableOnroadUploads")) and not toggle.use_higher_bitrate diff --git a/frogpilot/system/the_pond/assets/components/tools/device_settings_layout.json b/frogpilot/system/the_pond/assets/components/tools/device_settings_layout.json index 5d45a378f..b4950e100 100644 --- a/frogpilot/system/the_pond/assets/components/tools/device_settings_layout.json +++ b/frogpilot/system/the_pond/assets/components/tools/device_settings_layout.json @@ -2341,6 +2341,14 @@ "ui_type": "toggle", "parent_key": "DeviceManagement" }, + { + "key": "AlwaysAllowUploads", + "label": "Always Allow Uploads", + "description": "Force driving data uploads regardless of network type, metered status, and upload restrictions. This overrides normal upload blocking checks.", + "data_type": "bool", + "ui_type": "toggle", + "parent_key": "DeviceManagement" + }, { "key": "HigherBitrate", "label": "High-Quality Recording", diff --git a/frogpilot/ui/qt/offroad/device_settings.cc b/frogpilot/ui/qt/offroad/device_settings.cc index aa5be5ae0..854f42a0d 100644 --- a/frogpilot/ui/qt/offroad/device_settings.cc +++ b/frogpilot/ui/qt/offroad/device_settings.cc @@ -37,6 +37,7 @@ FrogPilotDevicePanel::FrogPilotDevicePanel(FrogPilotSettingsWindow *parent) : Fr {"DeviceShutdown", tr("Device Shutdown Timer"), tr("Keep the device on for the set amount of time after a drive before it shuts down automatically."), ""}, {"NoLogging", tr("Disable Logging"), QString("%1

%2").arg(tr("WARNING: This will prevent your drives from being recorded and all data will be unobtainable!")).arg(tr("Prevent the device from saving driving data.")), ""}, {"NoUploads", tr("Disable Uploads"), QString("%1

%2").arg(tr("WARNING: This will prevent your drives from being uploaded to comma connect which will impact debugging and official support from comma!")).arg(tr("Prevent the device from uploading driving data.")), ""}, + {"AlwaysAllowUploads", tr("Always Allow Uploads"), tr("Force driving data uploads regardless of network type, metered status, and upload restrictions. This overrides normal upload blocking checks."), ""}, {"HigherBitrate", tr("High-Quality Recording"), tr("Save drive footage in higher video quality."), ""}, {"LowVoltageShutdown", tr("Low-Voltage Cutoff"), tr("While parked, if the battery voltage falls below the set level, the device shuts down to prevent excessive battery drain."), ""}, {"IncreaseThermalLimits", tr("Raise Temperature Limits"), QString("%1

%2").arg(tr("WARNING: Running at higher temperatures may damage your device!")).arg(tr("Allow the device to run at higher temperatures before throttling or shutting down. Use only if you understand the risks!")), ""}, diff --git a/frogpilot/ui/qt/offroad/device_settings.h b/frogpilot/ui/qt/offroad/device_settings.h index 97ebe6def..359ec8557 100644 --- a/frogpilot/ui/qt/offroad/device_settings.h +++ b/frogpilot/ui/qt/offroad/device_settings.h @@ -25,7 +25,7 @@ private: std::map toggles; - QSet deviceManagementKeys = {"DeviceShutdown", "HigherBitrate", "IncreaseThermalLimits", "LowVoltageShutdown", "NoLogging", "NoUploads", "UseKonikServer"}; + QSet deviceManagementKeys = {"AlwaysAllowUploads", "DeviceShutdown", "HigherBitrate", "IncreaseThermalLimits", "LowVoltageShutdown", "NoLogging", "NoUploads", "UseKonikServer"}; QSet screenKeys = {"ScreenBrightness", "ScreenBrightnessOnroad", "ScreenRecorder", "ScreenTimeout", "ScreenTimeoutOnroad", "StandbyMode"}; QSet parentKeys; diff --git a/selfdrive/ui/_spinner b/selfdrive/ui/_spinner index 2ec978383..4f6a04b0e 100755 Binary files a/selfdrive/ui/_spinner and b/selfdrive/ui/_spinner differ diff --git a/selfdrive/ui/_text b/selfdrive/ui/_text index c4eb0cc30..5b486c76a 100755 Binary files a/selfdrive/ui/_text and b/selfdrive/ui/_text differ diff --git a/selfdrive/ui/translations/main_ar.ts b/selfdrive/ui/translations/main_ar.ts index ff6057eb5..11494f72d 100644 --- a/selfdrive/ui/translations/main_ar.ts +++ b/selfdrive/ui/translations/main_ar.ts @@ -413,11 +413,11 @@ - Enter 6-digit PIN + Enter Password - Please enter a 6-digit PIN to secure your Galaxy access. + Please enter a password to secure your Galaxy access. (Min 6 characters) @@ -956,6 +956,14 @@ seconds ثوانٍ + + Always Allow Uploads + + + + <b>Force driving data uploads regardless of network type, metered status, and upload restrictions.</b> This overrides normal upload blocking checks. + + FrogPilotLateralPanel diff --git a/selfdrive/ui/translations/main_caveman.ts b/selfdrive/ui/translations/main_caveman.ts index ec4718c78..cff94c307 100644 --- a/selfdrive/ui/translations/main_caveman.ts +++ b/selfdrive/ui/translations/main_caveman.ts @@ -414,11 +414,11 @@ - Enter 6-digit PIN + Enter Password - Please enter a 6-digit PIN to secure your Galaxy access. + Please enter a password to secure your Galaxy access. (Min 6 characters) @@ -957,6 +957,14 @@ seconds seconds + + Always Allow Uploads + + + + <b>Force driving data uploads regardless of network type, metered status, and upload restrictions.</b> This overrides normal upload blocking checks. + + FrogPilotLateralPanel diff --git a/selfdrive/ui/translations/main_de.ts b/selfdrive/ui/translations/main_de.ts index 6f6847640..567de9e97 100644 --- a/selfdrive/ui/translations/main_de.ts +++ b/selfdrive/ui/translations/main_de.ts @@ -413,11 +413,11 @@ - Enter 6-digit PIN + Enter Password - Please enter a 6-digit PIN to secure your Galaxy access. + Please enter a password to secure your Galaxy access. (Min 6 characters) @@ -956,6 +956,14 @@ seconds Sekunden + + Always Allow Uploads + + + + <b>Force driving data uploads regardless of network type, metered status, and upload restrictions.</b> This overrides normal upload blocking checks. + + FrogPilotLateralPanel diff --git a/selfdrive/ui/translations/main_duck.ts b/selfdrive/ui/translations/main_duck.ts index 99699281a..ebc342d07 100644 --- a/selfdrive/ui/translations/main_duck.ts +++ b/selfdrive/ui/translations/main_duck.ts @@ -413,11 +413,11 @@ - Enter 6-digit PIN + Enter Password - Please enter a 6-digit PIN to secure your Galaxy access. + Please enter a password to secure your Galaxy access. (Min 6 characters) @@ -958,6 +958,14 @@ seconds quack seconds + + Always Allow Uploads + + + + <b>Force driving data uploads regardless of network type, metered status, and upload restrictions.</b> This overrides normal upload blocking checks. + + FrogPilotLateralPanel diff --git a/selfdrive/ui/translations/main_es.ts b/selfdrive/ui/translations/main_es.ts index 39e911bfd..bfdb61146 100644 --- a/selfdrive/ui/translations/main_es.ts +++ b/selfdrive/ui/translations/main_es.ts @@ -413,11 +413,11 @@ - Enter 6-digit PIN + Enter Password - Please enter a 6-digit PIN to secure your Galaxy access. + Please enter a password to secure your Galaxy access. (Min 6 characters) @@ -956,6 +956,14 @@ seconds segundos + + Always Allow Uploads + + + + <b>Force driving data uploads regardless of network type, metered status, and upload restrictions.</b> This overrides normal upload blocking checks. + + FrogPilotLateralPanel diff --git a/selfdrive/ui/translations/main_fr.ts b/selfdrive/ui/translations/main_fr.ts index e9430617e..95b7f1e35 100644 --- a/selfdrive/ui/translations/main_fr.ts +++ b/selfdrive/ui/translations/main_fr.ts @@ -413,11 +413,11 @@ - Enter 6-digit PIN + Enter Password - Please enter a 6-digit PIN to secure your Galaxy access. + Please enter a password to secure your Galaxy access. (Min 6 characters) @@ -956,6 +956,14 @@ seconds secondes + + Always Allow Uploads + + + + <b>Force driving data uploads regardless of network type, metered status, and upload restrictions.</b> This overrides normal upload blocking checks. + + FrogPilotLateralPanel diff --git a/selfdrive/ui/translations/main_frog.ts b/selfdrive/ui/translations/main_frog.ts index 364499f39..f02a79866 100644 --- a/selfdrive/ui/translations/main_frog.ts +++ b/selfdrive/ui/translations/main_frog.ts @@ -413,11 +413,11 @@ - Enter 6-digit PIN + Enter Password - Please enter a 6-digit PIN to secure your Galaxy access. + Please enter a password to secure your Galaxy access. (Min 6 characters) @@ -956,6 +956,14 @@ seconds Ribbit… seconds. Croak. + + Always Allow Uploads + + + + <b>Force driving data uploads regardless of network type, metered status, and upload restrictions.</b> This overrides normal upload blocking checks. + + FrogPilotLateralPanel diff --git a/selfdrive/ui/translations/main_ja.ts b/selfdrive/ui/translations/main_ja.ts index 7edc3f3b6..520ac0819 100644 --- a/selfdrive/ui/translations/main_ja.ts +++ b/selfdrive/ui/translations/main_ja.ts @@ -413,11 +413,11 @@ - Enter 6-digit PIN + Enter Password - Please enter a 6-digit PIN to secure your Galaxy access. + Please enter a password to secure your Galaxy access. (Min 6 characters) @@ -956,6 +956,14 @@ seconds + + Always Allow Uploads + + + + <b>Force driving data uploads regardless of network type, metered status, and upload restrictions.</b> This overrides normal upload blocking checks. + + FrogPilotLateralPanel diff --git a/selfdrive/ui/translations/main_ko.ts b/selfdrive/ui/translations/main_ko.ts index cf6519da0..8d10b4513 100644 --- a/selfdrive/ui/translations/main_ko.ts +++ b/selfdrive/ui/translations/main_ko.ts @@ -413,11 +413,11 @@ - Enter 6-digit PIN + Enter Password - Please enter a 6-digit PIN to secure your Galaxy access. + Please enter a password to secure your Galaxy access. (Min 6 characters) @@ -956,6 +956,14 @@ seconds + + Always Allow Uploads + + + + <b>Force driving data uploads regardless of network type, metered status, and upload restrictions.</b> This overrides normal upload blocking checks. + + FrogPilotLateralPanel diff --git a/selfdrive/ui/translations/main_pirate.ts b/selfdrive/ui/translations/main_pirate.ts index 9c9413ee3..0207cad02 100644 --- a/selfdrive/ui/translations/main_pirate.ts +++ b/selfdrive/ui/translations/main_pirate.ts @@ -413,11 +413,11 @@ - Enter 6-digit PIN + Enter Password - Please enter a 6-digit PIN to secure your Galaxy access. + Please enter a password to secure your Galaxy access. (Min 6 characters) @@ -956,6 +956,14 @@ seconds seconds + + Always Allow Uploads + + + + <b>Force driving data uploads regardless of network type, metered status, and upload restrictions.</b> This overrides normal upload blocking checks. + + FrogPilotLateralPanel diff --git a/selfdrive/ui/translations/main_pt-BR.ts b/selfdrive/ui/translations/main_pt-BR.ts index 58cc33985..5a65ca744 100644 --- a/selfdrive/ui/translations/main_pt-BR.ts +++ b/selfdrive/ui/translations/main_pt-BR.ts @@ -413,11 +413,11 @@ - Enter 6-digit PIN + Enter Password - Please enter a 6-digit PIN to secure your Galaxy access. + Please enter a password to secure your Galaxy access. (Min 6 characters) @@ -956,6 +956,14 @@ seconds segundos + + Always Allow Uploads + + + + <b>Force driving data uploads regardless of network type, metered status, and upload restrictions.</b> This overrides normal upload blocking checks. + + FrogPilotLateralPanel diff --git a/selfdrive/ui/translations/main_shakespearean.ts b/selfdrive/ui/translations/main_shakespearean.ts index 3e2a0cc4c..05bdeda8d 100644 --- a/selfdrive/ui/translations/main_shakespearean.ts +++ b/selfdrive/ui/translations/main_shakespearean.ts @@ -413,11 +413,11 @@ - Enter 6-digit PIN + Enter Password - Please enter a 6-digit PIN to secure your Galaxy access. + Please enter a password to secure your Galaxy access. (Min 6 characters) @@ -960,6 +960,14 @@ seconds seconds + + Always Allow Uploads + + + + <b>Force driving data uploads regardless of network type, metered status, and upload restrictions.</b> This overrides normal upload blocking checks. + + FrogPilotLateralPanel diff --git a/selfdrive/ui/translations/main_th.ts b/selfdrive/ui/translations/main_th.ts index 617cc54af..2d074bf01 100644 --- a/selfdrive/ui/translations/main_th.ts +++ b/selfdrive/ui/translations/main_th.ts @@ -413,11 +413,11 @@ - Enter 6-digit PIN + Enter Password - Please enter a 6-digit PIN to secure your Galaxy access. + Please enter a password to secure your Galaxy access. (Min 6 characters) @@ -956,6 +956,14 @@ seconds วินาที + + Always Allow Uploads + + + + <b>Force driving data uploads regardless of network type, metered status, and upload restrictions.</b> This overrides normal upload blocking checks. + + FrogPilotLateralPanel diff --git a/selfdrive/ui/translations/main_tr.ts b/selfdrive/ui/translations/main_tr.ts index fd8eaf422..cc4ad15fb 100644 --- a/selfdrive/ui/translations/main_tr.ts +++ b/selfdrive/ui/translations/main_tr.ts @@ -413,11 +413,11 @@ - Enter 6-digit PIN + Enter Password - Please enter a 6-digit PIN to secure your Galaxy access. + Please enter a password to secure your Galaxy access. (Min 6 characters) @@ -956,6 +956,14 @@ seconds saniye + + Always Allow Uploads + + + + <b>Force driving data uploads regardless of network type, metered status, and upload restrictions.</b> This overrides normal upload blocking checks. + + FrogPilotLateralPanel diff --git a/selfdrive/ui/translations/main_zh-CHS.ts b/selfdrive/ui/translations/main_zh-CHS.ts index 399e23cb8..e92c5ddd1 100644 --- a/selfdrive/ui/translations/main_zh-CHS.ts +++ b/selfdrive/ui/translations/main_zh-CHS.ts @@ -413,11 +413,11 @@ - Enter 6-digit PIN + Enter Password - Please enter a 6-digit PIN to secure your Galaxy access. + Please enter a password to secure your Galaxy access. (Min 6 characters) @@ -956,6 +956,14 @@ seconds + + Always Allow Uploads + + + + <b>Force driving data uploads regardless of network type, metered status, and upload restrictions.</b> This overrides normal upload blocking checks. + + FrogPilotLateralPanel diff --git a/selfdrive/ui/translations/main_zh-CHT.ts b/selfdrive/ui/translations/main_zh-CHT.ts index ff79b0bdc..78b0d0503 100644 --- a/selfdrive/ui/translations/main_zh-CHT.ts +++ b/selfdrive/ui/translations/main_zh-CHT.ts @@ -413,11 +413,11 @@ - Enter 6-digit PIN + Enter Password - Please enter a 6-digit PIN to secure your Galaxy access. + Please enter a password to secure your Galaxy access. (Min 6 characters) @@ -956,6 +956,14 @@ seconds + + Always Allow Uploads + + + + <b>Force driving data uploads regardless of network type, metered status, and upload restrictions.</b> This overrides normal upload blocking checks. + + FrogPilotLateralPanel diff --git a/selfdrive/ui/ui b/selfdrive/ui/ui index 6e7dc846e..80d75361a 100755 Binary files a/selfdrive/ui/ui and b/selfdrive/ui/ui differ diff --git a/system/athena/athenad.py b/system/athena/athenad.py index d606ec0a0..092b01463 100755 --- a/system/athena/athenad.py +++ b/system/athena/athenad.py @@ -103,6 +103,7 @@ log_recv_queue: Queue[str] = queue.Queue() cancelled_uploads: set[str] = set() cur_upload_items: dict[int, UploadItem | None] = {} +params_store = Params() def strip_bz2_extension(fn: str) -> str: @@ -115,6 +116,10 @@ class AbortTransferException(Exception): pass +def always_allow_uploads() -> bool: + return params_store.get_bool("AlwaysAllowUploads") + + class UploadQueueCache: @staticmethod @@ -214,7 +219,7 @@ def cb(sm, item, tid, end_event: threading.Event, sz: int, cur: int) -> None: # or if athenad is shutting down to re-connect the websocket sm.update(0) metered = sm['deviceState'].networkMetered - if metered and (not item.allow_cellular): + if metered and (not item.allow_cellular) and not always_allow_uploads(): raise AbortTransferException if end_event.is_set(): @@ -247,7 +252,7 @@ def upload_handler(end_event: threading.Event) -> None: sm.update(0) metered = sm['deviceState'].networkMetered network_type = sm['deviceState'].networkType.raw - if metered and (not item.allow_cellular): + if metered and (not item.allow_cellular) and not always_allow_uploads(): retry_upload(tid, end_event, False) continue diff --git a/system/loggerd/uploader.py b/system/loggerd/uploader.py index db8422d52..b236b8e9f 100755 --- a/system/loggerd/uploader.py +++ b/system/loggerd/uploader.py @@ -258,15 +258,16 @@ def main(exit_event: threading.Event = None) -> None: while not exit_event.is_set(): sm.update(0) + always_allow_uploads = params.get_bool("AlwaysAllowUploads") offroad = params.get_bool("IsOffroad") network_type = sm['deviceState'].networkType if not force_wifi else NetworkType.wifi - at_home = offroad and network_type in (NetworkType.ethernet, NetworkType.wifi) or not frogpilot_toggles.no_onroad_uploads - if network_type == NetworkType.none or not at_home: + at_home = always_allow_uploads or (offroad and network_type in (NetworkType.ethernet, NetworkType.wifi)) or not frogpilot_toggles.no_onroad_uploads + if ((network_type == NetworkType.none) and not always_allow_uploads) or not at_home: if allow_sleep: time.sleep(60 if offroad else 5) continue - success = uploader.step(sm['deviceState'].networkType.raw, sm['deviceState'].networkMetered) + success = uploader.step(sm['deviceState'].networkType.raw, sm['deviceState'].networkMetered and not always_allow_uploads) if success is None: backoff = 60 if offroad else 5 elif success: diff --git a/system/manager/process_config.py b/system/manager/process_config.py index d9197c109..b66b18d51 100644 --- a/system/manager/process_config.py +++ b/system/manager/process_config.py @@ -52,7 +52,7 @@ def allow_logging(started, params, CP: car.CarParams, classic_model, tinygrad_mo return not frogpilot_toggles.no_logging and logging(started, params, CP, classic_model, tinygrad_model, frogpilot_toggles) def allow_uploads(started, params, CP: car.CarParams, classic_model, tinygrad_model, frogpilot_toggles) -> bool: - return not frogpilot_toggles.no_uploads or frogpilot_toggles.no_onroad_uploads + return params.get_bool("AlwaysAllowUploads") or not frogpilot_toggles.no_uploads or frogpilot_toggles.no_onroad_uploads def run_classic_modeld(started, params, CP: car.CarParams, classic_model, tinygrad_model, frogpilot_toggles) -> bool: return started and classic_model