|
| 1 | +# Blackbox v0.0.1 - First Release 🚀 |
| 2 | + |
| 3 | +ESP32-C3 vehicle telemetry system with built-in mobile dashboard and dual WiFi modes. |
| 4 | + |
| 5 | +## 🎯 Major Features |
| 6 | + |
| 7 | +### Built-in Mobile Dashboard |
| 8 | +- Mobile-optimized web interface running directly on ESP32 |
| 9 | +- Real-time telemetry display at ~20 Hz via HTTP polling |
| 10 | +- G-meter with enhanced trail visualization and glow effects |
| 11 | +- Live speed display with car speedometer-like smoothing |
| 12 | +- Mode detection visualization (6 states including combined modes) |
| 13 | +- Session timer and GPS coordinates |
| 14 | +- CSV data recording and export |
| 15 | +- **Live settings configuration** with validation |
| 16 | + |
| 17 | +**Usage:** Connect phone to `Blackbox` WiFi → Open browser to `http://192.168.4.1` |
| 18 | + |
| 19 | +### Dual WiFi Operating Modes |
| 20 | + |
| 21 | +**Access Point Mode (Default)** |
| 22 | +- ESP32 creates its own WiFi network - no router required |
| 23 | +- Perfect for track days, autocross, mobile use |
| 24 | +- Fixed IP: `192.168.4.1:80` |
| 25 | +- SSID: `Blackbox` / Password: `blackbox123` |
| 26 | + |
| 27 | +**Station Mode** |
| 28 | +- ESP32 connects to your existing WiFi network |
| 29 | +- UDP telemetry streaming (20 Hz) to laptop |
| 30 | +- MQTT status messages |
| 31 | +- For data logging and multi-client scenarios |
| 32 | + |
| 33 | +### Enhanced Mode Detection |
| 34 | +- **6 driving states:** IDLE, ACCEL, BRAKE, CORNER, ACCEL+CORNER, BRAKE+CORNER |
| 35 | +- Combined states using bitflags (e.g., trail braking = BRAKE+CORNER) |
| 36 | +- Independent component detection with hysteresis |
| 37 | +- Tuned for street driving (lowered acceleration threshold to 0.10g) |
| 38 | +- **177 comprehensive unit tests** |
| 39 | + |
| 40 | +## 🔧 Hardware Requirements |
| 41 | + |
| 42 | +- **ESP32-C3** microcontroller |
| 43 | +- **WT901** 9-axis IMU (UART, 200Hz) |
| 44 | +- **NEO-6M** GPS module (UART, 5Hz) |
| 45 | +- **WS2812** RGB LED (status indicator) |
| 46 | + |
| 47 | +## 📥 Installation |
| 48 | + |
| 49 | +### Flash the Firmware |
| 50 | + |
| 51 | +**Method 1: Using espflash (recommended)** |
| 52 | +```bash |
| 53 | +espflash write-bin 0x0 blackbox-v0.0.1.bin |
| 54 | +``` |
| 55 | + |
| 56 | +**Method 2: Using ESP Web Flasher** |
| 57 | +1. Go to https://espressif.github.io/esptool-js/ |
| 58 | +2. Connect ESP32-C3 via USB |
| 59 | +3. Select `blackbox-v0.0.1.bin` |
| 60 | +4. Flash offset: `0x0` |
| 61 | +5. Click "Program" |
| 62 | + |
| 63 | +### First Boot |
| 64 | +1. Power on ESP32 - LED shows boot sequence (see README for codes) |
| 65 | +2. **AP Mode (default):** Connect phone to WiFi network "Blackbox" (password: `blackbox123`) |
| 66 | +3. Open browser to `http://192.168.4.1` |
| 67 | +4. View live telemetry! |
| 68 | + |
| 69 | +### Switch to Station Mode |
| 70 | +To use UDP streaming and MQTT (requires rebuild): |
| 71 | +```bash |
| 72 | +export WIFI_MODE="station" |
| 73 | +export WIFI_SSID="YourNetwork" |
| 74 | +export WIFI_PASSWORD="YourPassword" |
| 75 | +export MQTT_BROKER="mqtt://192.168.1.100:1883" |
| 76 | +export UDP_SERVER="192.168.1.100:9000" |
| 77 | +cargo build --release |
| 78 | +# Then flash the new binary |
| 79 | +``` |
| 80 | + |
| 81 | +## 📊 Dashboard Features |
| 82 | + |
| 83 | +- **G-meter:** Real-time visualization with gradient trail, tick marks, enhanced glow |
| 84 | +- **Max G tracking:** L/R/Accel/Brake peak values |
| 85 | +- **Speed display:** EMA-filtered for smoothness (like car speedometer) |
| 86 | +- **Mode indicator:** Visual icons for each driving state |
| 87 | +- **Settings:** Adjust all 8 mode detection thresholds live |
| 88 | +- **Recording:** Capture session data and export to CSV |
| 89 | + |
| 90 | +## 🎨 Technical Highlights |
| 91 | + |
| 92 | +- 7-state Extended Kalman Filter for sensor fusion |
| 93 | +- Zero-velocity updates (ZUPT) prevent drift when stopped |
| 94 | +- Gravity-compensated accelerations |
| 95 | +- GPS warmup with local coordinate mapping |
| 96 | +- HTTP polling architecture (replaced WebSocket to fix thread blocking) |
| 97 | +- Binary telemetry protocol (67 bytes, 20Hz) |
| 98 | +- Configurable mode detection thresholds |
| 99 | + |
| 100 | +## 📝 Binary Protocol |
| 101 | + |
| 102 | +Mode byte changed to bitflags: |
| 103 | +- `0` = IDLE |
| 104 | +- `1` = ACCEL |
| 105 | +- `2` = BRAKE |
| 106 | +- `4` = CORNER |
| 107 | +- `5` = ACCEL+CORNER (trail throttle) |
| 108 | +- `6` = BRAKE+CORNER (trail braking) |
| 109 | + |
| 110 | +## 🐛 Known Issues |
| 111 | + |
| 112 | +None reported yet! This is the first release. |
| 113 | + |
| 114 | +## 📚 Documentation |
| 115 | + |
| 116 | +- [README](https://github.com/jctoledo/blackbox/blob/main/README.md) - Full setup guide |
| 117 | +- [CLAUDE.md](https://github.com/jctoledo/blackbox/blob/main/CLAUDE.md) - Architecture details |
| 118 | +- [Hardware Setup](https://github.com/jctoledo/blackbox/blob/main/sensors/blackbox/README.md) - Pin assignments |
| 119 | + |
| 120 | +## 🙏 Credits |
| 121 | + |
| 122 | +Built with: |
| 123 | +- Rust ESP-IDF framework |
| 124 | +- ESP32-C3 RISC-V chip |
| 125 | +- motorsport-telemetry library |
| 126 | + |
| 127 | +--- |
| 128 | + |
| 129 | +**Full Changelog:** https://github.com/jctoledo/blackbox/compare/...v0.0.1 |
0 commit comments