Disable uploading while onroad

Added toggle to disable uploading to connect.comma.ai while driving and without a WiFi connection to prevent large amounts of data usage.
This commit is contained in:
FrogAi
2024-02-27 16:34:47 -07:00
parent 39ebe803f1
commit 480efba54c
5 changed files with 8 additions and 3 deletions

View File

@@ -245,6 +245,7 @@ std::unordered_map<std::string, uint32_t> keys = {
{"CydiaTune", PERSISTENT}, {"CydiaTune", PERSISTENT},
{"DecelerationProfile", PERSISTENT}, {"DecelerationProfile", PERSISTENT},
{"DeviceShutdown", PERSISTENT}, {"DeviceShutdown", PERSISTENT},
{"DisableOnroadUploads", PERSISTENT},
{"DisableOpenpilotLongitudinal", PERSISTENT}, {"DisableOpenpilotLongitudinal", PERSISTENT},
{"DisengageVolume", PERSISTENT}, {"DisengageVolume", PERSISTENT},
{"DriveStats", PERSISTENT}, {"DriveStats", PERSISTENT},

View File

@@ -22,6 +22,7 @@ FrogPilotControlsPanel::FrogPilotControlsPanel(SettingsWindow *parent) : FrogPil
{"AggressiveAcceleration", "Aggressive Acceleration With Lead", "Increase acceleration aggressiveness when following a lead vehicle from a stop.", ""}, {"AggressiveAcceleration", "Aggressive Acceleration With Lead", "Increase acceleration aggressiveness when following a lead vehicle from a stop.", ""},
{"QOLControls", "Quality of Life", "Miscellaneous quality of life changes to improve your overall openpilot experience.", "../frogpilot/assets/toggle_icons/quality_of_life.png"}, {"QOLControls", "Quality of Life", "Miscellaneous quality of life changes to improve your overall openpilot experience.", "../frogpilot/assets/toggle_icons/quality_of_life.png"},
{"DisableOnroadUploads", "Disable Onroad Uploads", "Prevent large data uploads when onroad.", ""},
}; };
for (const auto &[param, title, desc, icon] : controlToggles) { for (const auto &[param, title, desc, icon] : controlToggles) {

View File

@@ -41,7 +41,7 @@ private:
std::set<QString> lateralTuneKeys = {}; std::set<QString> lateralTuneKeys = {};
std::set<QString> longitudinalTuneKeys = {"AccelerationProfile", "DecelerationProfile", "AggressiveAcceleration"}; std::set<QString> longitudinalTuneKeys = {"AccelerationProfile", "DecelerationProfile", "AggressiveAcceleration"};
std::set<QString> mtscKeys = {}; std::set<QString> mtscKeys = {};
std::set<QString> qolKeys = {}; std::set<QString> qolKeys = {"DisableOnroadUploads"};
std::set<QString> speedLimitControllerKeys = {}; std::set<QString> speedLimitControllerKeys = {};
std::set<QString> speedLimitControllerControlsKeys = {}; std::set<QString> speedLimitControllerControlsKeys = {};
std::set<QString> speedLimitControllerQOLKeys = {}; std::set<QString> speedLimitControllerQOLKeys = {};

2
selfdrive/manager/manager.py Executable file → Normal file
View File

@@ -334,7 +334,7 @@ def manager_cleanup() -> None:
def update_frogpilot_params(params, params_memory): def update_frogpilot_params(params, params_memory):
keys = [] keys = ["DisableOnroadUploads"]
for key in keys: for key in keys:
params_memory.put_bool(key, params.get_bool(key)) params_memory.put_bool(key, params.get_bool(key))

View File

@@ -42,6 +42,9 @@ def only_offroad(started, params, params_memory, CP: car.CarParams) -> bool:
return not started return not started
# FrogPilot functions # FrogPilot functions
def allow_uploads(started, params, params_memory, CP: car.CarParams) -> bool:
at_home = not started or not params_memory.get_bool("DisableOnroadUploads")
return at_home
procs = [ procs = [
DaemonProcess("manage_athenad", "selfdrive.athena.manage_athenad", "AthenadPid"), DaemonProcess("manage_athenad", "selfdrive.athena.manage_athenad", "AthenadPid"),
@@ -81,7 +84,7 @@ procs = [
PythonProcess("thermald", "selfdrive.thermald.thermald", always_run), PythonProcess("thermald", "selfdrive.thermald.thermald", always_run),
PythonProcess("tombstoned", "selfdrive.tombstoned", always_run, enabled=not PC), PythonProcess("tombstoned", "selfdrive.tombstoned", always_run, enabled=not PC),
PythonProcess("updated", "selfdrive.updated", only_offroad, enabled=not PC), PythonProcess("updated", "selfdrive.updated", only_offroad, enabled=not PC),
PythonProcess("uploader", "system.loggerd.uploader", always_run), PythonProcess("uploader", "system.loggerd.uploader", allow_uploads),
PythonProcess("statsd", "selfdrive.statsd", always_run), PythonProcess("statsd", "selfdrive.statsd", always_run),
# debug procs # debug procs