Receive C-ITS (V2X) data with an ESP32-C5 and provide stand-alone use cases (like remaining signal phase time)
Find a file
2026-06-20 20:17:17 +02:00
.cargo setup rust project using esp-generate 2026-04-25 16:47:41 +02:00
src screen: clear sceen on first GNSS fix 2026-06-20 20:17:17 +02:00
.clippy.toml refactor: Move sniffer to own module 2026-05-11 22:11:27 +02:00
.gitignore setup rust project using esp-generate 2026-04-25 16:47:41 +02:00
build.rs build: run unit tests locally 2026-06-13 12:07:26 +02:00
Cargo.lock spat: Add screen 2026-06-17 23:27:49 +02:00
Cargo.toml spat: Add screen 2026-06-17 23:27:49 +02:00
Readme.md spat: Add screen 2026-06-17 23:27:49 +02:00
rust-toolchain.toml setup rust project using esp-generate 2026-04-25 16:47:41 +02:00
rustfmt.toml chore: Add rustfmt config 2026-05-11 22:22:39 +02:00

ESP32-C5 C-ITS Visualizer

Displays different C-ITS receive-only use cases for cheap.

Hardware Requirements

The code is currently tailored to:

  • Seeed XIAO ESP32-C5 (8MB PSRAM)
  • Seeed XIAO L67K (connected on GPIO12 (RX), GPIO11 (TX), GPIO1 (wakeup) and GPIO25 (reset))
    only available with gnss feature (which is included in spat feature)
  • Some ST7789 172*320px screen (connected on GPIO8 (SCL/ SCK), GPIO10 (SDA/ MOSI), GPIO7 (reset), GPIO23 (DC), GPIO24 (CS), TODO GPIO0 (BL))
    only available with screen feature (which is included in spat feature)

Features

GNSS

Enable L67K GNSS module and in main application logic/ state.

SPAT

Takes the current position and heading from the GNSS receiver and displays the signal phases of the upcoming intersection. The upcoming intersection is selected when the own position is "inside" some ingress approach of the intersection. The display will show the current phase and remaining time for all signal groups of the bike-able lanes in the approach.

DENM

TODO: Not implemented yet!

Shall "publish" the most relevant information of a DENMs via BLE

CAM

Just prints a line for each received CAM.

Usage

Toolchain Installation

Install the toolchain, targe and tools like this:

rustup toolchain install nightly --component rust-src
rustup target add riscv32imac-unknown-none-elf

# cargo install esp-generate --locked
# cargo install esp-config --features=tui --locked
cargo install espflash --locked

(Project was setup using esp-generate with the options --chip esp32c5 -o esp32c5-wroom-1-psram -o alloc -o log -o unstable-hal -o wifi -o esp-backtrace -o embassy.)

To use the proper rustfmt features, enable the nightly toolchain:

rustup component add --toolchain nightly rustfmt

Build and Flash

In default configuration only signal phases (SPAT) data is displayed for the upcoming intersection. Additional features are available though feature flags:

  • esp: Run on ESP (required as feature flag to enable unit tests on host)
  • std: Run on system with std library
  • spat: Enable signal phase (and intersection map) data
  • denm: Enable DENMs
  • cam: Enable CAMs

Connect your ESP32-C5 and run:

# default configuration
cargo run --release

# for e.g. also enable DENM feature
cargo run --release -F denm

Run Unit Tests on Host

The unit tests in this project are meant to be run on the host:

cargo test --target host-tuple --bin test --no-default-features -F std,spat