Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions .github/ci/esp-lte-mtls.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# CI only: an ESP32-S3 on LTE with MQTT over mTLS, so the TLS code (the `mqtt-tls`
# feature, off in the example config) is linted and built on Xtensa. ci.yml makes
# CI only: an ESP32-S3 on WiFi and LTE (relay with LTE fallback, LAN direct on WiFi)
# with MQTT over mTLS, so the TLS code (the `mqtt-tls` feature, off in the example
# config) and the dual uplink are linted and built on Xtensa. ci.yml makes
# throwaway certificates in /tmp/mqtt-certs first.
# ==============================================
# OPEN CAR INTERFACE - BUILD CONFIGURATION
Expand Down Expand Up @@ -83,12 +84,14 @@ interface = "vcan0"
# ===========================

[network.wifi]
enabled = false
enabled = true
ssid = "YourSSID"
password = "YourPassword"

# LTE uplink instead of WiFi (one uplink per build: set [network.wifi].enabled = false).
# Needs a board with a modem, e.g. hardware_profile = "lilygo-t-sim7670g-s3". See docs/lte.md.
[network.lan]
enabled = true

# LTE together with WiFi: the relay prefers WiFi and falls back to LTE. See docs/lte.md.
[network.lte]
enabled = true
apn = "your.carrier.apn"
Expand All @@ -106,7 +109,6 @@ port = 23
# Use mqtt:// for basic auth (plain TCP). Use mqtts:// for mTLS.
broker_url = "mqtts://broker.example.com"
# Names this device's MQTT topics, and the app learns it over BLE: give each device its own.
client_id = "dev-car"

# Specify the type of authentication to the broker.
# - `basic` is for username/password combo (no certs needed)
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@ ssid = "YourSSID"
password = "YourPassword"

[network.mqtt]
broker_url = "mqtts://broker.example.com" # mqtt:// is plain TCP: only on a network you trust
auth_mode = "mtls" # or "basic" (username/password)
broker_url = "mqtt://192.168.0.100:1883" # or mqtts:// for TLS
auth_mode = "basic" # "none", "basic" (username/password) or "mtls"
```

A broker on the internet (any LTE setup) should use `mqtts://` with `auth_mode = "mtls"`: see [MQTT over TLS](docs/mqtt-tls.md) for the certificates and the broker's settings.
Any MQTT broker works as a relay for remote access: the app and the device talk through it with the end-to-end encrypted secure channel, so the broker never sees the state or the commands, and TLS and broker credentials are optional hardening. See [MQTT relay](docs/mqtt-relay.md).

To reach the broker over a cellular modem instead of WiFi, disable `[network.wifi]` and set the SIM's APN in `[network.lte]` (see [LTE](docs/lte.md)). Per-board settings live under `[hardware.esp]` / `[hardware.pc]`, including CAN buses (`[[hardware.<board>.can_buses]]`, where order determines `bus_id`) and BLE options. The `board` and `platform` values can be overridden with `--board` and `--platform`. To reverse engineer a car, `[network.can_logger] enabled = true` streams the CAN buses to SavvyCAN over WiFi (see [CAN bus](docs/can.md#savvycan-logging)). Hardware profiles in `hardware-profiles/` are ready-made pin/CAN setups for specific devices; anything set in `config.toml`, including `board`, wins over the profile.

Expand Down Expand Up @@ -96,7 +96,7 @@ The firmware is a Cargo workspace of independently compiled crates that cooperat
┌───────▼──────────────────▼──────────────┐
│ core-interface │
│ static Channels · Embassy tasks │
│ platform_id gating · BLE/MQTT routing │
│ platform_id gating · routing · Noise │
└─────────────────────────────────────────┘
```

Expand All @@ -107,7 +107,7 @@ The firmware is a Cargo workspace of independently compiled crates that cooperat
| `cars/*` | Vehicle logic: CAN decoding, command handling, state encoding |
| `xtask` | Build orchestrator: reads `config.toml`, generates `.app_build/`, invokes cargo |

Details: [Architecture](docs/architecture.md) · [BLE](docs/ble.md) · [CAN bus](docs/can.md) · [LAN direct](docs/lan.md) · [LTE](docs/lte.md) · [MQTT over TLS](docs/mqtt-tls.md) · [Vehicle commands](docs/commands.md)
Details: [Architecture](docs/architecture.md) · [BLE](docs/ble.md) · [CAN bus](docs/can.md) · [LAN direct](docs/lan.md) · [LTE](docs/lte.md) · [MQTT relay](docs/mqtt-relay.md) · [Vehicle commands](docs/commands.md)

## 📂 Project Structure

Expand Down
3 changes: 1 addition & 2 deletions boards/esp/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! Board support crate for the ESP32 family.
//!
//! Wires the `core-interface` task set to ESP32-specific hardware drivers: BLE
//! (trouble-host), WiFi or LTE (esp-radio or a PPP modem, + embassy-net) with MQTT and, on WiFi, LAN direct, and CAN buses (TWAI and/or
//! (trouble-host), WiFi and/or LTE (esp-radio or a PPP modem, + embassy-net) with MQTT and, on WiFi, LAN direct, and CAN buses (TWAI and/or
//! MCP2515). The public API is kept minimal: [`start`] spawns the core protocol
//! tasks, and hardware-init functions are re-exported for use by the generated
//! `main.rs` entry point produced by `xtask`.
Expand Down Expand Up @@ -59,7 +59,6 @@ mod hardware {
pub fn start(spawner: &embassy_executor::Spawner) {
status_leds::set_flag(status_leds::FLAG_POWER, true);
spawner.spawn(core_interface::process_ble_commands_task().unwrap());
spawner.spawn(core_interface::process_mqtt_commands_task().unwrap());
spawner.spawn(core_interface::route_responses_task().unwrap());
spawner.spawn(core_interface::publish_state_task().unwrap());
spawner.spawn(core_interface::publish_can_access_task().unwrap());
Expand Down
Loading