Revive yaris-obd: USB OBD adapter, real GPS/GNSS, offline map, hotspot, SQLite logging, dashcam retrieval
Squashed rewrite of the project revival work (replaces prior history on this branch to remove personal data that had been accidentally committed - real LAN IP, GPS coordinates, home WiFi SSID, and phone model). See PLAN.md for full phase-by-phase details. Summary: - Phase 2: adapt app_obd.py for a USB OBD-II adapter (was Bluetooth-only), auto-detect /dev/ttyUSB*, fix several pre-existing crash bugs. - Phase 3/4: make the web UI work fully offline (vendored Socket.IO/Leaflet/ Chart.js/FontAwesome, offline map tile downloader script, live GPS marker tracking fix). - Phase 5: systemd deployment/autostart on the Pi. - Phase 6: WiFi hotspot mode via NetworkManager (auto-switch between home WiFi and a local AP for in-car web UI access), mDNS hostname + port 80 redirect so the UI is reachable at a plain hostname with no port number. - Phase 7: fix app_db.py/app_sql.py bugs, wire up local SQLite trip logging. - Phase 8: brand-agnostic USB dashcam file retrieval (lsblk transport-based detection, works with any dashcam brand/folder layout). - Rewritten readme.md with a proper project overview. Co-authored-by: Copilot <[email protected]>
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
from flask import Flask, render_template, make_response, json
|
||||
from modules import app_gps, app_events, app_car, app_account, app_gps,app_obd
|
||||
from flask import Flask, render_template, make_response, json, jsonify
|
||||
from modules import app_gps, app_events, app_car, app_account, app_gps,app_obd, app_sql, app_dash
|
||||
import time
|
||||
from gevent.pywsgi import WSGIServer
|
||||
|
||||
@@ -10,7 +10,8 @@ app_events.socketio.init_app(app)
|
||||
account = app_account.Account()
|
||||
obd = app_obd.OBD()
|
||||
car = app_car.Car()
|
||||
gps = app_gps.get_gps()
|
||||
gps = app_gps.start_gps()
|
||||
app_sql.start_logging()
|
||||
|
||||
@app.route('/')
|
||||
def index():
|
||||
@@ -26,6 +27,16 @@ def dtc():
|
||||
def dash():
|
||||
return render_template('dash.html', account = account, car = car)
|
||||
|
||||
@app.route('/api/dash/devices')
|
||||
def dash_devices():
|
||||
devices = app_dash.list_usb_storage_partitions()
|
||||
return jsonify({"devices": devices})
|
||||
|
||||
@app.route('/api/dash/import', methods=['POST'])
|
||||
def dash_import():
|
||||
summary = app_dash.import_dashcam()
|
||||
return jsonify(summary)
|
||||
|
||||
# not sure if im gonna use this
|
||||
@app.route('/api/obd_speed/')
|
||||
def data():
|
||||
|
||||
Reference in New Issue
Block a user