PILOT Drive’s documentation
Welcome to PILOT Drive!
PILOT Drive is an open source vehicle radio/headunit/infotainment system. The aim is to create an in-vehicle system that can display media, car, and phone info, all while allowing for easy hackability & tweaking. Most of the headunits around currently are either OEM/proprietary or claim to be open, but are only open to a certain threshold.
What can it do?
In it’s current implementation, PILOT Drive can:
Play, display, and control audio from sources like bluetooth
Display live data from their vehicle
Show notifications from connected iOS & Android devices
Control and display connected backup cameras
Tailor the UI to their own tastes with fully customizable themes and display settings.
Integrate with the PILOT Drive HAT for a seamless in-vehicle experience.
Designed to be hacked
PILOT Drive was built with tweaking and hacking in mind, via:
Common languages/frameworks: Python is one of the most common & easy to learn languages, while the UI uses easy to read Vue Single File Components. Both of these make all current functionality easily tweakable.
Modularity: The main features of PILOT Drive are contained as modular “services” that can be almost plug-and-play.
Fully open source codebase: While some alternatives claim openness, most don’t actually deliver after a certain threshold. PILOT Drive will always be open and free to use.
Installation
Installing Python 3.11
Due to the latest Python features being implemented, Python 3.11 is required. See the following guide to install it on Debian:
wget https://www.python.org/ftp/python/3.11.2/Python-3.11.2.tgz
sudo apt install build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev git
tar -xzvf Python-3.11.2.tgz
cd Python-3.11.2/
./configure --enable-optimizations
sudo make altinstall
Quick Start
Requirements
Raspberry Pi 4 or other Linux SBC
Python >= 3.11
(Optional) lukasjapan’s bt-speaker -> For bluetooth audio
(Optional) python-OBD -> To use OBD connectivity features
(Optional) ancs4linux -> For iOS notification integration
(Optional) ADB -> For Android notification integration
(Optional) AAPT2 -> For Android notification integration
Install
To quick start your installation of PILOT Drive, first confirm the dependency requirements are met, then pull & install it from PyPi
python3 -m pip install pilot-drive # Install from PyPi
pilot-drive # starts the service
Manual install
Requirements
Raspberry Pi 4 or other Linux SBC
python >= v3.11
node >= v16.16.0
npm >= v8.11.0
yarn >= v1.22.19
(Optional) lukasjapan’s bt-speaker -> For bluetooth audio
(Optional) python-OBD -> To use OBD connectivity features
(Optional) ancs4linux -> For iOS notification integration
(Optional) ADB -> For Android notification integration
Install
To manually build & install PILOT Drive:
git clone https://github.com/lamemakes/pilot-drive.git # Clone the repo
cd pilot-drive/
make # Run the Makefile to build the frontend & backend
cd dist/
python3 -m pip install pilot-drive-<version>.whl # Install the newly built wheel file
pilot_drive package
Subpackages
pilot_drive.master_logging package
Submodules
pilot_drive.master_logging.master_logger module
This module handles logging across PILOT Drive and is multiprocess friendly.
- class pilot_drive.master_logging.master_logger.MasterLogger(log_settings: dict)
Bases:
object
The class that handles the logger for the entire application, allowing for logging across multiple processes via the queue
- critical(msg: str) None
Log ‘msg’ with severity ‘CRITICAL’.
- Parameters:
msg – The message to be logged
- debug(msg: str) None
Log ‘msg’ with severity ‘DEBUG’.
- Parameters:
msg – The message to be logged
- error(msg: str) None
Log ‘msg’ with severity ‘ERROR’.
- Parameters:
msg – The message to be logged
- info(msg: str) None
Log ‘msg’ with severity ‘INFO’.
- Parameters:
msg – The message to be logged
- main() None
The main loop for the logger, reads from the queue and when theres is a new logging event, output it
- warning(msg: str) None
Log ‘msg’ with severity ‘WARNING’.
- Parameters:
msg – The message to be logged
Module contents
pilot_drive.master_queue package
Submodules
pilot_drive.master_queue.master_event_queue module
Module contents
pilot_drive.services package
Subpackages
pilot_drive.services.bluetooth_utils package
Submodules
pilot_drive.services.bluetooth_utils.constants module
Module contents
pilot_drive.services.phone_utils package
Submodules
pilot_drive.services.phone_utils.abstract_manager module
pilot_drive.services.phone_utils.android_manager module
pilot_drive.services.phone_utils.phone_constants module
Module contents
Submodules
pilot_drive.services.abstract_service module
pilot_drive.services.bluetooth module
pilot_drive.services.camera module
pilot_drive.services.phone module
pilot_drive.services.service_exceptions module
pilot_drive.services.settings module
pilot_drive.services.vehicle module
Module contents
pilot_drive.web package
Submodules
pilot_drive.web.web module
Module contains the static web file server
- class pilot_drive.web.web.Web(logger: MasterLogger, port: int, relative_directory: str)
Bases:
object
The class that serves the static web assets (the Vue frontend)
- handler(request, client_address, server) None
The handler that passes the request params to the SimpleHttpRequestHandler, along with the directory path
- Parameters:
request – The socket request object
client_address – The client address object
server – The socketserver.TCPServer object
- main() None
starts the server, serving static assets
Module contents
Submodules
pilot_drive.constants module
Top-level constants for PILOT Drive
pilot_drive.pilot_drive module
Module contents
The main package for PILOT Drive