as a user…

User How-To’s for PILOT Drive

How to do a quick setup of PILOT Drive

This how-to assumes PILOT Drive has been installed via pip.

An interactive installer comes packaged with PILOT Drive, and can be utilized with:

sudo python3.11 -m pilot_drive --setup

This installer will guide the user through setting up iOS/Android notifications, an OBD connection, creation of a systemctl service, and more!

Configure Bluetooth Audio for the Raspberry Pi

While the later versions of Raspberry Pi OS seem to have Bluetooth audio w/ USB soundcard support out of the box, older versions may require lukasjapan’s bt-speaker.

This can be installed utilizing the lamemakes fork of the repo:

sudo -i
bash <(curl -s https://raw.githubusercontent.com/lamemakes/bt-speaker/master/install.sh)
Depending on your audio configuration, further ALSA hacking may be neccesary:

Add new themes

This how-to assumes PILOT Drive has been installed, and a settings file was created.

  1. In your favorite text editor, open the settings.json (default path is /etc/pilot-drive/config/settings.json)

  2. Once in the settings file, navigate to the webSettingsthemes section

  3. Add the desired theme in the below format, adding a name for the theme along with a primary, secondary, and accent color in an integer RGB format. color-hex has some cool user made palettes.

  4. Save settings.json and restart PILOT Drive

  5. Once restarted, in the UI navigate to the settings tab and your new theme should be there!

Theme format (note: each array of zeros should be replaced with [red int, green int, blue int])
{
    "name": "<name>",
    "accent": [
        0,
        0,
        0
    ],
    "primary": [
        0,
        0,
        0
    ],
    "secondary": [
        0,
        0,
        0
    ]
}

Recieve notifications from my Android device

PILOT Drive pulls Android notifications over USB via ADB.

While wireless ADB might be implemented in the future, right now a physical USB connection is required.
  1. If Android notifications weren’t enabled & installed with the PILOT Drive installer:
    1. Quick Install:

      python3.11 -m pilot_drive --setup --phone=android
      
    2. Manual Install:
      1. Install ADB on the PILOT Drive host machine

      2. Pull AAPT2 for the host machine’s architecture in the PILOT Drive bin directory

      3. Copy AAPT2 to /usr/local/bin/aapt2 and make it executable chmod +x /usr/local/bin/aapt2

      4. Open PILOT Drive settings.json (default path is /etc/pilot-drive/config/settings.json)

      5. Under "phone" ensure "enabled": true and "type": "android"

      6. Restart PILOT Drive

  2. Enable USB debugging on your Android device (paraphrased from howtogeek’s ADB article):
    1. Open your phone’s app drawer, tap the Settings icon, and select “About Phone”

    2. Scroll all the way down and tap the “Build Number” item seven times. You should get a message saying you are now a developer.

    3. Head back to the main Settings page, and you should see a new option in the “System” section called “Developer Options.”

    4. Once in Developer Options, enable “USB Debugging”

  3. Connect your Android device to the PILOT Drive host machine via USB

  4. On your Android device, an “Allow USB debugging?” prompt should appear

  5. Select the “Always allow from this computer” check box, and then select “Allow”

  6. Under the phone view, any active notifications from the connected ADB device will be present.

Trust ADB host device prompt on Android

Trust ADB host device prompt on Android

Recieve notifications from my iOS device

PILOT Drive listens for iOS notifications via ANCS, thus all that’s needed to recieve notifications is a bluetooth connection.
  1. If iOS notifications weren’t enabled & installed with the PILOT Drive installer:
    1. Quick Install:

      python3.11 -m pilot_drive --setup --phone=ios
      
    2. Manual Install:
      1. Install ancs4linux on the PILOT Drive host machine

      2. Open PILOT Drive settings.json (default path is /etc/pilot-drive/config/settings.json)

      3. Under "phone" ensure "enabled": true and "type": "ios"

      4. Restart PILOT Drive

  2. If previously connected, forget the host machine on your iOS device and vice versa.

  3. Pair your iOS device to the PILOT Drive host machine

  4. On your iOS device, a “Allow <host> to Recieve Your Notifications?” prompt should appear

  5. Select “Allow”

  6. Under the phone view, any new notifications from the connected iOS device will be present

Trust ANCS host device prompt on iOS

Trust ANCS host device prompt on iOS

Connect my ODBII/ELM327 reader

Get that juicy data from your vehicle!

  1. Connect either your USB OR Bluetooth serial device to the host machine.
    • While out of scope for this how-to, both transfer mediums should create a serial port at dev/ttyXXXX, but Bluetooth might require more tinkering with RFCOMM

  2. Configure PILOT Drive to work with your connected reader:
    1. Quick install:

      python3.11 -m pilot_drive --setup --obd="<path_to_obd>" # Replace with serial port path fromn step 1
      
    2. Manual install:
      1. Open PILOT Drive settings.json (default path is /etc/pilot-drive/config/settings.json)

      2. Under "vehicle" ensure "enabled": true and "port": "<path_to_obd>"

  3. Restart PILOT Drive

Add a new OBDII/ELM327 stat to query

This how-to assumes you’ve already configured your OBDII/ELM327 reader, and specified a path

  1. Open PILOT Drive settings.json (default path is /etc/pilot-drive/config/settings.json)

  2. Under "vehicle", locate "stats"

  3. Each stat object needs to have the following attributes (an example can be seen below):
    1. name: The name that is displayed in the UI

    2. command: The command used by python-obd to get the specified data field

    3. interval: Seconds between each query

  4. Restart PILOT Drive

NOTE: Before raising a new issue, confirm your vehicle supports the specified data field!

Vehicle format (note: these are boilerplate stats & intervals, and the port should be replaced)
"vehicle": {
    "enabled": true,
    "port": "<path_to_obd>",
    "stats": [
        {
            "name": "Speed",
            "command": "SPEED",
            "interval": 0.5
        },
        {
            "name": "RPM",
            "command": "RPM",
            "interval": 0.5
        },
        {
            "name": "Throttle Position",
            "command": "THROTTLE_POS",
            "interval": 3
        },
        {
            "name": "Voltage",
            "command": "CONTROL_MODULE_VOLTAGE",
            "interval": 3
        }
    ]
}