-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathconfig.yaml
More file actions
150 lines (140 loc) · 8.57 KB
/
config.yaml
File metadata and controls
150 lines (140 loc) · 8.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
# TeslaUSB Configuration File
#
# EDIT THIS FILE to match your installation.
# This file is used by both bash scripts and Python web application.
#
# All paths, settings, and credentials are defined here as a single source of truth.
# ============================================================================
# Installation & Paths
# ============================================================================
installation:
target_user: pi # Linux user running the TeslaUSB services (auto-overridden by SUDO_USER during setup)
mount_dir: /mnt/gadget # Mount directory for USB drives
# ============================================================================
# Disk Images
# ============================================================================
disk_images:
cam_name: usb_cam.img # TeslaCam disk image filename
lightshow_name: usb_lightshow.img # LightShow disk image filename
cam_label: TeslaCam # Filesystem label for TeslaCam drive
lightshow_label: Lightshow # Filesystem label for LightShow drive
music_name: usb_music.img # Music disk image filename (optional third LUN)
music_label: Music # Filesystem label for Music drive (Tesla expects FAT32)
music_enabled: true # Create and present music partition (LUN2)
music_fs: fat32 # Filesystem for music image (fat32 recommended for Tesla)
boot_fsck_enabled: true # Auto-repair filesystems on boot (recommended)
# ============================================================================
# Setup Configuration (used only by setup_usb.sh)
# ============================================================================
# These values are specific to the setup process and can be configured here
# or left empty ("") for interactive prompts during setup.
setup:
part1_size: "" # TeslaCam drive size (e.g., "50G" or leave empty for interactive)
part2_size: "" # LightShow drive size (e.g., "10G" or leave empty for interactive)
part3_size: "" # Music drive size (e.g., "32G" or leave empty to skip/interactive)
reserve_size: "" # Headroom to leave free on Pi filesystem (default: 5G)
archive_reserve_size: "50G" # Space reserved for RecentClips archive on SD card
# ============================================================================
# Network & Security
# ============================================================================
network:
samba_password: tesla # Samba password for authenticated user (CHANGE THIS!)
web_port: 80 # Web interface port (80 required for captive portal - do not change)
# ============================================================================
# Offline Access Point Configuration
# ============================================================================
# Fallback WiFi access point for in-car/mobile access when STA WiFi is unavailable
offline_ap:
enabled: true # Set to false to disable fallback AP
interface: wlan0 # WiFi interface used for AP/STA
ssid: TeslaUSB # SSID broadcast when AP is active (CHANGE THIS!)
passphrase: teslausb1234 # WPA2 passphrase 8-63 chars (CHANGE THIS!)
channel: 6 # 2.4GHz channel (1-11)
ipv4_cidr: 192.168.4.1/24 # Static IP for AP interface
dhcp_start: 192.168.4.10 # DHCP range start
dhcp_end: 192.168.4.50 # DHCP range end
check_interval: 20 # Seconds between health checks
disconnect_grace: 30 # Seconds offline before starting AP
min_rssi: -70 # Minimum RSSI (dBm) to tear down AP
stable_seconds: 20 # Seconds of good link before stopping AP
ping_target: 8.8.8.8 # Ping target to confirm WAN reachability
retry_seconds: 300 # While AP is active, retry STA join every N seconds
virtual_interface: uap0 # Virtual AP interface name (concurrent mode always enabled)
force_mode: auto # Persistent force mode: auto, force_on, force_off
# ============================================================================
# System Configuration File Paths
# ============================================================================
system:
config_file: /boot/firmware/config.txt # Raspberry Pi boot configuration
samba_conf: /etc/samba/smb.conf # Samba configuration file
# ============================================================================
# Web Application Configuration
# ============================================================================
web:
secret_key: CHANGE-THIS-TO-A-RANDOM-SECRET-KEY-ON-FIRST-INSTALL # Flask secret key (auto-generated if default)
max_lock_chime_size: 1048576 # 1 MiB (1024 * 1024 bytes)
max_lock_chime_duration: 10.0 # 10 seconds (configurable per Tesla model)
min_lock_chime_duration: 0.3 # 300ms minimum
speed_range_min: 0.5 # Half speed (audio trimmer)
speed_range_max: 2.0 # Double speed (audio trimmer)
speed_step: 0.05 # Fine-grained control (audio trimmer)
lock_chime_filename: LockChime.wav # Active lock chime filename
chimes_folder: Chimes # Folder on part2 where custom chimes are stored
lightshow_folder: LightShow # Folder on part2 where light shows are stored
max_upload_size_mb: 2048 # Max accepted upload size for music/lightshow (MiB)
max_upload_chunk_mb: 16 # Chunk size for streaming uploads (MiB)
# ============================================================================
# Mapping & Geo-Indexing Configuration
# ============================================================================
mapping:
enabled: true # Enable GPS/telemetry indexing of dashcam videos
index_on_startup: true # Auto-start indexer when web app launches
index_on_mode_switch: true # Auto-index after present/edit mode switch
sample_rate: 30 # Extract every Nth frame (30 = ~1/sec at 30fps)
trip_gap_minutes: 5 # Gap between waypoints to start a new trip
archive_indexing: true # Index ArchivedClips on SD card during WiFi connect
event_detection:
harsh_brake_threshold: -4.0 # m/s² longitudinal (negative = braking)
emergency_brake_threshold: -7.0 # m/s² longitudinal
hard_accel_threshold: 3.5 # m/s² longitudinal (positive = accelerating)
sharp_turn_lateral_g: 4.0 # m/s² lateral
speed_limit_mps: 35.76 # ~80 mph speed alert threshold (0 = disabled)
fsd_disengage_detect: true # Detect FSD engagement/disengagement events
# ============================================================================
# Cloud Archive Configuration
# ============================================================================
# Auto-sync dashcam footage to cloud storage via rclone
cloud_archive:
enabled: true
# Cloud provider (configured via web UI — credentials stored encrypted, NOT here)
provider: "" # google_drive | onedrive | dropbox | s3 | b2 | wasabi
remote_path: "TeslaUSB" # Path/folder on cloud storage
# Sync behavior
sync_folders: # Which TeslaCam subfolders to sync
- SentryClips
- SavedClips
- RecentClips
priority_order: # Sync priority (first = highest, user-configurable)
- SentryClips
- SavedClips
- RecentClips
max_upload_mbps: 5 # Bandwidth limit (Pi has limited upload)
cloud_reserve_gb: 1 # Keep this much free on cloud (don't fill to 100%)
keep_local_after_upload: true # Keep local files after uploading to cloud
sync_non_event_videos: false # Opt-in: sync videos without events or geolocation
cloud_auto_cleanup: false # Auto-delete old cloud videos when storage is low
cloud_cleanup_threshold_pct: 90 # Delete when cloud usage exceeds this %
cloud_min_retention_days: 30 # Keep at least this many days of videos
# ============================================================================
# RecentClips Archive Configuration
# ============================================================================
# Automatically copies RecentClips from the USB image (RO mount) to the Pi's
# SD card before Tesla's 1-hour circular buffer deletes them. Zero USB disruption.
archive:
enabled: true # Enable RecentClips archival
interval_minutes: 5 # How often to check for new clips (tighter = less data loss)
retention_days: 30 # Delete archived clips older than this
min_free_space_gb: 10 # Hard floor — stop archiving if SD card < this free
max_size_gb: 0 # 0 = auto (use all available space minus reserved)
only_driving: true # Only archive clips from active driving trips (skip idle/parked)
path: "" # Archive path (default: ~/ArchivedClips, set by web app)