🚗 TeslaUSB Config Generator

User-friendly TeslaUSB configuration generator - All variables included

📶 WiFi Setup

Info:

You do not need to configure this if your network is already configured and you ran "install.sh". Some devices like Raspberry Pi Zero W only support 2.4 GHz WiFi.

💾 Archive System

Important!

Choose ONLY ONE archive system. If you want to use rsync, rclone, or NFS, delete or comment out the CIFS section.

System for sharing files with Windows or Mac
Can include an optional path
Efficient synchronization system via SSH. For authentication instructions: View documentation
System for cloud storage (Google Drive, Dropbox, etc.) or local server
If using a local server, put its IP. For cloud, you can use 8.8.8.8
Example: (--flag1 --flag2)
Network File System (common in Linux/NAS servers)
Must be the exact export path on the NAS (e.g., /volume1/TeslaCam)

🗄️ Storage Configuration

Notes on SD cards and sizes:

• A 128 GB or larger SD card is recommended (minimum 64 GB)
• The script will reserve 6 GB of fixed space
• CAM_SIZE of 40G is recommended, unless you accumulate a lot of footage
• One hour of recordings = 7-10 GB of data (depending on car model)
• MUSIC_SIZE must be sufficient for your music library
• If a size is not specified, that drive will not be created

Use a different drive than the boot drive to store recordings
WARNING!

The specified drive will be WIPED and completely repartitioned. DO NOT uncomment this line if you plan to use ONLY an SD card for boot and storage.

Example: /dev/sda for USB, /dev/nvme0n1 for onboard NVME
The car normally keeps 1 hour of RecentClips, but this varies by country. To keep a continuous record, the interval should be ~2 minutes less than the history your car keeps. This example adjusts for cars that only keep 10 minutes.
480 seconds = 8 minutes (for 10 min history). Follow your local regulations.
In addition to SavedClips, SentryClips, and Track Mode clips
SavedClips are archived by default, check this to disable
SentryClips are archived by default, check this to disable
TrackModeClips are archived by default, check this to disable
Recommended: 40G. Increase if you accumulate a lot of footage between archives
If not specified, no music drive will be created
If not specified, no lightshow drive will be created
If not specified, no boombox drive will be created
If you want to automatically copy music from a CIFS share every time the Pi connects to WiFi
Assumed to exist on the same server as the main archive. Can be the same share, but a different folder
ExFAT is the file system Tesla uses when formatting the drive in the car. It is NOT recommended for the pre-built TeslaUSB image (older kernel without TRIM support for ExFAT).

🌐 Network Services

Makes recordings available as a network share. Obsolete/deprecated, as you can now access recordings via the TeslaUSB web interface.
TeslaUSB will act as a WiFi access point for access on the road. Should work on Raspberry Pi but may not work on other devices.
The config script will NOT accept the default password 'password'. Minimum 8 characters.
The AP will give clients IPs in the x.x.x.10-254 range, so do not put the AP IP in that range
WARNING!

Anyone on the $SSID (and $AP_SSID if configured) WiFi network can freely interact with the teslausb web interface if it is not secured!

If using Raspberry Pi OS and you want a different timezone than 'BST'. If using Armbian, it likely already set the correct zone and this is not needed. Can be a real timezone, or "auto" for automatic detection.
Examples: America/Mexico_City, America/Los_Angeles, Europe/Madrid, auto
Default delay is 20 seconds between connecting to WiFi and starting to archive recorded clips
Default is "teslausb"
Define an SSH public key that can be used to SSH into teslausb as root
Disables SSH password authentication for all users

🔔 Push Notifications

Info:

Push notifications consist of a title and a message. By default TESLAUSB_HOSTNAME is used as the title.

📁 Trigger Files (tesla_dashcam)

Support for tesla_dashcam / Trigger Files:

Uncomment any TRIGGER_FILE_xxxxx to create trigger file(s) in the archive directory for the listed clip type after all clips have been transferred.

