A Western Formula Racing Open Source Project
Comprehensive telemetry and data acquisition system for real-time monitoring of formula racing vehicle performance. This system captures CAN bus data from the vehicle, transmits it to a base station, and visualizes it through an interactive web dashboard.
π Quick Start β macOS Base Station
curl -fsSL https://raw.githubusercontent.com/Western-Formula-Racing/data-acquisition/main/universal-telemetry-software/deploy/install.sh | bash
The repository contains the end-to-end telemetry software for Western Formula Racing vehicles, enabling real-time monitoring of critical vehicle systems during testing and competition. The system consists of:
- PECAN Dashboard: Real-time web-based visualization of vehicle telemetry
- Universal Telemetry Software (
/universal-telemetry-software): Car and base station software for CAN acquisition, transport, WebSocket bridging, and base-side Redis/TimescaleDB integration
flowchart LR
ECU["Vehicle CAN Bus (ECU)"]
HAT["Raspberry Pi CAN HAT"]
EDGE["Car Raspberry Pi
(native systemd service)"]
BASE["Base Station
(UTS base mode)"]
REDIS["Redis"]
DASH["PECAN Dashboard
(Web UI)"]
TIMESERIES["TimescaleDB
(server stack)"]
GRAFANA["Grafana
(server stack)"]
FLIGHTREC["Flight Recorder
(phone store-and-forward relay)"]
DOWNLOADER["Data Downloader
(server stack)"]
ECU -->|CAN| HAT
HAT -->|SPI / CAN| EDGE
EDGE -->|RF| BASE
BASE --> REDIS
REDIS -->|WebSocket| DASH
BASE -->|direct write| TIMESERIES
TIMESERIES --> GRAFANA
FLIGHTREC -->|store-and-forward upload| DOWNLOADER
DOWNLOADER --> TIMESERIES
Data Flow:
- Vehicle CAN bus messages are read by the car-side Universal Telemetry Software running as a native
car-telemetry.servicesystemd service on the Raspberry Pi - The car service packs messages in UDP/TCP for radio or Ethernet transmission
- The base-side UTS receives telemetry and publishes it to Redis
- Redis-to-WebSocket bridge broadcasts messages to connected clients (PECAN dashboard)
- Base-side TimescaleDB bridge writes decoded CAN frames directly to the server stack's TimescaleDB over the network
- Grafana visualizes historical data from TimescaleDB; Flight Recorder can relay phone-recorded runs to the data downloader API when the full base-station stack is not present
For the detailed WebSocket message contract between PECAN and UTS, see WEBSOCKET_PROTOCOL.md.
Demo: https://western-formula-racing.github.io/data-acquisition/dashboard
A modern React + TypeScript web application for real-time telemetry visualization.
Features:
- Real-time CAN message visualization with WebSocket connection
- Customizable category-based filtering and color-coding
- Multiple view modes (cards, list, flow diagrams)
- Interactive charts and graphs using Plotly.js
- Built with Vite, React 19, and Tailwind CSS
Tech Stack: React 19, TypeScript, Vite, Tailwind CSS, React Bootstrap, Plotly.js
Complete DAQ telemetry stack for the car Raspberry Pi and base station. UTS uses the same Python source and role-specific runtime logic on both ends; the car runs that shared code natively as car-telemetry.service, while base stations run it through Docker Compose with Redis, WebSocket, status, video relay, and optional TimescaleDB logging.
Features:
- Shared car/base telemetry logic in one Python codebase
- Native car systemd deployment with direct CAN read, UDP streaming, TCP packet resend, and direct WebSocket support
- Docker Compose base-station deployment for MacBook or Raspberry Pi
- UDP and TCP telemetry transport with packet recovery
- Base-side Redis publisher, WebSocket bridge, and status HTTP server
- Optional TimescaleDB logging (direct write to server TimescaleDB), audio/video streaming, and simulation mode
Tech Stack: Python, systemd, Redis, WebSockets, Docker, TimescaleDB
Development and testing tools for simulating vehicle telemetry without physical hardware.
Features:
- CSV Data Playback: Replay recorded CAN data from CSV files
- Persistent WebSocket Server: Continuous data broadcasting for testing via
car-simulate/persistent-broadcast - WebSocket Sender / container scaffolding: Minimal Docker setup and example clients for local experiments
Includes:
- Sample CAN data files (CSV format)
- Example DBC (CAN database) file for message definitions
- Docker Compose setups for isolated testing environments, including a dev/demo server configuration in
car-simulate/persistent-broadcast
GUI adapters for Kvaser and PECAN CAN hardware interfaces. Used during bench testing when physical vehicle hardware is unavailable.
Supported phone-based store-and-forward telemetry recorder for lightweight run recording and upload. Put a phone on the car hotspot, point Flight Recorder at the car UTS WebSocket, record telemetry into browser storage during the run, then sync the captured data to the server database when WiFi or cellular access is available. This gives the team a permanent no-SD-card workflow for ECU_25 run data when the full base-station stack is not set up.
Use cases:
- Quick shakedown runs without setting up the full base station
- Phone-backed database ingest when the car is running on its hotspot
- No-SD-card upload path for
ECU_25run data - Store-and-forward recording when server connectivity is intermittent
Notes:
- Not the primary live telemetry dashboard; use PECAN + UTS for real-time monitoring
- Stores received CAN frames locally in browser IndexedDB first, then marks them synced only after upload
- Uploads decoded signal batches via
POST /api/can-frames/batchon the data-downloader API - Has separate guarded controls for
WS RelayandDB Forward; live relay and TimescaleDB upload can be used independently - The phone must stay connected to the car hotspot and keep the page open during the run
- Supersedes the
lte-relaybranch for no-SD-card database ingest; optional remote live relay uses the public Wrangler Worker inflight-recorder/relay-workerto receive phone-forwarded WebSocket frames and rebroadcast them
Internal app: https://fdr.westernformularacing.org (wfr-fdr.pages.dev, protected by Cloudflare Zero Trust)
Convenience deployment for the PECAN WebSocket broadcast server. The dashboard is hosted at pecan.westernformularacing.org (GitHub Pages); this backend provides live CAN data over ws:// or wss://.
Features:
- Runs the broadcast server with production defaults
- Standard + extended CAN IDs, accumulator simulation
- Optional CSV replay
- Node.js (v18+) and npm
- Python 3.11+
- Docker and Docker Compose (for containerized deployment)
- A cloned copy of this repository
The MacBook base station runs the UTS telemetry stack + Pecan dashboard locally.
The committed deploy/.env.macbook has the LAN defaults most teammates need.
cd universal-telemetry-software/
docker compose -f deploy/docker-compose.macbook-base.yml --env-file deploy/.env.macbook up -dOpen http://localhost:3000 for Pecan, http://localhost:8080 for the status page.
Add --profile timescale, --profile media, or --profile tunnel only when those optional services are needed.
See deploy/MACBOOK_DEPLOY.md for full setup details.
The car runs the telemetry stack natively through systemd, without Docker or Redis:
cd /home/car/data-acquisition/universal-telemetry-software
uv sync
sed -i "s/GIT_HASH=unknown/GIT_HASH=$(git rev-parse --short HEAD)/" deploy/car-telemetry.service
sudo cp deploy/car-telemetry.service /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable car-telemetry
sudo systemctl start car-telemetryThe service is configured for ROLE=car, REMOTE_IP=10.71.1.20, UDP 5005, TCP resend 5006, and local PECAN WebSocket 9080. See deploy/CAR_DEPLOY.md for full setup and update commands.
The Raspberry Pi base station still uses Docker Compose:
cd universal-telemetry-software/
docker compose -f deploy/docker-compose.rpi-base.yml up -dSee the UTS README for hardware setup and base-station options.
Deploy the server-side stack on a VPS:
cd server/installer/
cp .env.example .env
# Edit .env β set passwords and domain
docker compose up -dServices: TimescaleDB (5432), Grafana (8087), data-downloader API, file-uploader, health-monitor.
- Clone the repository:
Documentation lives in component READMEs such as
git clone https://github.com/Western-Formula-Racing/data-acquisition.git cd data-acquisitionpecan/README.mdanduniversal-telemetry-software/README.md.
cd pecan
npm install
npm run devcd universal-telemetry-software/
docker compose -f deploy/docker-compose.macbook-base.yml --env-file deploy/.env.macbook up -dcd car-simulate/persistent-broadcast
docker compose up -dPECAN supports configurable message categorization through a simple text-based configuration file. This allows customization of message grouping and color-coding without code changes.
Configuration: pecan/src/assets/categories.txt
Example categories:
- VCU (Vehicle Control Unit)
- BMS (Battery Management System)
- INV (Inverter)
- TEST MSG
π Category Configuration Guide
cd car-simulate/persistent-broadcast
docker compose up -dcd ws-backend
docker compose up -d --builddata-acquisition/
βββ universal-telemetry-software/ # Shared car/base telemetry code with systemd and Docker deploys
β βββ src/ # Python telemetry source
β βββ deploy/ # Car systemd service and base Docker Compose files
β βββ status/ # Status page HTML
βββ pecan/ # React live dashboard (GitHub Pages)
β βββ src/
β βββ components/ # React components
β βββ pages/ # Page components
β βββ services/ # WebSocket and data services
βββ flight-recorder/ # React data recording PWA
βββ car-simulate/ # CAN data simulators (CSV playback, WebSocket broadcast)
βββ ws-backend/ # WebSocket broadcast server for PECAN
βββ server/ # VPS server stack (TimescaleDB, Grafana, data APIs)
β βββ installer/ # Docker Compose stack for server
β βββ timescaledb/ # DB init scripts and schema
β βββ grafana/ # Dashboards and provisioning
β βββ grafana-bridge/ # Pecan β Grafana API bridge
β βββ data-downloader/ # FastAPI query builder
β βββ file-uploader/ # CSV upload web UI
β βββ health-monitor/ # Container health monitoring
β βββ sandbox/ # Python execution sandbox
β βββ slackbot/ # Slack bot
βββ secret-dbc/ # Git submodule: private DBC files (restricted)
βββ kvaser-bridge/ # Kvaser CAN adapter GUI
βββ pecan-bridge/ # PECAN CAN adapter
βββ grafana-worker/ # Cloudflare Workers proxy for Grafana
- Frontend: React 19, TypeScript, Tailwind CSS, React Bootstrap
- Visualization: Plotly.js for interactive charts and graphs
- Build Tools: Vite
- Backend: Python, asyncio, WebSockets
- Message Broker: Redis
- Time-Series DB: TimescaleDB (PostgreSQL)
- Data Format: CAN bus (DBC files)
- Deployment: Docker, Docker Compose, Nginx
Contributions are welcome! This project is maintained by the Western Formula Racing team.
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly with the simulator
- Submit a pull request
This project is licensed under the AGPL-3.0 License. See the LICENSE file for details.
- PECAN Project Page: Project PECAN
- Live Demo: Demo
For questions or issues, please open an issue on GitHub.
Built with β€οΈ by Western Formula Racing
London, Ontario, Canada π¨π¦
