From 454cfc929be64bed03e4e02cff4a399b7886e907 Mon Sep 17 00:00:00 2001 From: Rick Lan Date: Wed, 10 Jul 2019 11:25:44 +1000 Subject: [PATCH 1/6] =?UTF-8?q?=E5=8A=A0=E5=85=A5=E9=97=9C=E9=96=89?= =?UTF-8?q?=E8=A8=98=E9=8C=84=E9=81=B8=E9=A0=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/params.py | 1 + selfdrive/dragonpilot/dragonconf/__init__.py | 32 +------------------- selfdrive/manager.py | 2 +- 3 files changed, 3 insertions(+), 32 deletions(-) diff --git a/common/params.py b/common/params.py index 3747b6e35..d50976545 100755 --- a/common/params.py +++ b/common/params.py @@ -82,6 +82,7 @@ keys = { "DragonDisableDriverSafetyCheck": [TxType.PERSISTENT], "DragonAutoShutdownAt": [TxType.PERSISTENT], "DragonTempDisableSteerOnSignal": [TxType.PERSISTENT], + "DragonDisableLogger": [TxType.PERSISTENT], } diff --git a/selfdrive/dragonpilot/dragonconf/__init__.py b/selfdrive/dragonpilot/dragonconf/__init__.py index 51be9d3a9..5bc5d27a8 100644 --- a/selfdrive/dragonpilot/dragonconf/__init__.py +++ b/selfdrive/dragonpilot/dragonconf/__init__.py @@ -10,40 +10,10 @@ default_conf = { 'DragonDisableDriverSafetyCheck': '0', 'DragonAutoShutdownAt': '30', # in minute 'DragonTempDisableSteerOnSignal': '0', + 'DragonDisableLogger': '0', } -# def write_json_config(config): -# with open(file, 'w') as f: -# json.dump(config, f, indent=2, sort_keys=True) -# os.chmod(file, 0644) - def dragonpilot_set_params(params): - # # create new json file - # if not os.path.isfile(file): - # write_json_config(default_conf) - # config = default_conf - # else: - # # load from json - # with open(file, 'r') as f: - # config = json.load(f) - # - # json_update_needed = False - # # add new keys - # for key, val in default_conf.items(): - # if key not in config: - # json_update_needed = True - # config[key] = val - # - # # remove invalid keys - # for key, val in config.items(): - # if key not in default_conf: - # json_update_needed = True - # config.pop(key, None) - # - # # write to json if update needed - # if json_update_needed: - # write_json_config(config) - # set params for key, val in default_conf.items(): if params.get(key) is None: diff --git a/selfdrive/manager.py b/selfdrive/manager.py index 0431391bd..5853739f8 100755 --- a/selfdrive/manager.py +++ b/selfdrive/manager.py @@ -454,7 +454,7 @@ def main(): # the flippening! os.system('LD_LIBRARY_PATH="" content insert --uri content://settings/system --bind name:s:user_rotation --bind value:i:1') - if os.getenv("NOLOG") is not None: + if os.getenv("NOLOG") is not None or Params.get("DragonDisableLogger") == "1": del managed_processes['loggerd'] del managed_processes['tombstoned'] if os.getenv("NOUPLOAD") is not None: From 5016d5bd58e4468033404c8eeef1b981838e15f2 Mon Sep 17 00:00:00 2001 From: Rick Lan Date: Wed, 10 Jul 2019 14:10:53 +1000 Subject: [PATCH 2/6] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E9=97=9C=E9=96=89?= =?UTF-8?q?=E8=A8=98=E9=8C=84=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- selfdrive/manager.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/selfdrive/manager.py b/selfdrive/manager.py index 5853739f8..9b418f75b 100755 --- a/selfdrive/manager.py +++ b/selfdrive/manager.py @@ -454,7 +454,7 @@ def main(): # the flippening! os.system('LD_LIBRARY_PATH="" content insert --uri content://settings/system --bind name:s:user_rotation --bind value:i:1') - if os.getenv("NOLOG") is not None or Params.get("DragonDisableLogger") == "1": + if os.getenv("NOLOG") is not None: del managed_processes['loggerd'] del managed_processes['tombstoned'] if os.getenv("NOUPLOAD") is not None: @@ -524,6 +524,11 @@ def main(): spinner_proc = subprocess.Popen(["./spinner", "loading %s"%spinner_text], cwd=os.path.join(BASEDIR, "selfdrive", "ui", "spinner"), close_fds=True) + + if params.get("DragonDisableLogger") == "1": + del managed_processes['loggerd'] + del managed_processes['tombstoned'] + try: manager_update() manager_init() From c283b71b42180af5cf9d31841daf03298c0a38c2 Mon Sep 17 00:00:00 2001 From: Rick Lan Date: Wed, 10 Jul 2019 15:11:09 +1000 Subject: [PATCH 3/6] =?UTF-8?q?=E5=8A=A0=E5=85=A5Noctua=E6=A8=A1=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- selfdrive/dragonpilot/dragonconf/__init__.py | 1 + selfdrive/thermald.py | 3 +++ 2 files changed, 4 insertions(+) diff --git a/selfdrive/dragonpilot/dragonconf/__init__.py b/selfdrive/dragonpilot/dragonconf/__init__.py index 5bc5d27a8..542a4d624 100644 --- a/selfdrive/dragonpilot/dragonconf/__init__.py +++ b/selfdrive/dragonpilot/dragonconf/__init__.py @@ -11,6 +11,7 @@ default_conf = { 'DragonAutoShutdownAt': '30', # in minute 'DragonTempDisableSteerOnSignal': '0', 'DragonDisableLogger': '0', + 'DragonNoctuaMode': '0', } def dragonpilot_set_params(params): diff --git a/selfdrive/thermald.py b/selfdrive/thermald.py index ef75cfffd..ace8ffc56 100755 --- a/selfdrive/thermald.py +++ b/selfdrive/thermald.py @@ -82,6 +82,9 @@ _TEMP_THRS_L = [42.5, 57.5, 72.5, 10000] _FAN_SPEEDS = [0, 16384, 32768, 65535] # max fan speed only allowed if battery is hot _BAT_TEMP_THERSHOLD = 45. +if Params.get('DragonNoctuaMode') == "1": + _FAN_SPEEDS = [65535, 65535, 65535, 65535] + _BAT_TEMP_THERSHOLD = 20. def handle_fan(max_cpu_temp, bat_temp, fan_speed): From ffba451dcedefdcd3af1a18045b5673b78e4b486 Mon Sep 17 00:00:00 2001 From: Rick Lan Date: Wed, 10 Jul 2019 15:22:25 +1000 Subject: [PATCH 4/6] =?UTF-8?q?=E4=BF=AE=E6=AD=A3Noctua=E6=A8=A1=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- selfdrive/thermald.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/selfdrive/thermald.py b/selfdrive/thermald.py index ace8ffc56..297b80ac6 100755 --- a/selfdrive/thermald.py +++ b/selfdrive/thermald.py @@ -11,6 +11,7 @@ from common.params import Params from common.realtime import sec_since_boot from common.numpy_fast import clip from common.filter_simple import FirstOrderFilter +params = Params() ThermalStatus = log.ThermalData.ThermalStatus CURRENT_TAU = 15. # 15s time constant @@ -82,7 +83,7 @@ _TEMP_THRS_L = [42.5, 57.5, 72.5, 10000] _FAN_SPEEDS = [0, 16384, 32768, 65535] # max fan speed only allowed if battery is hot _BAT_TEMP_THERSHOLD = 45. -if Params.get('DragonNoctuaMode') == "1": +if params.get('DragonNoctuaMode') == "1": _FAN_SPEEDS = [65535, 65535, 65535, 65535] _BAT_TEMP_THERSHOLD = 20. @@ -149,8 +150,6 @@ def thermald_thread(): charging_disabled = False os.system('echo "1" > /sys/class/power_supply/battery/charging_enabled') - params = Params() - while 1: health = messaging.recv_sock(health_sock, wait=True) location = messaging.recv_sock(location_sock) From b356d397790f49e05196d7e7f700ad627e07b24a Mon Sep 17 00:00:00 2001 From: Rick Lan Date: Wed, 10 Jul 2019 15:26:14 +1000 Subject: [PATCH 5/6] =?UTF-8?q?=E4=BF=AE=E6=AD=A3Noctua=E6=A8=A1=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/params.py | 1 + 1 file changed, 1 insertion(+) diff --git a/common/params.py b/common/params.py index d50976545..6a0d8d86b 100755 --- a/common/params.py +++ b/common/params.py @@ -83,6 +83,7 @@ keys = { "DragonAutoShutdownAt": [TxType.PERSISTENT], "DragonTempDisableSteerOnSignal": [TxType.PERSISTENT], "DragonDisableLogger": [TxType.PERSISTENT], + "DragonNoctuaMode": [TxType.PERSISTENT], } From b41741136d77c3e66151089123e5df8a527d1cac Mon Sep 17 00:00:00 2001 From: Rick Lan Date: Wed, 10 Jul 2019 16:26:35 +1000 Subject: [PATCH 6/6] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20APK?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit