reset to pre-modification baseline; restart feature work from clean state
Restoring the working tree to the pristine pre-Claude baseline previously preserved at /data/clearpilot (now /data/clearpilot-baseline). The prior modified-but-broken tree is snapshotted at /data/openpilot-broken-2026-05-03 and tagged here as pre-reset-2026-05-03 for reference. From here, features (UI changes, dashcam, telemetry, GPS, display modes, speed logic, standstill power saving, etc.) will be re-introduced one at a time with proper testing.
This commit is contained in:
@@ -16,7 +16,7 @@ from openpilot.common.text_window import TextWindow
|
||||
from openpilot.common.time import system_time_valid
|
||||
from openpilot.system.hardware import HARDWARE, PC
|
||||
from openpilot.selfdrive.manager.helpers import unblock_stdout, write_onroad_params, save_bootlog
|
||||
from openpilot.selfdrive.manager.process import ensure_running, init_log_dir, update_log_dir_timestamp, session_log
|
||||
from openpilot.selfdrive.manager.process import ensure_running
|
||||
from openpilot.selfdrive.manager.process_config import managed_processes
|
||||
from openpilot.selfdrive.athena.registration import register, UNREGISTERED_DONGLE_ID
|
||||
from openpilot.common.swaglog import cloudlog, add_file_handler
|
||||
@@ -51,29 +51,7 @@ def frogpilot_boot_functions(frogpilot_functions):
|
||||
except Exception as e:
|
||||
print(f"An unexpected error occurred: {e}")
|
||||
|
||||
def cleanup_old_logs(max_age_days=30):
|
||||
"""CLEARPILOT: delete session log directories older than max_age_days."""
|
||||
import shutil
|
||||
log_base = "/data/log2"
|
||||
if not os.path.exists(log_base):
|
||||
return
|
||||
cutoff = time.time() - (max_age_days * 86400)
|
||||
for entry in os.listdir(log_base):
|
||||
if entry == "current":
|
||||
continue
|
||||
path = os.path.join(log_base, entry)
|
||||
if os.path.isdir(path):
|
||||
if os.path.getmtime(path) < cutoff:
|
||||
try:
|
||||
shutil.rmtree(path)
|
||||
except OSError:
|
||||
pass
|
||||
|
||||
|
||||
def manager_init(frogpilot_functions) -> None:
|
||||
init_log_dir()
|
||||
cleanup_old_logs()
|
||||
|
||||
frogpilot_boot = threading.Thread(target=frogpilot_boot_functions, args=(frogpilot_functions,))
|
||||
frogpilot_boot.start()
|
||||
|
||||
@@ -82,27 +60,6 @@ def manager_init(frogpilot_functions) -> None:
|
||||
params = Params()
|
||||
params_storage = Params("/persist/params")
|
||||
params.clear_all(ParamKeyType.CLEAR_ON_MANAGER_START)
|
||||
|
||||
# CLEARPILOT: always start with telemetry disabled, VPN enabled (memory params)
|
||||
params_memory = Params("/dev/shm/params")
|
||||
params_memory.put("TelemetryEnabled", "0")
|
||||
params_memory.put("VpnEnabled", "1")
|
||||
params_memory.put("DashcamFrames", "0")
|
||||
params_memory.put("DashcamState", "stopped")
|
||||
params_memory.put("DashcamShutdown", "0")
|
||||
params_memory.put("ModelFps", "20")
|
||||
params_memory.put("ModelStandby", "0")
|
||||
params_memory.put("ShutdownTouchReset", "0")
|
||||
params_memory.put("ModelStandbyTs", "0")
|
||||
params_memory.put("CarIsMetric", "0")
|
||||
params_memory.put("ClearpilotSpeedDisplay", "")
|
||||
params_memory.put("ClearpilotSpeedLimitDisplay", "0")
|
||||
params_memory.put("ClearpilotHasSpeed", "0")
|
||||
params_memory.put("ClearpilotIsMetric", "0")
|
||||
params_memory.put("ClearpilotSpeedUnit", "mph")
|
||||
params_memory.put("ClearpilotCruiseWarning", "")
|
||||
params_memory.put("ClearpilotCruiseWarningSpeed", "")
|
||||
params_memory.put("ClearpilotPlayDing", "0")
|
||||
params.clear_all(ParamKeyType.CLEAR_ON_ONROAD_TRANSITION)
|
||||
params.clear_all(ParamKeyType.CLEAR_ON_OFFROAD_TRANSITION)
|
||||
if is_release_branch():
|
||||
@@ -178,7 +135,6 @@ def manager_init(frogpilot_functions) -> None:
|
||||
("DisableOpenpilotLongitudinal", "0"),
|
||||
("DisableVTSCSmoothing", "0"),
|
||||
("DisengageVolume", "100"),
|
||||
("TelemetryEnabled", "0"),
|
||||
("DragonPilotTune", "0"),
|
||||
("DriverCamera", "0"),
|
||||
("DynamicPathWidth", "0"),
|
||||
@@ -273,7 +229,6 @@ def manager_init(frogpilot_functions) -> None:
|
||||
("ScreenBrightnessOnroad", "101"),
|
||||
("ScreenManagement", "1"),
|
||||
("ScreenRecorder", "1"),
|
||||
("ScreenRecorderDebug", "1"),
|
||||
("ScreenTimeout", "30"),
|
||||
("ScreenTimeoutOnroad", "30"),
|
||||
("SearchInput", "0"),
|
||||
@@ -410,7 +365,6 @@ def manager_thread(frogpilot_functions) -> None:
|
||||
cloudlog.bind(daemon="manager")
|
||||
cloudlog.info("manager start")
|
||||
cloudlog.info({"environ": os.environ})
|
||||
session_log.info("manager starting")
|
||||
|
||||
params = Params()
|
||||
params_memory = Params("/dev/shm/params")
|
||||
@@ -420,14 +374,6 @@ def manager_thread(frogpilot_functions) -> None:
|
||||
ignore += ["manage_athenad", "uploader"]
|
||||
if os.getenv("NOBOARD") is not None:
|
||||
ignore.append("pandad")
|
||||
# CLEARPILOT: bench mode — disable real car processes, enable bench simulator
|
||||
if os.getenv("BENCH_MODE") is not None:
|
||||
ignore += ["pandad", "controlsd", "radard", "plannerd",
|
||||
"calibrationd", "torqued", "paramsd", "locationd", "sensord",
|
||||
"ubloxd", "pigeond", "dmonitoringmodeld", "dmonitoringd",
|
||||
"modeld", "soundd", "loggerd", "micd",
|
||||
"dashcamd"]
|
||||
session_log.info("bench mode enabled")
|
||||
ignore += [x for x in os.getenv("BLOCK", "").split(",") if len(x) > 0]
|
||||
|
||||
sm = messaging.SubMaster(['deviceState', 'carParams'], poll='deviceState')
|
||||
@@ -449,7 +395,6 @@ def manager_thread(frogpilot_functions) -> None:
|
||||
|
||||
if started and not started_prev:
|
||||
params.clear_all(ParamKeyType.CLEAR_ON_ONROAD_TRANSITION)
|
||||
session_log.info("onroad transition")
|
||||
|
||||
if openpilot_crashed:
|
||||
os.remove(os.path.join(sentry.CRASHES_DIR, 'error.txt'))
|
||||
@@ -457,7 +402,6 @@ def manager_thread(frogpilot_functions) -> None:
|
||||
elif not started and started_prev:
|
||||
params.clear_all(ParamKeyType.CLEAR_ON_OFFROAD_TRANSITION)
|
||||
params_memory.clear_all(ParamKeyType.CLEAR_ON_OFFROAD_TRANSITION)
|
||||
session_log.info("offroad transition")
|
||||
|
||||
# update onroad params, which drives boardd's safety setter thread
|
||||
if started != started_prev:
|
||||
@@ -467,9 +411,6 @@ def manager_thread(frogpilot_functions) -> None:
|
||||
|
||||
ensure_running(managed_processes.values(), started, params=params, CP=sm['carParams'], not_run=ignore)
|
||||
|
||||
# CLEARPILOT: rename log directory once system time is valid
|
||||
update_log_dir_timestamp()
|
||||
|
||||
running = ' '.join("{}{}\u001b[0m".format("\u001b[32m" if p.proc.is_alive() else "\u001b[31m", p.name)
|
||||
for p in managed_processes.values() if p.proc)
|
||||
print(running)
|
||||
@@ -487,7 +428,6 @@ def manager_thread(frogpilot_functions) -> None:
|
||||
shutdown = True
|
||||
params.put("LastManagerExitReason", f"{param} {datetime.datetime.now()}")
|
||||
cloudlog.warning(f"Shutting down manager - {param} set")
|
||||
session_log.info("manager shutting down: %s", param)
|
||||
|
||||
if shutdown:
|
||||
break
|
||||
@@ -539,7 +479,6 @@ if __name__ == "__main__":
|
||||
except Exception:
|
||||
add_file_handler(cloudlog)
|
||||
cloudlog.exception("Manager failed to start")
|
||||
session_log.critical("manager failed to start: %s", traceback.format_exc())
|
||||
|
||||
try:
|
||||
managed_processes['ui'].stop()
|
||||
|
||||
Reference in New Issue
Block a user