diff --git a/CHANGELOGS.md b/CHANGELOGS.md
index 2b6a4a0ebc..3ab5b355e7 100644
--- a/CHANGELOGS.md
+++ b/CHANGELOGS.md
@@ -6,7 +6,10 @@ sunnypilot - Version Latest (2023-06-xx)
* NEW❗: Nissan and Mazda upstream models support
* NEW❗: Pre-Global Subaru upstream models support
* HKG: smartMDPS automatic detection (installed with applicable firmware)
-* Fleet Manager (native & screen recordings) via Browser support thanks to actuallylemoncurd, AlexandreSato, ntegan1, and royjr!
+* Fleet Manager via Browser support thanks to actuallylemoncurd, AlexandreSato, ntegan1, and royjr!
+ * Access your dashcam footage, screen recordings, and error logs when the car is turned off
+ * Connect to the device via Wi-Fi, mobile hotspot, or tethering on the comma device, then navigate to
+ http://ipAddress:5050 to access.
* Honda Clarity 2018-22 support thanks to mcallbosco, vanillagorillaa and wirelessnet2!
* Ram: Steer to 0/7 MPH support thanks to vincentw56!
* Retain hotspot/tethering state across reboots thanks to rogerioaguas!
diff --git a/system/fleetmanager/README.md b/system/fleetmanager/README.md
index e25ad7dd0c..5c16eb901f 100644
--- a/system/fleetmanager/README.md
+++ b/system/fleetmanager/README.md
@@ -1,5 +1,5 @@
# Fleet Manager
-Fleet Manger on sunnypilot allows viewing dashcam footage and screen recordings by connecting to the comma device via the same network, with your mobile device or PC. Big thanks to [actuallylemoncurd](https://github.com/actuallylemoncurd), [AlexandreSato](https://github.com/alexandreSato), [ntegan1](https://github.com/ntegan1), and [royjr](https://github.com/royjr).
+Fleet Manger on sunnypilot allows viewing dashcam footage, screen recordings, and error logs by connecting to the comma device via the same network, with your mobile device or PC. Big thanks to [actuallylemoncurd](https://github.com/actuallylemoncurd), [AlexandreSato](https://github.com/alexandreSato), [ntegan1](https://github.com/ntegan1), and [royjr](https://github.com/royjr).
The network can be set up by Wi-Fi, mobile hotspot, or tethering on the comma device. Navigate to http://tici:5050/ OR http://ipAddress:5050 to access.
diff --git a/system/fleetmanager/fleet_manager.py b/system/fleetmanager/fleet_manager.py
index 76484180e5..755f04d4c7 100755
--- a/system/fleetmanager/fleet_manager.py
+++ b/system/fleetmanager/fleet_manager.py
@@ -2,8 +2,8 @@
import os
import random
import secrets
-import system.fleetmanager.helpers as fleet
from flask import Flask, render_template, Response, request, send_from_directory, session, redirect, url_for
+import system.fleetmanager.helpers as fleet
from system.loggerd.config import ROOT as REALDATA
app = Flask(__name__)
@@ -89,7 +89,7 @@ def footage():
@app.route("/screenrecords")
@fleet.login_required
def screenrecords():
- rows = fleet.all_screenrecords()
+ rows = fleet.list_files(fleet.SCREENRECORD_PATH)
if not rows:
return render_template("error.html", error="no screenrecords found at:
" + fleet.SCREENRECORD_PATH)
return render_template("screenrecords.html", rows=rows, clip=rows[0])
@@ -98,7 +98,7 @@ def screenrecords():
@app.route("/screenrecords/")
@fleet.login_required
def screenrecord(clip):
- return render_template("screenrecords.html", rows=fleet.all_screenrecords(), clip=clip)
+ return render_template("screenrecords.html", rows=fleet.list_files(fleet.SCREENRECORD_PATH), clip=clip)
@app.route("/screenrecords/play/pipe/")
@@ -119,6 +119,18 @@ def about():
return render_template("about.html")
+@app.route("/error_logs")
+def error_logs():
+ return render_template("error_logs.html", rows=fleet.list_files(fleet.ERROR_LOGS_PATH))
+
+
+@app.route("/error_logs/")
+def open_error_log(file_name):
+ f = open(fleet.ERROR_LOGS_PATH + file_name)
+ error = f.read()
+ return render_template("error_log.html", file_name=file_name, file_content=error)
+
+
def main():
if not os.path.exists(fleet.PIN_PATH):
os.makedirs(fleet.PIN_PATH)
diff --git a/system/fleetmanager/helpers.py b/system/fleetmanager/helpers.py
index 0419172719..998dd8fe6c 100644
--- a/system/fleetmanager/helpers.py
+++ b/system/fleetmanager/helpers.py
@@ -8,12 +8,15 @@ from system.loggerd.config import ROOT as REALDATA
from system.loggerd.uploader import listdir_by_creation
from tools.lib.route import SegmentName
-# path to sunnypilot screen recordings
+
+# path to sunnypilot screen recordings and error logs
if PC:
SCREENRECORD_PATH = os.path.join(str(Path.home()), ".comma", "media", "0", "videos", "")
+ ERROR_LOGS_PATH = os.path.join(str(Path.home()), ".comma", "community", "crashes", "")
PIN_PATH = os.path.join(str(Path.home()), ".comma", "otp", "")
else:
SCREENRECORD_PATH = "/data/media/0/videos/"
+ ERROR_LOGS_PATH = "/data/community/crashes/"
PIN_PATH = "/data/otp/"
@@ -27,8 +30,8 @@ def login_required(f):
return decorated_route
-def all_screenrecords():
- return sorted(listdir_by_creation(SCREENRECORD_PATH), reverse=True)
+def list_files(path):
+ return sorted(listdir_by_creation(path), reverse=True)
def is_valid_segment(segment):
diff --git a/system/fleetmanager/templates/error_log.html b/system/fleetmanager/templates/error_log.html
new file mode 100644
index 0000000000..e8f527ef98
--- /dev/null
+++ b/system/fleetmanager/templates/error_log.html
@@ -0,0 +1,16 @@
+{% extends "layout.html" %}
+
+{% block title %}
+ Error Log
+{% endblock %}
+
+{% block main %}
+
+ Error Log of
{{ file_name }}
+
+{% endblock %}
+
+{% block unformated %}
+ {{ file_content }}
+
+{% endblock %}
diff --git a/system/fleetmanager/templates/error_logs.html b/system/fleetmanager/templates/error_logs.html
new file mode 100644
index 0000000000..41829cee46
--- /dev/null
+++ b/system/fleetmanager/templates/error_logs.html
@@ -0,0 +1,14 @@
+{% extends "layout.html" %}
+
+{% block title %}
+ Error Logs
+{% endblock %}
+
+{% block main %}
+
+ Error Logs
+
+ {% for row in rows %}
+ {{ row }}
+ {% endfor %}
+{% endblock %}
diff --git a/system/fleetmanager/templates/footage.html b/system/fleetmanager/templates/footage.html
index ac7120376e..dd626164b4 100644
--- a/system/fleetmanager/templates/footage.html
+++ b/system/fleetmanager/templates/footage.html
@@ -11,4 +11,5 @@
{% for row in rows %}
{{ row }}
{% endfor %}
+
{% endblock %}
diff --git a/system/fleetmanager/templates/index.html b/system/fleetmanager/templates/index.html
index 2179437707..38debd486b 100644
--- a/system/fleetmanager/templates/index.html
+++ b/system/fleetmanager/templates/index.html
@@ -10,4 +10,5 @@
View Dashcam Footage
View Screen Recordings
+
Access Error Logs
{% endblock %}
diff --git a/system/fleetmanager/templates/layout.html b/system/fleetmanager/templates/layout.html
index 6ba6fa9d43..9977a3a0f4 100644
--- a/system/fleetmanager/templates/layout.html
+++ b/system/fleetmanager/templates/layout.html
@@ -25,6 +25,9 @@
        Screen Recordings
+
+         Error Logs
+
        About
@@ -33,5 +36,6 @@
{% block main %}{% endblock %}
+ {% block unformated %}{% endblock %}