Disable onroad uploads
Added toggle to the "Networking" tab to disable uploads to connect.comma.ai while driving and without a WiFi connection to prevent large amounts of data usage.
This commit is contained in:
@@ -1,10 +1,12 @@
|
||||
import os
|
||||
|
||||
from cereal import car
|
||||
from cereal import car, log
|
||||
from openpilot.common.params import Params
|
||||
from openpilot.system.hardware import PC, TICI
|
||||
from openpilot.system.hardware import HARDWARE, PC, TICI
|
||||
from openpilot.selfdrive.manager.process import PythonProcess, NativeProcess, DaemonProcess
|
||||
|
||||
WIFI = log.DeviceState.NetworkType.wifi
|
||||
|
||||
WEBCAM = os.getenv("USE_WEBCAM") is not None
|
||||
|
||||
def driverview(started: bool, params: Params, CP: car.CarParams) -> bool:
|
||||
@@ -42,6 +44,9 @@ def only_offroad(started, params, CP: car.CarParams) -> bool:
|
||||
return not started
|
||||
|
||||
# FrogPilot functions
|
||||
def allow_uploads(started, params, CP: car.CarParams) -> bool:
|
||||
wifi_connected = HARDWARE.get_network_type() == WIFI and not started
|
||||
return wifi_connected if params.get_bool("DisableOnroadUploads") else True
|
||||
|
||||
procs = [
|
||||
DaemonProcess("manage_athenad", "selfdrive.athena.manage_athenad", "AthenadPid"),
|
||||
@@ -81,7 +86,7 @@ procs = [
|
||||
PythonProcess("thermald", "selfdrive.thermald.thermald", always_run),
|
||||
PythonProcess("tombstoned", "selfdrive.tombstoned", always_run, 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),
|
||||
|
||||
# debug procs
|
||||
|
||||
Reference in New Issue
Block a user