GitHub: Carputer-project/esp32_keyfob
2-button ESP-NOW key fob for carputer remote keyless entry. ~3-year battery life on CR2032.
| Component | Cost |
|---|---|
| ESP32 DevKit (or ESP32-C3 for lower power) | ~$3-5 |
| 2× momentary push buttons | ~$1 |
| CR2032 battery holder | ~$1 |
| Total | ~$5-7 |
| Button | GPIO | Function |
|---|---|---|
| BTN1 | GPIO 0 | Lock / Unlock (toggle) |
| BTN2 | GPIO 2 | Remote start (hold 2s) |
Uses ESP-NOW (no WiFi router needed) — direct peer-to-peer communication with the body controller.
| Action | Button | Payload |
|---|---|---|
| Lock/Unlock | BTN1 (press) | {"cmd":"lock","hmac":"..."} |
| Remote Start | BTN2 (hold 2s) | {"cmd":"rstart","hmac":"..."} |
HMAC-SHA256 challenge-response:
- Key derived from VIN + module secret (set at bind time)
- Nonce included to prevent replay attacks
- Body controller validates HMAC before executing commands
cd esp32_keyfob
pio run # Build
pio run --target upload # FlashEdit platformio.ini to set:
WIFI_CHANNEL— ESP-NOW channel (must match body controller)- Button GPIO pins in
build_flags
- ESP32 Arduino core (built-in ESP-NOW support)
- ArduinoJson — JSON serialization (v7)
Deep sleep between button presses. Wake on GPIO interrupt. Estimated ~3 years on CR2032 with typical use (10 presses/day).