0
0
Fork 0
esp32-c_its-companion/Readme.md
2026-07-22 15:14:15 +02:00

78 lines
2.5 KiB
Markdown

# ESP32-C5 C-ITS Companion/ 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:
```shell
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:
```shell
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
```