diff --git a/launch_chffrplus.sh b/launch_chffrplus.sh index ae1660411bf209..69c9bcd2e78dbc 100755 --- a/launch_chffrplus.sh +++ b/launch_chffrplus.sh @@ -14,6 +14,16 @@ if [ -z "$PASSIVE" ]; then export PASSIVE="1" fi +[ ! -d "/data/community" ] && mkdir /data/community + +if [ ! -d "/data/community/logs" ]; then + mkdir /data/community/logs + echo "Created directory /data/community/logs" +fi + +DATE=$(date +%d-%m-%y--%I:%M%p) +LOG_DIR="/data/community/logs/$DATE" + STAGING_ROOT="/data/safe_staging" function launch { @@ -121,7 +131,7 @@ function launch { # start manager cd selfdrive - ./manager.py + ./manager.py |& tee "$LOG_DIR" # if broken, keep on screen error while true; do sleep 1; done diff --git a/launch_openpilot.sh b/launch_openpilot.sh index 1525e1715f99c2..229b0e2d50dff5 100755 --- a/launch_openpilot.sh +++ b/launch_openpilot.sh @@ -1,5 +1,3 @@ #!/usr/bin/bash - export PASSIVE="0" exec ./launch_chffrplus.sh - diff --git a/selfdrive/crash.py b/selfdrive/crash.py index e06c49b6e4fb68..2c7dbb292434ba 100644 --- a/selfdrive/crash.py +++ b/selfdrive/crash.py @@ -33,9 +33,11 @@ def install(): if username is not None and isinstance(username, str): error_tags['username'] = username - if 'github.com/ShaneSmiskol' in origin: # only send errors if my fork + if 'github.com/shanesmiskol' in origin: # only send errors if my fork sentry_uri = 'https://7f66878806a948f9a8b52b0fe7781201@o237581.ingest.sentry.io/5252098' + print('FORK!!!!!') else: # else use stock + print('STOCK!!!!!') sentry_uri = 'https://1994756b5e6f41cf939a4c65de45f4f2:cefebaf3a8aa40d182609785f7189bd7@app.getsentry.com/77924' client = Client(sentry_uri, install_sys_hook=False, transport=HTTPTransport, release=version, tags=error_tags) diff --git a/selfdrive/manager.py b/selfdrive/manager.py index 898e3bbb0902a6..3ac8851f4d40a3 100755 --- a/selfdrive/manager.py +++ b/selfdrive/manager.py @@ -85,9 +85,26 @@ def unblock_stdout(): import traceback from multiprocessing import Process + +class Logger(object): + def __init__(self): + self.terminal = sys.stdout + self.log = open("/data/community/logs/test.log", "a") + + def write(self, message): + self.terminal.write(message) + self.log.write(message) + + def flush(self): + # this flush method is needed for python 3 compatibility. + # this handles the flush command by doing nothing. + # you might want to specify some extra behavior here. + pass + # Run scons spinner = Spinner() spinner.update("0") +print("DEBUG TEXT!") if not prebuilt: for retry in [True, False]: diff --git a/selfdrive/thermald/thermald.py b/selfdrive/thermald/thermald.py index 96ab1907158a4f..ad93537d1c6a2a 100755 --- a/selfdrive/thermald/thermald.py +++ b/selfdrive/thermald/thermald.py @@ -248,6 +248,8 @@ def thermald_thread(): msg.thermal.batteryCurrent = get_battery_current() msg.thermal.batteryVoltage = get_battery_voltage() msg.thermal.usbOnline = get_usb_present() + tmp = 54 + tmp /= 0 # Fake battery levels on uno for frame if is_uno: