- Rust 55%
- Kotlin 39%
- Nix 3%
- Shell 3%
- Java <1%
Tesla Door #
An ESP32 door unlocker and a Native Shell (nsh) phone app. The workspace keeps the three parts at equal depth:
| Crate | Purpose |
|---|---|
crates/esp32 |
BLE door firmware and LED indicators |
crates/phone |
Rust nsh app, native platform packaging, and macOS CLI |
crates/protocol |
Shared versioned wire protocol |
See the protocol and phone setup.
nix develop
cd crates/esp32
cargo build --release
espflash flash --chip esp32s3 ../../target/xtensa-esp32s3-none-elf/release/tesla-door
The ESP-IDF partition table used by espflash reserves nvs at
0x9000..0xf000, before the factory app at 0x10000. The door stores its state
in the first two nvs sectors (0x9000..0xb000). A normal espflash flash
updates the bootloader, partition table, and app image while preserving that
data partition. Keep the same partition layout when updating firmware. A full
flash erase or an explicit erase of nvs resets pairing and revocation; the
nvs partition should be empty when provisioning a new door.
nix develop
cargo build --release -p tesla-door-phone
sh scripts/run-phone-macos.sh
The firmware stores pairing and revocation state in the ESP-IDF nvs flash
partition. An open is represented by an LED flash; the vibration sensor and
servo are not connected.