OBD2 Dashboard is a real-time vehicle monitoring application that provides live insights into your vehicle's performance using OBD2 data. Built with .NET 8.0 backend and React frontend, it features a Mustang-themed dashboard with WebSocket-based real-time updates.
- π Real-time vehicle diagnostics via WebSocket
- π¨ Mustang-themed interactive dashboard with custom gauges
- ποΈ RPM gauge, speedometer, coolant temperature, and gear indicator
- π Direct ELM327 OBD2 adapter support
- π³ Docker containerized deployment
- π± Raspberry Pi deployment support
- π§ OBD2 emulator for testing without a vehicle
for backend
for frontend
with TypeScript
(for OBD2 emulator only)
(optional, for testing)
- socat (for virtual serial port emulation)
- Docker & Docker Compose (for containerized deployment)
- ELM327-compatible OBD2 adapter (for real vehicle connection)
- Backend: .NET 8.0 C# with WebSocket communication for real-time data streaming
- Frontend: React 18 with TypeScript and custom dashboard components
- Communication: AT command manager for OBD2 protocol handling
- Deployment: Docker Compose for containerized services
- Target Platforms: Linux (x64, ARM), Raspberry Pi, Windows (development)
- Clone the repository
git clone https://github.com/hitmanpc/obd2dashboard.git
cd obd2dashboard- Start all services (backend, frontend, and emulator)
docker-compose up --build -d- Access the dashboard
- Frontend: http://localhost:3000
- Backend WebSocket: ws://localhost:8000
docker-compose downFor production deployment with nginx reverse proxy:
docker-compose -f docker-compose.yml -f docker-compose.prod.yml up -dSee the Quick Start Guide for streamlined Raspberry Pi deployment, or detailed Raspberry Pi deployment docs for step-by-step instructions.
# One-command deployment on Raspberry Pi
curl -fsSL https://raw.githubusercontent.com/hitmanpc/obd2dashboard/main/deploy-pi.sh -o deploy-pi.sh
chmod +x deploy-pi.sh
./deploy-pi.sh- Navigate to backend directory
cd backend- Build the project
dotnet build- Run the application
dotnet runOr use the VS Code tasks:
- Press
Ctrl+Shift+Bto build - Use "watch" task for auto-reload during development
- Navigate to frontend directory
cd frontend- Install dependencies
npm install- Start development server
npm startThe frontend will be available at http://localhost:3000
Before starting the application, start the OBD2 emulator to simulate vehicle data:
cd emulator
python -m elm -n 35000 --daemonYou should see: ELM327-emulator daemon service STARTED on /dev/pts/<x>
Check emulator status:
ps aux | grep elmStop emulator:
kill <pid>To create a virtual serial port mapped to the emulator:
cd emulator
./tcp2UsbScript.shThis script will:
- Start the ELM327 emulator as a daemon on TCP port 35000
- Create a virtual serial port at
/virtual/usb1using socat - Monitor and auto-restart the emulator if it crashes
- Clean up processes on exit
- Connect your ELM327 OBD2 adapter via USB to your computer/Raspberry Pi
- Find the device:
ls /dev/ttyUSB*orls /dev/ttyACM* - Set the OBD_PORT environment variable:
export OBD_PORT=/dev/ttyUSB0 - Update docker-compose.yml to map the correct device:
devices: - "/dev/ttyUSB0:/dev/ttyUSB0"
Open your browser and navigate to:
http://localhost:8000
You should see WebSocket connection status.
Open your browser and navigate to:
http://localhost:3000
You should see the Mustang-themed dashboard:
Main files:
backend/src/Program.cs- Application entry point and WebSocket setupbackend/src/Services/ObdService.cs- OBD2 communication servicebackend/src/Commands/AtCommands.cs- AT command definitionsbackend/appsettings.json- Application configuration
Environment Variables:
OBD_PORT- Serial port for OBD2 adapter (default:/virtual/usb1)
Main files:
frontend/src/components/MustangDashboard.tsx- Main dashboard UIfrontend/src/hooks/useWebSocket.ts- WebSocket connection hookfrontend/src/types/index.ts- TypeScript type definitions
Customize the dashboard:
- Modify gauge components in
frontend/src/components/ - Update styling in
*.cssfiles - Configure OBD PIDs in backend configuration
Configure which OBD2 parameters to query in:
-
β Cannot connect to OBD2 adapter
- Verify device is connected:
ls /dev/ttyUSB*orls /dev/ttyACM* - Check permissions:
sudo chmod 666 /dev/ttyUSB0 - Add user to dialout group:
sudo usermod -aG dialout $USER && sudo reboot - Verify OBD_PORT environment variable is correct
- Verify device is connected:
-
β Emulator not working
- Ensure Python ELM327 emulator is installed:
pip install ELM327-emulator - Check if emulator is running:
ps aux | grep elm - Verify virtual serial port exists:
ls /virtual/usb1 - Ensure socat is installed:
sudo apt-get install socat
- Ensure Python ELM327 emulator is installed:
-
β Backend won't start
- Verify .NET 8.0 SDK is installed:
dotnet --version - Check for port conflicts on port 8000
- Review logs:
docker-compose logs obd_backend - Ensure serial port device is accessible
- Verify .NET 8.0 SDK is installed:
-
β WebSocket connection failed
- Check backend is running and accessible
- Verify firewall allows WebSocket connections
- Ensure CORS is properly configured for your domain
-
β Dashboard not loading
- Verify Node.js is installed:
node --version - Clear npm cache:
npm cache clean --force - Delete node_modules and reinstall:
rm -rf node_modules && npm install - Check for port conflicts on port 3000
- Verify Node.js is installed:
-
β No data displayed
- Verify WebSocket connection in browser console
- Check backend logs for OBD2 communication errors
- Ensure OBD2 adapter/emulator is responding
-
β Permission denied
- Add user to docker group:
sudo usermod -aG docker $USER - Reboot system:
sudo reboot
- Add user to docker group:
-
β Cannot access devices in container
- Verify device mapping in docker-compose.yml
- Use
--privilegedflag if necessary (not recommended for production)
-
β Insufficient memory
- Increase swap size
- Use production build instead of development:
docker-compose -f docker-compose.prod.yml up -d
-
β Slow performance
- Ensure using ARM-optimized images
- Consider pre-building on faster machine and deploying image
For more help, check the Raspberry Pi deployment guide or create an issue on GitHub.
obd2dashboard/
βββ backend/ # .NET 8.0 C# backend
β βββ src/
β β βββ Program.cs # Application entry point
β β βββ Commands/ # AT command definitions
β β βββ Communication/ # OBD2 communication layer
β β βββ Configuration/ # OBD PID configurations
β β βββ Services/ # ObdService, WebSocketService
β βββ appsettings.json # App configuration
β βββ ObdDashboard.csproj # .NET project file
βββ frontend/ # React TypeScript frontend
β βββ src/
β β βββ components/ # Dashboard UI components
β β β βββ MustangDashboard.tsx
β β βββ hooks/ # React hooks (WebSocket)
β β βββ types/ # TypeScript definitions
β βββ package.json
βββ emulator/ # OBD2 emulator for testing
β βββ tcp2UsbScript.sh # Virtual serial port setup
β βββ Dockerfile
βββ docs/ # Documentation
β βββ raspberry-pi-deployment.md
βββ docker-compose.yml # Development setup
βββ docker-compose.prod.yml # Production setup
βββ deploy-pi.sh # Raspberry Pi deployment script
βββ README.md
We welcome contributions! Here's how to get started:
- π΄ Fork the repository
- πΏ Create a feature branch
git checkout -b feature/your-feature-name
- πΎ Commit your changes
git commit -m "Add your feature description" - π€ Push to the branch
git push origin feature/your-feature-name
- π Create a Pull Request
- Follow C# coding conventions for backend (.NET guidelines)
- Use TypeScript and follow React best practices for frontend
- Write meaningful commit messages
- Test your changes with both emulator and real OBD2 adapter (if possible)
- Update documentation as needed
This project is licensed under the MIT License. You are free to use, modify, and distribute this software, provided you give appropriate credit.
- ELM327 Command Reference
- OBD2 PIDs Wikipedia
- ELM327 Emulator
- .NET 8.0 Documentation
- React Documentation
Email: [email protected]
Issues: https://github.com/hitmanpc/obd2dashboard/issues
Built with β€οΈ for car enthusiasts and developers
