Update the notes for the new firmware and name Niklas Dathe

README, docs/06, TODO and the architecture diagram describe the microbu-firmware
based obu-firmware and station-link revision 2, add the hardware checks for the
new image, and credit Niklas Dathe as the author of the station firmware and its
interface specification. Ignore LaTeX build output next to station-link.tex.
This commit is contained in:
Ashin Walpola
2026-11-11 00:13:58 +01:00
parent 4ce1aaf250
commit fd006192e7
5 changed files with 94 additions and 69 deletions
+16 -11
View File
@@ -18,7 +18,7 @@ The project began against the consider it CiT One and later added the ESP32-C5 a
| | consider it CiT One | ESP32-C5 (micrOBU, `obu-firmware/`) |
|---|---|---|
| What it is | Complete V2X on-board unit | Seeed XIAO ESP32-C5 running a vanetza-idf ITS station |
| What it is | Complete V2X on-board unit | Seeed XIAO ESP32-C5 running Niklas Dathe's microbu-firmware ITS station |
| Transport | IP over USB tethering, MQTT | Station-link protocol over native USB-C or Bluetooth LE |
| Reaches the phone as | Processed JSON, plus raw protobuf-wrapped UPER | Raw ASN.1 UPER per message, with RSSI |
| V2X stack lives | On the OBU | Facilities (CAM/VAM/DENM/SPATEM/MAPEM codecs) on the phone; BTP, GeoNetworking, security and radio on the board |
@@ -75,9 +75,10 @@ app/src/main/java/com/hawhamburg/micr0bu/
domain/cam/ Cam, CamParser, PhoneCamBuilder, CamTransmitConfig, Pseudonym
service/ TripRecordingService, CamTransmitLoop, CamPinger, V2xLogService
obu-firmware/ ESP32-C5 OBU: vanetza-idf station (signing, BTP, GeoNetworking), station link over
USB and BLE, raw receive path (gn_unwrap.c), battery monitor; host tests in test/
obu-firmware/external/vanetza-idf/ the C-ITS library the firmware builds against (vendored, unchanged)
obu-firmware/ ESP32-C5 OBU on Niklas Dathe's microbu-firmware (station, signing, BTP, GeoNetworking,
station link over USB and BLE) plus our raw receive path (gn_unwrap.c, V2X_RX),
unsigned TX and battery guard; host tests in test/
obu-firmware/{components,external}/ microbu_v2x, Vanetza and its patched source (vendored, unchanged)
obu-cam-transmistter/ Bench CAM beacon (the "simulated car"), fixed station ID, drives a loop in St. Georg
asn1/ Vendored ETSI ASN.1 modules the codecs are verified against
tools/ Bench scripts: STATUS watcher, bench-listener tally, MAPEM test-corpus generator
@@ -97,7 +98,7 @@ The `domain/` packages contain no Android imports. That is what makes the 132-te
On the CiT One path the MQTT broker runs on the OBU (Mosquitto 2.0.11, port 1883); Android USB tethering exposes it as a virtual Ethernet interface at `192.168.42.x` and the app auto-detects the gateway IP on plug-in.
On the ESP32-C5 path there is no network layer. Both links carry the same **station-link protocol v1** (from the colleague's `microbu-esp32c5` station): `[opcode][flags][sequence LE][body]`, at most 512 octets per message (`LINK_MAX_MESSAGE` in the app, `link::maximum_message` in the firmware). The phone configures the station, provisions the demo credentials once, keeps the board's clock and position current (`POTI_UPDATE` per new GNSS fix) and submits messages (`BTP_DATA_REQUEST`); the board answers with `RESULT`, sends `STATUS` every second, and forwards every ITS message it hears as `V2X_RX` (0x85, a MicrOBU extension). Over USB each message is one `0xAA55` frame with CRC-16; over BLE it is one GATT value. Details: [docs/06-signed-its-vam-ble.md](docs/06-signed-its-vam-ble.md).
On the ESP32-C5 path there is no network layer. Both links carry the same **station-link protocol**, revision 2 ([obu-firmware/docs/station-link.tex](obu-firmware/docs/station-link.tex); revision 1 is Niklas Dathe's, revision 2 adds our extensions): `[opcode][flags][sequence LE][body]`, at most 512 octets per message (`LINK_MAX_MESSAGE` in the app, `link::maximum_message` in the firmware). The phone configures the station, provisions the demo credentials once, keeps the board's clock and position current (`POTI_UPDATE` per new GNSS fix) and submits messages (`BTP_DATA_REQUEST`); the board answers every request with `CONFIRM`, the phone asks for `STATUS_REQUEST` every second (the status snapshot is in the CONFIRM), and the board forwards every ITS message it hears as `V2X_RX` (0x90, a MicrOBU extension). Over USB each message is one `0xAA55` frame with CRC-16; over BLE it is one GATT value. Details: [docs/06-signed-its-vam-ble.md](docs/06-signed-its-vam-ble.md).
### Bluetooth LE
@@ -106,7 +107,7 @@ Settings > Connection > ESP32-C5 > link: Bluetooth.
- **GATT layout**: service `0000C175-BA5E-4C17-8000-00805F9B34FB`, one characteristic per primitive. Each value is one whole link message, never fragmented, so the app raises the ATT MTU to 517 first; the firmware drops a notification rather than send it cut short.
- **Pairing**: the board advertises as `micrOBU-XXXX`. LE Secure Connections with a fixed passkey, **123456**, entered once in Android's own pairing dialog. The bond is kept on both sides (the board stores it in its 80 KB NVS). The passkey is public, so this gives an encrypted link but no protection against an active attacker during that first pairing.
- **Reconnect**: after a drop (4 s supervision timeout) the app reconnects by itself, 1 s later and then backing off to 30 s. With several bonded micrOBUs (a replaced board stays bonded), the one that connected last is tried first, then the others in turn.
- **USB takes priority**: the board stops advertising while its USB link is in use (`CONFIG_MICROBU_BLE_USB_IDLE_MS`, 3 s), because BLE and ITS-G5 share the C5's single RF front end.
- **BLE and ITS-G5 share the C5's single RF front end**: the firmware holds an ITS-G5 frame out of the BLE connection-event windows (`CONFIG_MICROBU_TX_BLE_GUARD`).
- **Permissions**: `BLUETOOTH_SCAN` and `BLUETOOTH_CONNECT` (Android 12+), requested at start-up.
Whether an active BLE connection costs 5.9 GHz reception has not been measured yet.
@@ -124,7 +125,7 @@ Verification therefore uses an independent oracle: `asn1tools` compiled from the
- **Golden-byte fixtures** assert exact encoder output (CAM, VAM), with expected values produced by the oracle rather than by this encoder.
- **Bulk replay** compares every field over real captures: 79,042 SPATEMs and 1,885 DENMs, zero mismatches.
- **MAPEM**: every distinct MAPEM on record (17 from the 2026-03-18 drive, 288 to 1348 bytes, plus the bench RSU's) decodes field for field like asn1tools (`MapemUperCodecTest`; fixtures from `tools/mapem_corpus.py`). Joined with recorded SPATEMs of the same intersections, 340 of 341 signalled lane exits find their signal group (`TrafficLightsTest`).
- **Station link**: the codec is pinned to bytes from the colleague's Python implementation (`StationLinkTest`).
- **Station link**: the codec is pinned to bytes from Niklas Dathe's Python implementation (`StationLinkTest`).
- **Signatures on air**: `obu-firmware/test/verify_signed_pcap.py` checks captured frames with asn1tools and OpenSSL, sharing no code with the firmware: 12 of 12 signed CAMs valid, demo chain valid (2026-09-23). The CiT One and the V2X2MAP bridge receive them too.
- **Firmware receive path**: host tests (`obu-firmware/test/host`, `make`) run the TX-to-RX chain, every recorded frame cross-checked by asn1tools, and a guard-page fuzz of `gn_unwrap_its`.
- **Off-air confirmation**: 26 of this project's own CAMs captured back by an independent receiver, all accepted.
@@ -144,7 +145,7 @@ Never regenerate a golden fixture from this project's own encoder output. See `a
| [05-obu-bench-test-2026-08-25.md](05-obu-bench-test-2026-08-25.md) | Bench campaign T1 to T9, measured results |
| [04-transmit-setup.md](04-transmit-setup.md) | Transmitter bring-up, radio configuration diagnosis, the TX bypass |
| [obu-firmware/FLASHING.md](obu-firmware/FLASHING.md) | Toolchain setup (ESP-IDF 6.0.2), flashing, battery and pins, phone-to-board bring-up |
| [obu-firmware/NOTES.md](obu-firmware/NOTES.md) | What the firmware changes against the colleague's station, and why |
| [obu-firmware/NOTES.md](obu-firmware/NOTES.md) | What the firmware changes against Niklas Dathe's station, and why |
| [obu-firmware/test/host/README.md](obu-firmware/test/host/README.md) | Host tests of the firmware's frame code |
| [TODO.md](TODO.md) | Open engineering items, including the hardware checks still to run |
| [asn1/README.md](asn1/README.md) | ASN.1 module provenance and the fixture regeneration rule |
@@ -184,14 +185,18 @@ Never regenerate a golden fixture from this project's own encoder output. See `a
The Wi-Fi transport (broker at `192.168.3.202`) remains available in developer builds via Settings > Developer.
Keep app and firmware in step: both cap a link message at 512 octets, and the app speaks the station-link protocol (it still falls back to the previous firmware's frames for CAM over USB).
Keep app and firmware in step (the app from 2026-11-10 needs the firmware from 2026-11-10: `CONFIRM` and `STATUS_REQUEST`, `V2X_RX` is 0x90, the configure message has 6 octets): both cap a link message at 512 octets, and the app speaks station-link revision 2 (it still falls back to the previous firmware's frames for CAM over USB).
## Credits
The ESP32-C5 station firmware (BTP, GeoNetworking, TS 103 097 security, the station-link protocol, BLE and the radio driver) and its interface specification are by **Niklas Dathe** (HAW Hamburg, microbu-firmware). `obu-firmware/` is his firmware with the MicrOBU additions listed in [obu-firmware/NOTES.md](obu-firmware/NOTES.md).
## Status and known limitations
Bench verified against live ITS-G5 traffic on 2026-08-25: 2868 frames over 305 seconds, zero decode failures, zero USB errors, zero crashes. Signed CAM and VAM, the BLE link and reception over both links were checked on the bench on 2026-09-23; on 2026-10-28 the ESP32-C5 forwarded the bench RSU's MAPEM (295 bytes), SPATEM and CAM with nothing dropped. Not yet road validated.
Bench verified against live ITS-G5 traffic on 2026-08-25: 2868 frames over 305 seconds, zero decode failures, zero USB errors, zero crashes. Signed CAM and VAM, the BLE link and reception over both links were checked on the bench on 2026-09-23; on 2026-10-28 the ESP32-C5 forwarded the bench RSU's MAPEM (295 bytes), SPATEM and CAM with nothing dropped. On 2026-11-10 the firmware was rebuilt on Niklas Dathe's newer microbu-firmware layout and the app's link followed (link spec revision 2); that firmware boots, advertises and answers STATUS on the XIAO, while reception, transmission, signing and the battery guard on real hardware are still to be re-checked (`TODO.md`). Not yet road validated.
- **Requirement 11.6, Phase A success criteria, is not met.** The bench proves reception. It cannot prove the use case behaves correctly with two genuinely moving stations, because nothing on the bench moves. This is the main open evidence gap for the project's central claim.
- **Demo PKI only.** Signed messages carry a throwaway chain shipped with the app, not an EU-registered one; receivers that verify against the EU trust list drop them. No TS 102 941 enrolment. Received signatures are not verified on the ESP32-C5 path.
- **Demo PKI only.** Signed messages carry a throwaway chain shipped with the app, not an EU-registered one; receivers that verify against the EU trust list drop them. No TS 102 941 enrolment. The board's stack verifies signatures (counted in STATUS), but the `V2X_RX` path the app uses delivers everything without a verdict, only whether a signature is present.
- **Detection thresholds are untuned engineering estimates**, not calibrated against real intersection data.
- **494-byte receive limit on the ESP32-C5 path.** A larger message does not fit one link message and is dropped: about 70% of real road SPATEMs (median 555 bytes) and many road MAPEMs. The CiT One path is not limited.
- **Traffic lights per lane not yet seen live.** Tested on recorded messages only. Riders on crosswalks or sidewalks are not matched to a lane, and computed lanes (`ComputedLane`) are not decoded.