Skip to content
Merged
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
17 changes: 17 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,23 @@ jobs:
- name: Build Firmware via xtask
run: cargo xtask build --board ${{ matrix.board }} --platform ${{ matrix.platform }}

# LAN direct is off in the example config, which leaves the ESP's LAN code (the `lan`
# feature) out. Lint and build it too, on the example's WiFi ESP32-C3.
- name: Make a WiFi config with LAN direct
if: matrix.board == 'esp'
run: |
sed '/^\[network.lan\]/,/^\[/ s/^enabled = false/enabled = true/' \
config.toml.example > /tmp/esp-wifi-lan.toml
grep -A1 '^\[network.lan\]' /tmp/esp-wifi-lan.toml | grep -q '^enabled = true'

- name: Run Clippy via xtask (ESP, LAN direct)
if: matrix.board == 'esp'
run: cargo xtask clippy /tmp/esp-wifi-lan.toml --platform ${{ matrix.platform }}

- name: Build Firmware via xtask (ESP, LAN direct)
if: matrix.board == 'esp'
run: cargo xtask build /tmp/esp-wifi-lan.toml --platform ${{ matrix.platform }}

# The example config uses plain MQTT, which leaves the ESP's TLS code (the
# `mqtt-tls` feature) out. Lint and build it too, on Xtensa over LTE.
- name: Make throwaway MQTT certificates
Expand Down
18 changes: 16 additions & 2 deletions boards/esp/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,21 @@ mqtt-tls = [
"dep:esp-alloc",
]

# Chip features — `hardware` (with `mqtt-tls`) plus the chip on every ESP dependency, for rust-analyzer.
# LAN direct (docs/lan.md): TCP connections, UDP discovery and mDNS on the WiFi stack.
# xtask enables it for WiFi builds with [network.lan].enabled.
lan = [
"hardware",
"embassy-net/udp",
"embassy-net/multicast",
"dep:esp-alloc",
]

# Chip features — `hardware` (with `mqtt-tls` and `lan`) plus the chip on every ESP dependency, for rust-analyzer.
# Selected automatically by `cargo xtask ide` from the MCU in config.toml.
esp32 = [
"hardware",
"mqtt-tls",
"lan",
"esp-hal/esp32",
"esp-println/esp32", "esp-println/auto",
"esp-radio/esp32",
Expand All @@ -56,6 +66,7 @@ esp32 = [
esp32s3 = [
"hardware",
"mqtt-tls",
"lan",
"esp-hal/esp32s3",
"esp-println/esp32s3", "esp-println/auto",
"esp-radio/esp32s3",
Expand All @@ -65,6 +76,7 @@ esp32s3 = [
esp32c3 = [
"hardware",
"mqtt-tls",
"lan",
"esp-hal/esp32c3",
"esp-println/esp32c3", "esp-println/jtag-serial",
"esp-radio/esp32c3",
Expand All @@ -74,6 +86,7 @@ esp32c3 = [
esp32c6 = [
"hardware",
"mqtt-tls",
"lan",
"esp-hal/esp32c6",
"esp-println/esp32c6", "esp-println/auto",
"esp-radio/esp32c6",
Expand Down Expand Up @@ -118,7 +131,8 @@ rand_core_010 = { package = "rand_core", version = "0.10", default-features = fa
# TLS for MQTT (mqtts://). 0.2 is the last release on esp-hal 1.1; software crypto,
# from the prebuilt libraries (no chip feature, so no C toolchain needed).
mbedtls-rs = { version = "=0.2.0", default-features = false, features = ["tls", "log"], optional = true }
# Only for logging the free heap after the TLS handshake. Same version xtask injects.
# Only for logging the free heap (after the TLS handshake, on LAN connections). Same
# version xtask injects.
esp-alloc = { version = "0.10.0", optional = true }

# Versions for crates injected into generated .app_build / .app_test_build by xtask.
Expand Down
2 changes: 1 addition & 1 deletion boards/esp/main.template.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ async fn main(spawner: Spawner) -> ! {
BLE_MAX_BONDED_PHONES,
BLE_CONTROLLER_LEASE_TTL_S,
).unwrap());
{MQTT_DRIVER_SPAWN}{CAN_LOGGER_SPAWN} spawner.spawn({VEHICLE_CRATE_IDENT}::handle_basic_commands_task().unwrap());
{MQTT_DRIVER_SPAWN}{CAN_LOGGER_SPAWN}{LAN_SPAWN} spawner.spawn({VEHICLE_CRATE_IDENT}::handle_basic_commands_task().unwrap());
spawner.spawn({VEHICLE_CRATE_IDENT}::handle_advanced_commands_task().unwrap());
spawner.spawn({VEHICLE_CRATE_IDENT}::state_update_task().unwrap());
spawner.spawn({VEHICLE_CRATE_IDENT}::can_rx_task().unwrap());
Expand Down
Loading