setup_workstation.ps1 stopped on the failed import of a missing Python package instead of installing it; start_overnight.ps1 stopped on the keep-awake call, whose 0x80000001 literal is read as a negative int.
Track the bench scripts (run_overnight.py and its stages, the link and ITS
client libraries, the phone-vs-node comparison) with the first reports.
Changes for the spare XIAO (no cell):
- run_overnight.py picks the single Espressif board by default and refuses to
test a build that is not this checkout's HEAD.
- The unsigned soak stops as "transmit path wedged" after 40 resource_limit
refusals in a row and tries whether a repeated STATION_CONFIGURE clears it.
- "Refused requests put nothing on the radio" counts only own transmissions;
frames heard from other stations are copied by RAW_CAPTURE too.
- start_overnight.ps1: optional build and flash, host C tests in the
background, Windows kept awake. setup_workstation.ps1 checks and installs
git, Python 3.11, pyserial, asn1tools, MSYS2 gcc and make, ESP-IDF 6.0.2.
- obu-firmware/docs/overnight-bench-test.tex (and PDF) describe the test, the
workstation set-up and the findings of the 2026-11-25 runs.
The firmware dropped every received ITS message over 494 bytes (one link
message), so a road RSU's 888-byte SPATEM and 1198-byte MAPEM never reached
the phone. V2X_RX now goes out in link fragments up to 2300 bytes, best
effort and non-blocking; messages up to 494 bytes are unchanged.
The app's SPATEM decoder then refused those messages because they carry
intersection and movement names and advisory speed lists. It now reads past
both, checked against asn1tools on 718 distinct messages.
Adds the pure fragmenter with host tests and a pcap replay, a Kotlin
cross-check on the firmware's own fragments, tools/rx_size_compare.py,
docs/08-large-message-reception.md and station-link revision 3.
Add data-flow diagrams of both paths (V2X_RX and RAW_FRAME with the app's Receive path
switch) to the app README, the firmware README and docs/06, and bring the draw.io
architecture labels up to station-link revision 2. The spec (revision 2) gains
"V2X_RX and RAW_FRAME: both stay" and "Fragmentation on the host side". Document the corpus
generator in test/host.
Settings > Connection > ESP32-C5 > Receive path chooses where received ITS messages come from.
V2X_RX (default) is the MicrOBU extension the board builds with gn_unwrap.c. Raw frames is the
station-link RAW_FRAME debug capture: the app switches RAW_CAPTURE on (mode 3), reassembles
fragmented link messages as the spec defines (LinkReassembly), parses the ITS5 record
(RawFrame) and unwraps the 802.11 frame with GnUnwrap, a Kotlin port of gn_unwrap.c. Both end
as the same V2X_RX frames, so nothing above the link changes, and the firmware keeps both.
GnUnwrapTest checks the port against the C code on 602 recorded, cut and corrupted frames
(corpus from obu-firmware/test/host: make corpus). 145 app tests. Fix the Connection text that
claimed the app picks the strongest micrOBU.
Document the MAC rotation (16-octet STATION_CONFIGURE), the ATT MTU of 517, the battery
reading fix, pairing and bonds with several boards, tools/station_tx_test.py, what was
dropped from the earlier MicrOBU version and what Niklas Dathe's latest firmware added,
and the measured results (BLE adds no transmit loss over USB). Test counts: 40 firmware,
131 app.
The app sends the pseudonym's MAC in the 16-octet STATION_CONFIGURE (address_configuration
0), the station uses it for unsigned frames too, and a different MAC reconfigures the
station. A ride rotates it with the station ID; the bench CAM pinger keeps one. Without a
MAC the station behaves as before (ticket-derived when signed, random when unsigned).
tools/station_tx_test.py plays the phone over USB and reads the station's own raw capture
(source MAC, signed or not, submitted and completed counts). Add the 16-octet form to the
spec (revision 2), a firmware unit test and an app test. Fix the stale Connection texts.
Replace the vanetza-idf port with his current station firmware (microbu-firmware
e4e4bd8: main/, components/microbu_v2x, components/vanetza, external/vanetza) and
re-apply the MicrOBU additions, each marked "MicrOBU:" in the sources:
- V2X_RX (opcode 0x90): every received ITS message, signed or not, through
gn_unwrap.c, because the stack drops unsigned and foreign-root traffic. 0x85 is
the spec's RAW_FRAME and 0x86 is reserved. The body is built in v2x_rx.hpp.
- Unsigned transmission (geonet.c) for security profile 1 or station security 0,
from a random MAC per configuration.
- Radio polled from STATION_CONFIGURE on; manual country policy, TX power
read-back, static RX buffer, short frames ignored.
- Battery guard (battery_policy.hpp): deep sleep below 3.30 V with no phone on USB.
- No USB writes without a host; last_frame_ms() for the guard.
- 80 KB NVS with the app at 0x20000, 8 MB flash, XIAO ESP32-C5 board, 20 dBm.
Remove the old C firmware, the bench listener and the old vanetza-idf copy. Add
docs/station-link.tex as revision 2 of the interface reference (V2X_RX, unsigned
sending, battery rule, revision history). Add 39 host unit tests (make firmware in
test/host) next to the existing chain, replay, fuzz and battery tests, and point
tools/station_status_watch.py at the new CONFIRM-based status.
gn_unwrap.c now passes BTP ports 2003 (MAPEM) and 2018 (VAM), signed or
not, besides CAM, DENM and SPATEM. A message over 494 bytes still does not
fit one 512-octet link message (also the largest GATT value) and is dropped
and counted, not fragmented. The bench RSU's MAPEM is 295 bytes.
CONFIG_MICROBU_BENCH_LISTEN (off in sdkconfig) is for a board whose only PC
connection is the UART0 console: it configures itself receive-only at boot
and logs every V2X_RX message; tools/bench_listen_watch.py tallies the log.
On air on 2026-10-28 it forwarded 104 MAPEM, 185 SPATEM and 472 CAM in
90 s, with nothing oversize. The RSU sent all of them unsigned.
Host tests: signed GeoBroadcast SPATEM/MAPEM frames of 58 to 1243 bytes
with every truncation length; the replay cuts frames at c5_radio.cpp's
2346 bytes (not the old C firmware's 800) and checks MAPEMs with asn1tools.
The production OBU is now a Seeed XIAO ESP32-C5 (8 MB flash, one native
USB-C port) on a LiPo with no protection board. The firmware reads the
cell on GPIO6 (divider switched by GPIO26) every 5 s, sends it in STATUS
(battery_mv and battery_flags, octets 103-105; decoders accept 103 or
>= 106 octets), warns below 3.50 V and deep-sleeps below 3.30 V when no
phone is on USB, waking every 5 min to check the cell again. Thresholds
are in Kconfig; host test `make battery`.
The app shows voltage, a rough percentage and the low/critical state on
the ESP32-C5 card and in the top bar. With several bonded micrOBUs (a
replaced board stays bonded), the BLE link tries the one that last
connected first and moves on to the next after each failure.
tools/station_status_watch.py reads STATUS from the native port.
TimestampIts is TAI-based (TS 102 894-2 V2.5.1), 5 s ahead of UTC. ItsTime
left the leap seconds out, so the PoTi set the micrOBU's clock 5 s behind:
it rejected other stations' VAMs as Invalid_Timestamp and restarted its
stack (time_regression). CAM/VAM generationDeltaTime and the GN TST were
5 s off too.
ItsTime adds the leap seconds (IANA leap-seconds.list) and converts back
for received DENMs. Golden vectors regenerated through asn1tools.
obu-firmware builds against the vanetza-idf C-ITS library, which until now
came from the colleague's microbu-esp32c5 tree beside the repository and was
not tracked here, so a clone of this repository could not build the firmware
it ships. The library alone is now part of obu-firmware, as
obu-firmware/external/vanetza-idf: their external/vanetza-idf at commit
cf4b99f, unchanged (9775 files; see its PROVENANCE.md). CMake takes it from
there by default; -DVANETZA_IDF_DIR still points the build elsewhere.
The rest of the colleague's tree (their own VAM firmware, PKI tooling,
station-link Python tools, the V2X2MAP bridge) stays out of this repository
and gitignored; nothing is pushed to their repository. NOTES.md, docs/06,
TODO.md and the pcap verifier's usage line point at the new location.
docs/06-signed-its-vam-ble.md: who does what between phone and ESP32-C5
(signing lives on the board), the link protocol, recovery paths (USB
heartbeat watchdog, BLE supervision timeout and auto-reconnect, board-reset
reconfiguration, app restart), the demo PKI, and what is still open.
obu-firmware/test/verify_signed_pcap.py checks the IEEE 1609.2 signatures in
a pcap with asn1tools and OpenSSL, independent of the firmware. On a capture
of the CAM pinger (2026-09-23) all 12 signed CAMs verify under the demo
ticket, whose chain verifies too. The CiT One receives the same CAMs but its
MQTT interface exposes no security information, so it cannot confirm the
signature itself. The V2X2MAP bridge on COM10 now verifies against the demo
chain as well (change in the colleague's repository); signed CAMs and VAMs
show as verified.
TODO.md: bench checks confirmed so far ticked; open are BLE/ITS-G5
coexistence, time_regression over a longer stationary run, and board reset
recovery over BLE.
Signed packets. A GeoNetworking Basic Header NextHeader of 2 means a
TS 103 097 (IEEE 1609.2) envelope follows, with the Common Header
inside it. gn_unwrap_its rejected all of these, and most real traffic is
signed: the 2026-08-17 capture holds 157 signed frames from 15 source
MACs against 2 unsecured stations. It now opens a COER-encoded
signedData, or a bare unsecuredData, and parses the inner packet as
before. The inner packet comes first inside tbsData, so the certificate
and signature are never parsed, and the signature is not verified - the
firmware has no trust store. Such messages reach the phone with the new
V2X_RX flags bit1, signed but not verified. The app reads only bit0 and
is unaffected until it learns the flag. Encrypted payloads, nested
signing and the legacy v1.2.1 envelope are still rejected. All 157
recorded signed frames have the layout this reads, in all three COER
length forms, and asn1tools decodes every envelope to the same inner
packet.
Payload bounds. Every frame recorded through the ESP32-C5's promiscuous
RX, about 15 000 of them, ends in 8 bytes that are not part of the
802.11 frame and not a valid FCS. obu-firmware reads frames through the
same API and took the rest of the frame as the message, so it forwarded
those 8 bytes to the phone after every message. UPER decoders stop where
the message ends, so nothing visibly broke, but the bytes cost serial
bandwidth and 8 bytes of the DENM's headroom, and they stayed attached
wherever raw payloads were stored or passed on. The payload is now
exactly what the Common Header's payload-length field declares, which is
also what separates a signed message from its signature.
A frame longer than main.c's 800-byte capture buffer is now reported as
truncated instead of being forwarded cut off, and counted as an oversize
drop through the new serial_link_note_oversize_drop, as it was when the
cut-off frame failed serial_link's size check.
Host tests in obu-firmware/test/host build the firmware sources
unmodified with MSYS2 gcc; `make` runs all three.
- test_chain: frames from the firmware's TX code checked byte by byte
against EN 302 636-4-1 and parsed back, including hand-built signed
frames, the payload-length rule, the RX trailer, and every truncation
length against a no-access guard page. 1731 checks, 0 failures.
- test_replay and check_replay.py: all 15 145 recorded frames through
gn_unwrap_its, cut to 800 bytes as on the board, and re-derived
independently in Python with the envelope decoded by asn1tools. They
agree on every record; 15 131 accepted, 157 of them signed. 11 043 of
the 11 106 distinct messages re-encode byte-identically. The other 63
fail the same way with the old 8 bytes put back, so the boundary is
not the cause: 5 are our own CAMs from before the 2026-08-20
yawRateConfidence fix, and the rest, from other stations, are a
follow-up in TODO.md.
- fuzz_gn_unwrap: random edits of every recorded frame, each run against
the guard page. 50 000 000 iterations, no crash.
obu-firmware/test/pcap_gn_tally.py tallies GeoNetworking header fields
per station over captures; it is how the other stations' lifetimes were
measured. TODO.md collects what is still open, including the on-air
check for this change: it builds on IDF 6.1 but has not been flashed.