GitHub: Carputer-project/esp32_mesh_module
Vehicle-to-vehicle mesh network module. Broadcasts beacons and relays alerts between nearby cars using ESP-NOW multi-hop.
| Component | Cost |
|---|---|
| ESP32 DevKit | ~$3-5 |
| Total | ~$3-5 |
[Car A] ──mesh──> [Car B] ──mesh──> [Car C]
│ │
└── body controller ← TCP/UART ── mesh ESP32
Each car has a dedicated mesh ESP32 that talks to its body controller via TCP/UART. The mesh module handles:
- Beacon broadcast (vehicle presence)
- Alert relay (alarm, hazard, emergency)
- Hop routing (multi-car forwarding)
Key principle: Each radio has one job. Mesh module does NOT handle WiFi AP, sensor data, or phone connections.
| Port | Protocol | Purpose |
|---|---|---|
| 5010 | UDP broadcast | Beacons + vehicle data (speed, RPM, gear) |
| 5011 | UDP unicast | Remote commands (fob/phone → body controller) |
| 5012 | UDP broadcast | Alarm events |
{
"id": "module_hash_id",
"vin": "vehicle_vin",
"type": "mesh",
"data": {
"speed": 60,
"rpm": 2500,
"gear": 3,
"alert": false
}
}Beacons are forwarded up to 3 hops with TTL decrement. Each module tracks seen beacons to prevent loops.
cd esp32_mesh_module
pio run # Build
pio run --target upload # Flash- ESP32 Arduino core (built-in ESP-NOW support)
- ArduinoJson — JSON parsing (v7)
- Module identity:
prefix + hash(MAC + VIN + salt)— unique per module per car - HMAC authentication for relay commands
- Nonce window prevents replay attacks
- 4-digit PIN pairing for initial setup