Skip to content

Western-Formula-Racing/daq-radio

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Western Formula Racing - DAQ Radio System

A Western Formula Racing Open Source Project

Website

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.

🏎️ Overview

The DAQ Radio system provides end-to-end telemetry 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
  • Base Station: Radio receiver and WebSocket bridge for telemetry data
  • Car Simulator: Testing tools for development without physical hardware
  • Deployment Tools: Docker-based hosting and production deployment

πŸ—οΈ System Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”         β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”         β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   Vehicle    β”‚         β”‚     Base     β”‚         β”‚    PECAN     β”‚
β”‚   CAN Bus    β”‚ ──RF──> β”‚   Station    β”‚ ──WS──> β”‚  Dashboard   β”‚
β”‚              β”‚         β”‚   + Redis    β”‚         β”‚   (Web UI)   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜         β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜         β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Data Flow:

  1. Vehicle CAN bus messages are captured via radio transmission
  2. Base station receives RF data and publishes to Redis
  3. Redis-to-WebSocket bridge broadcasts messages to connected clients
  4. PECAN dashboard visualizes data in real-time through customizable views

πŸ“¦ Components

PECAN Dashboard (/pecan)

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

πŸ“– Detailed Documentation

Base Station (/base-station)

Python-based receiver system that bridges radio telemetry to WebSocket clients.

Components:

  • Redis Message Queue: Central message broker for telemetry data
  • WebSocket Bridge (redis_ws_bridge.py): Broadcasts Redis messages to connected web clients
  • Docker Deployment: Containerized setup with Redis included

Tech Stack: Python, Redis, WebSockets, Docker

Car Simulator (/car-simulate)

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
  • WebSocket Sender: Configurable data transmission scripts

Includes:

  • Sample CAN data files (CSV format)
  • Example DBC (CAN database) file for message definitions
  • Docker Compose setup for isolated testing environment

Host Demo (/host-demo)

Production deployment configuration for hosting the PECAN dashboard.

Features:

  • Dockerized Nginx setup for static file serving
  • SSL/HTTPS configuration support
  • Domain hosting configuration (pecan-demo.0001200.xyz)

πŸ“– Deployment Guide

πŸš€ Quick Start

Prerequisites

  • Node.js (v18+) and npm
  • Python 3.8+
  • Redis server
  • Docker and Docker Compose (for containerized deployment)

Development Setup

  1. Clone the repository:
    git clone https://github.com/Western-Formula-Racing/daq-radio.git
    cd daq-radio

Documentation WIP.

Manual Setup (Individual Components)

PECAN Dashboard

cd pecan
npm install
npm run dev

Base Station

cd base-station
pip install -r requirements.txt
python redis_ws_bridge.py

Car Simulator

cd car-simulate
python websocket_sender.py

πŸ“Š CAN Message Categories

PECAN 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

🐳 Docker Deployment

Development Environment

cd car-simulate/persistent-broadcast
docker-compose up -d

Production Deployment

cd host-demo
docker-compose up -d --build

πŸ› οΈ Development

Project Structure

daq-radio/
β”œβ”€β”€ pecan/              # React dashboard application
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ components/ # React components
β”‚   β”‚   β”œβ”€β”€ pages/      # Page components
β”‚   β”‚   β”œβ”€β”€ services/   # WebSocket and data services
β”‚   β”‚   └── config/     # Category configuration
β”‚   └── public/         # Static assets
β”œβ”€β”€ base-station/       # Radio receiver and WebSocket bridge
β”œβ”€β”€ car-simulate/       # Testing and simulation tools
β”œβ”€β”€ host-demo/          # Production hosting configuration
└── start_system.sh     # Automated startup script

Technology Stack

  • 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
  • Data Format: CAN bus (DBC files)
  • Deployment: Docker, Docker Compose, Nginx

🀝 Contributing

Contributions are welcome! This project is maintained by the Western Formula Racing team.

Development Workflow

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Test thoroughly with the simulator
  5. Submit a pull request

πŸ“ License

This project is licensed under the AGPL-3.0 License. See the LICENSE file for details.

πŸ”— Related Resources

❓ Support

For questions or issues, please open an issue on GitHub.


Built with ❀️ by Western Formula Racing

London, Ontario, Canada πŸ‡¨πŸ‡¦

About

Comprehensive telemetry and data acquisition system for real-time monitoring of formula racing vehicle performance.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 8