For example: TRIGGER_FILE_SAVED=ARCHIVE_UPLOADED would create a file in $ARCHIVE_BASE/SavedClips/ARCHIVE_UPLOADED.

TRIGGER_FILE_ANY will create a trigger file in $ARCHIVE_BASE. This will make tesla_dashcam process both SavedClips and SentryClips when either changes.

Useful if using tesla_dashcam to process clips.

You can modify the value to your desired trigger filename. Remember to alter your tesla_dashcam trigger filename to match.

Creates a trigger in the root to process SavedClips and SentryClips when either changes

⚡ Keep Car Awake

VERY IMPORTANT - SIGNIFICANT CHANGES TO KEEP CAR AWAKE!!!

Recent car firmware has deactivated the power ports when the vehicle enters a sleep state. This can hinder the completion of the archiving process by TeslaUSB. Tesla subsequently introduced the "Keep Accessory Power On" feature, but is NOT applicable to the data port used by Dashcam and TeslaUSB.

Several methods have been implemented: TeslaFi, Tessie, Bluetooth Low Energy (BLE), and Webhooks.

CHOOSE ONLY ONE METHOD! Do not mix TeslaFi with Tessie, or BLE with any of the services.

Pros and cons of each method:

BLE:
++ Direct connection to the car; unlimited
- Additional complexity to configure initially
- Some security vulnerabilities
* See Hardware wiki for BLE hardware/software support notes

TeslaFi/Tessie:
+ Simple to configure initially
+ Remote monitoring and management
- Tessie: If you don't use Sentry Mode, you need to maintain consistent WiFi/internet connection
- Some security vulnerabilities
- Requires paid 3rd party service

Webhook:
+ Does not require teslausb to store credentials that can directly control your vehicle
- Requires another service like Home Assistant configured to receive webhooks

Use Cases (choose 1):

Case 1: [Compatible with TeslaFi, Tessie, BLE or Webhook]
You want Sentry Mode ON everywhere except when parked at home. Upon arriving home, Sentry Mode will already be ON to power TeslaUSB during archiving. Once complete, a command will be sent to turn OFF Sentry Mode.
>>> IMPORTANT: Verify that your in-car Sentry Mode is ON, and 'Exclude Home' is UNCHECKED.

Case 2: [Compatible with TeslaFi, Tessie, BLE or Webhook]
You DO NOT want Sentry Mode ON anywhere, except when archiving. Upon arriving home, TeslaUSB will send a command to turn ON Sentry Mode. Once archiving is complete, a command will be sent to turn OFF Sentry Mode.
>>> IMPORTANT: Verify that your in-car Sentry Mode is OFF.

Case 3: [Compatible with Tessie, BLE or Webhook]
Sentry Mode is NOT used by TeslaUSB. Instead, a periodic command is sent to the car to keep it awake.

SECURITY NOTICE:

All 3 methods have some level of security implications. For BLE, the key pair is stored on the device. For TeslaFi/Tessie, the API access token is in the config file.

Good security practices:
* Change your TeslaUSB user passwords (pi and root)
* Set user/password for the TeslaUSB AP (if enabled)
* Enable Tesla's pin-to-drive
* If your TeslaUSB has been compromised, immediately change your Tesla.com password

For TeslaFi, provide your API token here
How to generate TeslaFi API Tokens:

1. Log in to your TeslaFi account
2. Navigate to Settings → Tesla API → API Token (tab)

Enable TeslaFi API Command:
1. Navigate to Settings → Tesla API → Commands (tab)
2. Verify 'Sentry Mode' command is checked (enabled)
3. For added security, recommend disabling 'Unlock' command

For Tessie, provide your API token and Vehicle VIN
How to generate Tessie API Tokens:

1. Log in to your Tessie account
2. Navigate to Settings → Developer API → Generate access token

For BLE, provide your Vehicle VIN here
Pairing TeslaUSB as a BLE device:

1. Ensure the TeslaUSB device is inside the vehicle and powered

2a. From the TeslaUSB Web UI: Menu > Tools > Pair BLE with Car
2b. Alternatively, if Web UI is not enabled, from SSH command line:
sudo /root/bin/tesla-control -ble -vin <your VIN> add-key-request /root/.ble/key_public.pem owner cloud_key

3. Shortly after initiating pairing, a request is shown for an authorized key card. Please tap a key card on the center console promptly and confirm on the car screen

4. If done successfully, you'll see an "Unknown Key" entry (can be renamed) under the car's Locks screen

Note: This DOES NOT prevent the car from locking, nor does it allow someone to easily unlock or drive the car. An authorized key (card, phone, fob) is still required.

For webhook, provide the URL of the webhook that will receive awake messages
Webhook Info:

A webhook message with a JSON body will be sent. The shape of the JSON will be: { "awake_command": "<command>" }

Commands that will be sent to this webhook:
1. start: Sent when SENTRY_CASE=2 and the archive process starts
2. stop: Sent when SENTRY_CASE=1 or 2 and the archive process ends
3. nudge: Sent when SENTRY_CASE=3 and the archive process is ongoing

Other ways to keep the data port powered:

You can manually turn on Sentry Mode or Camp Mode from the Tesla App. However, neither are great solutions as they keep the car awake indefinitely, unnecessarily consuming high voltage battery.

For that reason, it is a good idea to set up notification mechanisms (previous sections) so you know when to manually turn OFF Sentry/Camp Mode.

Another alternative is using a power bank or UPS hat to keep TeslaUSB powered independently of the car's USB power state. See the TeslaUSB wiki for more info.

🌡️ Temperature Monitor

Temperature Monitor:

Understanding your device's thermal profile is crucial for maintaining performance and reliability. As a reference, Raspberry Pi Foundation states its operating temperature range is 0°C to 85°C, and the system will begin throttling the processor when it reaches 80°C to prevent damage.

Anecdotally, other sub-components may become unstable at lower thresholds (e.g. Wi-Fi). As a general best practice, keep the temperature below 70°C. Start monitoring closely when it regularly reaches over 60°C.

Uncommenting any of the following parameters will activate TeslaUSB's temperature monitoring, which checks the temperature once per minute and retains the maximum value until the device restarts or powers off.

The following parameters determine when log entries and push messages (if configured) are triggered. The fixed interval case will only log entries, but will not send push messages, to avoid over-saturation.

Two (2) temperature thresholds: WARNING and CAUTION. Triggers will only fire once to reduce spam. Only when the temperature settles 5°C below the set thresholds are they allowed to fire again. Caution is generally considered less severe than Warning, but you are free to configure them as you wish. Values must be integers expressed in milli-°C (e.g., 68.0°C = 68000)
68000 = 68°C
55000 = 55°C
The fixed interval trigger logs (without push messages) instantaneous and maximum values. The maximum value is held during the recording period and resets upon completion of the archive/music sync process. This trigger can be useful to better understand thermal activity during the day. Value must be an integer expressed in minutes (minimum = 1).
Minimum 1 minute
At the end of each archive/music sync process, the device typically runs hotter, making it an ideal time to capture temperature.

⚙️ Advanced Options

If you want to increase the size of the root filesystem to have extra space for installing additional software. This only works if the backing store partition has not been created yet (during early initial setup), and requires an extra reboot. Sizes can be specified as for example "500M" or "2G"
Examples: 500M, 2G
If you want teslausb to automatically install some additional packages during setup. This only works if there is enough free space available on the root partition. Requested packages must be separated by spaces.
If you want to use different vm/cpu parameters. Leave commented to use teslausb defaults, or set to 'default' to use system defaults. See vm.txt documentation and governors.txt documentation for details.
Uncomment and change if you want configuration scripts to be downloaded from a repo other than github.com/marcone/teslausb
Uncomment and change if you want a branch other than main-dev