Update the notes, flashing guide and READMEs for the 2026-11-11 bench run
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.
This commit is contained in:
@@ -42,7 +42,7 @@ hardware_paths:
|
|||||||
messages_received: V2X_RX (0x90), signed or not, up to 494 octets
|
messages_received: V2X_RX (0x90), signed or not, up to 494 octets
|
||||||
messages_sent: signed or unsigned per setting (Settings > Connection > ESP32-C5)
|
messages_sent: signed or unsigned per setting (Settings > Connection > ESP32-C5)
|
||||||
credentials: throwaway demo chain in app/src/main/assets/demo-chain.vcr
|
credentials: throwaway demo chain in app/src/main/assets/demo-chain.vcr
|
||||||
tests: 130 JVM unit tests, no emulator needed (domain/ has no Android imports)
|
tests: 131 JVM unit tests, no emulator needed (domain/ has no Android imports)
|
||||||
```
|
```
|
||||||
|
|
||||||
## Project goal
|
## Project goal
|
||||||
@@ -124,7 +124,7 @@ tools/ Bench scripts: STATUS watcher, bench-listener tally, MAPEM
|
|||||||
docs/ Requirements traceability, signed ITS / VAM / BLE design, architecture diagrams
|
docs/ Requirements traceability, signed ITS / VAM / BLE design, architecture diagrams
|
||||||
```
|
```
|
||||||
|
|
||||||
The `domain/` packages contain no Android imports. That is what makes the 130-test JVM suite possible without an emulator or instrumentation.
|
The `domain/` packages contain no Android imports. That is what makes the 131-test JVM suite possible without an emulator or instrumentation.
|
||||||
|
|
||||||
## Connectivity
|
## Connectivity
|
||||||
|
|
||||||
@@ -143,9 +143,10 @@ On the ESP32-C5 path there is no network layer. Both links carry the same **stat
|
|||||||
|
|
||||||
Settings > Connection > ESP32-C5 > link: Bluetooth.
|
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.
|
- **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 asks for 517 too); 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.
|
- **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.
|
- **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.
|
||||||
|
- **Several boards nearby**: with no bond the app connects to the first micrOBU it hears, which on a bench with several is not necessarily yours. Pair the right one in Android's Bluetooth settings first (name `micrOBU-` plus the last two octets of its BLE address); the app then prefers a bonded micrOBU. See [obu-firmware/FLASHING.md](obu-firmware/FLASHING.md).
|
||||||
- **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`).
|
- **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.
|
- **Permissions**: `BLUETOOTH_SCAN` and `BLUETOOTH_CONNECT` (Android 12+), requested at start-up.
|
||||||
|
|
||||||
@@ -232,7 +233,7 @@ The ESP32-C5 station firmware (BTP, GeoNetworking, TS 103 097 security, the stat
|
|||||||
|
|
||||||
## Status and known limitations
|
## 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. 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.
|
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-11 the production XIAO and a Pixel 9 Pro were run together: the simulated car's CAMs reach the app, signed and unsigned CAMs from the phone are heard by a second board, the BLE bond survives a board reset, and BLE adds no measurable transmit loss over USB (95.7 % of signed CAMs heard in both; about 4 % is lost on the air or at the listener). 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.
|
- **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. 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.
|
- **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.
|
||||||
|
|||||||
@@ -60,6 +60,7 @@ Main changes against Niklas Dathe's firmware:
|
|||||||
(`battery_mv`, octets 129-130); the app shows the voltage, a rough percentage and a low (3.50 V) /
|
(`battery_mv`, octets 129-130); the app shows the voltage, a rough percentage and a low (3.50 V) /
|
||||||
critical (3.30 V) warning on the ESP32-C5 card and in the top bar. Below 3.30 V with no phone on USB
|
critical (3.30 V) warning on the ESP32-C5 card and in the top bar. Below 3.30 V with no phone on USB
|
||||||
the board deep-sleeps, because the prototype cell has no protection board. See `obu-firmware/FLASHING.md`.
|
the board deep-sleeps, because the prototype cell has no protection board. See `obu-firmware/FLASHING.md`.
|
||||||
|
- **ATT MTU 517** so that a 494-octet V2X_RX (a 512-octet link message) is not split.
|
||||||
- **BLE and ITS-G5** share one RF front end. Niklas Dathe's TX guard (`CONFIG_MICROBU_TX_BLE_GUARD`)
|
- **BLE and ITS-G5** share one RF front end. Niklas Dathe's TX guard (`CONFIG_MICROBU_TX_BLE_GUARD`)
|
||||||
holds a frame out of the BLE connection-event windows; the earlier "pause advertising while USB is
|
holds a frame out of the BLE connection-event windows; the earlier "pause advertising while USB is
|
||||||
in use" is gone.
|
in use" is gone.
|
||||||
@@ -78,7 +79,7 @@ firmware is what counts; the current spec table lists the same UUIDs).
|
|||||||
|
|
||||||
| Direction | Message | Used for |
|
| Direction | Message | Used for |
|
||||||
|---|---|---|
|
|---|---|---|
|
||||||
| phone → board | `STATION_CONFIGURE` | station type, channel 180, 20 dBm (6 octets); starts the radio |
|
| phone → board | `STATION_CONFIGURE` | station type, channel 180, 20 dBm; the 16-octet form also names the MAC (pseudonym); starts the radio |
|
||||||
| phone → board | `CREDENTIALS_PROVISION` | the demo bundle, once, when the board reports no ticket |
|
| phone → board | `CREDENTIALS_PROVISION` | the demo bundle, once, when the board reports no ticket |
|
||||||
| phone → board | `POTI_UPDATE` | position and ITS time, once per new GNSS fix |
|
| phone → board | `POTI_UPDATE` | position and ITS time, once per new GNSS fix |
|
||||||
| phone → board | `BTP_DATA_REQUEST` | one CAM (port 2001, psid 36) or VAM (port 2018, psid 638), signed or not |
|
| phone → board | `BTP_DATA_REQUEST` | one CAM (port 2001, psid 36) or VAM (port 2018, psid 638), signed or not |
|
||||||
@@ -89,8 +90,10 @@ firmware is what counts; the current spec table lists the same UUIDs).
|
|||||||
The app side is `Esp32Link.kt` (session), `StationLink.kt` (codec, pinned by unit tests to bytes
|
The app side is `Esp32Link.kt` (session), `StationLink.kt` (codec, pinned by unit tests to bytes
|
||||||
from Niklas Dathe's Python implementation), `UsbSerialTransport.kt` and `BleLinkTransport.kt`.
|
from Niklas Dathe's Python implementation), `UsbSerialTransport.kt` and `BleLinkTransport.kt`.
|
||||||
A board still on the previous C firmware is recognised by its old heartbeat and keeps working for
|
A board still on the previous C firmware is recognised by its old heartbeat and keeps working for
|
||||||
CAM over USB. The app does not rotate the board's MAC any more (STATION_CONFIGURE has none): a signed
|
CAM over USB. The pseudonym's MAC goes to the board in the 16-octet STATION_CONFIGURE (which Niklas Dathe's
|
||||||
station takes its address from the ticket, an unsigned one draws a random MAC per configuration.
|
spec retires but the station still decodes, and revision 2 documents): a ride rotates it with the station ID, the bench CAM
|
||||||
|
pinger keeps one fixed MAC, and a new MAC reconfigures the station. Without one a signed station takes its address from the
|
||||||
|
ticket and an unsigned one draws a random MAC per configuration. With one, signed and unsigned frames both leave from it.
|
||||||
|
|
||||||
## Redundancy and recovery
|
## Redundancy and recovery
|
||||||
|
|
||||||
|
|||||||
@@ -60,6 +60,18 @@ STATION_CONFIGURE; the app provisions the demo credentials on the first Connect.
|
|||||||
paired before must forget `micrOBU-XXXX` in Android's Bluetooth settings and pair again (passkey
|
paired before must forget `micrOBU-XXXX` in Android's Bluetooth settings and pair again (passkey
|
||||||
123456, `CONFIG_MICROBU_BLE_PASSKEY`).
|
123456, `CONFIG_MICROBU_BLE_PASSKEY`).
|
||||||
|
|
||||||
|
### Pairing, bonds and several boards
|
||||||
|
|
||||||
|
- The name is `micrOBU-` plus the last two octets of the board's BLE address (`micrOBU-66AA` is the production
|
||||||
|
XIAO on COM10, `10:BD:A3:CF:66:AA`). The board keeps **one** bond in NVS and refuses to replace it.
|
||||||
|
- **With no bond the app connects to the first micrOBU it hears.** On a bench with several (2026-11-11: 4AFA, 3FAA,
|
||||||
|
A25E and 66AA all at -49 to -55 dBm) that is not necessarily yours, and it can bond with the wrong board. Pair the
|
||||||
|
right one first in Android's Bluetooth settings (Pair new device, passkey 123456); the app then prefers a
|
||||||
|
bonded micrOBU. Forget a wrong bond there too.
|
||||||
|
- If the phone has lost its bond but the board still holds one, the phone connects and drops again after about 3 s.
|
||||||
|
Erase the board's NVS (`python -m esptool --chip esp32c5 -p COMx erase-region 0x9000 0x15000`) and pair again.
|
||||||
|
- The bond survives a reflash that keeps the NVS and a reset of the board (checked 2026-11-11).
|
||||||
|
|
||||||
## Look at the board from the PC
|
## Look at the board from the PC
|
||||||
|
|
||||||
```powershell
|
```powershell
|
||||||
@@ -68,7 +80,16 @@ py -3.11 tools/station_status_watch.py COM6 30 --configure --rx
|
|||||||
|
|
||||||
prints the log, the STATUS snapshot once a second (uptime, signing and radio counters, heap,
|
prints the log, the STATUS snapshot once a second (uptime, signing and radio counters, heap,
|
||||||
battery) and the first V2X_RX messages heard on air. DTR/RTS stay low in the script because toggling
|
battery) and the first V2X_RX messages heard on air. DTR/RTS stay low in the script because toggling
|
||||||
them resets the board.
|
them resets the board. **Opening the port resets the board** (USB Serial/JTAG), so a phone on BLE is dropped.
|
||||||
|
|
||||||
|
```powershell
|
||||||
|
py -3.11 tools/station_tx_test.py COMx --seconds 60 --mac 02:aa:bb:cc:dd:01 # signed CAMs from a named MAC
|
||||||
|
py -3.11 tools/station_tx_test.py COMx --seconds 60 --unsigned # unsigned, a random MAC
|
||||||
|
```
|
||||||
|
|
||||||
|
plays the phone over USB (configure, position, a CAM request per second) and reads the station's own raw capture, so it
|
||||||
|
prints the 802.11 source address and whether each frame is signed, plus how many frames the radio submitted and
|
||||||
|
completed. Pair it with a second board listening on the air to count what arrives.
|
||||||
|
|
||||||
## Production OBU checklist (board with the cell connected)
|
## Production OBU checklist (board with the cell connected)
|
||||||
|
|
||||||
@@ -111,7 +132,10 @@ in `test/host`) adds the protection, every 5 s: the smoothed voltage below 3.30
|
|||||||
60 s after boot and with **no frame from a phone on USB in the last 5 s**, puts the board into deep
|
60 s after boot and with **no frame from a phone on USB in the last 5 s**, puts the board into deep
|
||||||
sleep; it wakes every 300 s, measures, and runs again from 3.60 V. A phone on USB powers the board,
|
sleep; it wakes every 300 s, measures, and runs again from 3.60 V. A phone on USB powers the board,
|
||||||
so no shutdown happens then. Thresholds: `menuconfig -> micrOBU firmware`. The app shows
|
so no shutdown happens then. Thresholds: `menuconfig -> micrOBU firmware`. The app shows
|
||||||
low/critical from the same voltage and its own thresholds.
|
low/critical from the same voltage and its own thresholds. The first XIAO build read 0 mV because the divider had
|
||||||
|
no time to settle at `CONFIG_FREERTOS_HZ=100` (fixed 2026-11-11, see NOTES.md); it now reads 4.14-4.16 V on a charging
|
||||||
|
cell. There is no calibration trim and no multimeter reference on the glued-in cell: the plateau at full charge
|
||||||
|
should sit near the charger's 4.20 V.
|
||||||
|
|
||||||
## If the build fails
|
## If the build fails
|
||||||
|
|
||||||
|
|||||||
+41
-4
@@ -18,7 +18,7 @@ Layout:
|
|||||||
| `external/vanetza/` | patched upstream Vanetza source (unchanged, see its `UPSTREAM`) |
|
| `external/vanetza/` | patched upstream Vanetza source (unchanged, see its `UPSTREAM`) |
|
||||||
| `docs/station-link.tex` | the link interface reference this firmware and the app implement: **revision 2**, Niklas Dathe's revision 1 plus our extensions (the original PDF is `microbu-firmware/docs/station-link.pdf`; build ours with `pdflatex`, no LaTeX is installed on the lab laptop) |
|
| `docs/station-link.tex` | the link interface reference this firmware and the app implement: **revision 2**, Niklas Dathe's revision 1 plus our extensions (the original PDF is `microbu-firmware/docs/station-link.pdf`; build ours with `pdflatex`, no LaTeX is installed on the lab laptop) |
|
||||||
| `cmake/no_efuse_writes.cmake` | build guard: nothing in this firmware may program eFuses |
|
| `cmake/no_efuse_writes.cmake` | build guard: nothing in this firmware may program eFuses |
|
||||||
| `test/host/` | PC tests (`make` in that folder): the MicrOBU C code (`gn_unwrap.c`, `geonet.c`), the battery policy and, with `make firmware`, 39 unit tests of the link codec, V2X_RX and the policies |
|
| `test/host/` | PC tests (`make` in that folder): the MicrOBU C code (`gn_unwrap.c`, `geonet.c`), the battery policy and, with `make firmware`, 40 unit tests of the link codec, V2X_RX and the policies |
|
||||||
|
|
||||||
Take a newer release from Niklas Dathe by copying `firmware/{main,components,cmake}` and
|
Take a newer release from Niklas Dathe by copying `firmware/{main,components,cmake}` and
|
||||||
`external/vanetza` over these folders and re-applying the `MicrOBU:` changes (search the sources
|
`external/vanetza` over these folders and re-applying the `MicrOBU:` changes (search the sources
|
||||||
@@ -62,6 +62,12 @@ custom PCB; pick it in `menuconfig -> micrOBU firmware -> Board`.
|
|||||||
- **Partition table**: 80 KB NVS (Niklas Dathe's 24 KB filled up and BLE bonds stopped persisting),
|
- **Partition table**: 80 KB NVS (Niklas Dathe's 24 KB filled up and BLE bonds stopped persisting),
|
||||||
app at `0x20000`. A plain app-only flash of an older layout is wrong: flash everything.
|
app at `0x20000`. A plain app-only flash of an older layout is wrong: flash everything.
|
||||||
- **Flash size 8 MB** (XIAO), TX power ceiling 20 dBm (`radio_policy.hpp` admits 20 dBm on channel 180).
|
- **Flash size 8 MB** (XIAO), TX power ceiling 20 dBm (`radio_policy.hpp` admits 20 dBm on channel 180).
|
||||||
|
- **ATT MTU 517** (`CONFIG_BT_NIMBLE_ATT_PREFERRED_MTU`, Niklas Dathe's 512): the app asks for 517 and a 494-octet
|
||||||
|
V2X_RX is a 512-octet link message, which needs a value of 512, i.e. an MTU of 515. At 512 such a message was
|
||||||
|
split into fragments the app does not reassemble.
|
||||||
|
- **Link-layer address.** A signed station without a named MAC uses the address derived from its ticket; with the
|
||||||
|
16-octet STATION_CONFIGURE the phone names it (see "Unsigned transmission"). The CAM and VAM station ID still
|
||||||
|
rotates in the app; the app now rotates the MAC with it on a ride and keeps one fixed for the bench pinger.
|
||||||
|
|
||||||
### Link spec revision 2
|
### Link spec revision 2
|
||||||
|
|
||||||
@@ -69,14 +75,45 @@ custom PCB; pick it in `menuconfig -> micrOBU firmware -> Board`.
|
|||||||
e4e4bd8, kept unchanged as `microbu-firmware/docs/station-link.pdf`) plus a section "MicrOBU extensions": `V2X_RX`
|
e4e4bd8, kept unchanged as `microbu-firmware/docs/station-link.pdf`) plus a section "MicrOBU extensions": `V2X_RX`
|
||||||
(0x90), unsigned transmission (security profile 0x01, or 0x00 with `security` 0; random MAC per configure),
|
(0x90), unsigned transmission (security profile 0x01, or 0x00 with `security` 0; random MAC per configure),
|
||||||
the battery shutdown rule, no USB writes without a host, and a revision history. The wire format of
|
the battery shutdown rule, no USB writes without a host, and a revision history. The wire format of
|
||||||
revision 1 is unchanged, so a revision 1 host still works. No LaTeX is installed on the lab laptop: build
|
revision 1 is unchanged, so a revision 1 host still works. Build the PDF with `pdflatex station-link.tex`
|
||||||
the PDF with `pdflatex station-link.tex` (twice) elsewhere.
|
(twice) and commit it with the `.tex`; the LaTeX build files next to it are ignored. The section "Naming the MAC"
|
||||||
|
documents the 16-octet STATION_CONFIGURE, which revision 1 retires but the station still decodes.
|
||||||
|
|
||||||
|
### Dropped from the earlier MicrOBU version, and why
|
||||||
|
|
||||||
|
The first port (2026-09-23) carried a few things that Niklas Dathe's current firmware makes unnecessary:
|
||||||
|
|
||||||
|
- **Bench listener** (`CONFIG_MICROBU_BENCH_LISTEN`): his `RAW_CAPTURE` / `RAW_FRAME` does the same over the link.
|
||||||
|
- **BLE pauses advertising while USB is in use**: his TX guard now holds each frame out of the BLE connection-event windows.
|
||||||
|
- **Battery flags at STATUS octets 103-105**: his layout puts channel-load fields there; the app derives low (3.50 V)
|
||||||
|
and critical (3.30 V) from `battery_mv` at octet 129.
|
||||||
|
- **The ETSI test channel** and the UART0 console: the log travels as LOG frames on the USB link.
|
||||||
|
- **`CONFIG_MICROBU_BATTERY_SCALE_PERMILLE`**: his battery code has no trim. The XIAO's reading was never compared
|
||||||
|
with a multimeter on the glued-in cell; the app shows 4.14-4.16 V on a charging cell, close to the charger's 4.20 V.
|
||||||
|
|
||||||
|
### What Niklas Dathe's latest firmware added over his earlier one
|
||||||
|
|
||||||
|
The station grew from about 580 to 1,360 lines. From his commit messages (not all of it read line by line): ITS clock
|
||||||
|
slewing, a TX guard against BLE collisions, stale-request refusal (`generated_at_ms`), a pending queue that replaces an
|
||||||
|
unsent VAM with a newer one, Adaptive DCC with channel-busy-ratio measurement, declared radio operating points from
|
||||||
|
EN 302 571 measurements, robust CCA counters and TX retry, heap diagnostics, asn1c tables kept in flash, BLE with no
|
||||||
|
eFuse-based gates, an on-device TS 102 941 client (enrolment and authorisation relayed by the phone, trust bootstrap and
|
||||||
|
update), the `RAW_CAPTURE` debug path, fragmentation of link messages, the XIAO and `mainboard-v5` boards, and the
|
||||||
|
battery reading.
|
||||||
|
|
||||||
|
### Measured on the bench, 2026-11-11
|
||||||
|
|
||||||
|
Production XIAO on COM10, Pixel 9 Pro on BLE, COM3 board as an on-air listener (details and open points in `TODO.md`):
|
||||||
|
the simulated car's CAMs reach the app; signed CAMs from the phone (tickets 1) and unsigned ones are heard by the
|
||||||
|
listener; over USB with BLE off 95.7 % of 300 signed CAMs were heard and over BLE with the screen on 95.7 % of 188, so
|
||||||
|
the BLE link adds no measurable loss; the BLE bond survives a board reset. `tools/station_tx_test.py` plays the phone
|
||||||
|
over USB and reads the station's own raw capture, which shows the 802.11 source address of what leaves the radio.
|
||||||
|
|
||||||
### What the new firmware changes for the phone
|
### What the new firmware changes for the phone
|
||||||
|
|
||||||
See `docs/station-link.tex` (revision history at its end). In short: `RESULT`/`STATUS` became `CONFIRM` (0x80) with the 131-octet
|
See `docs/station-link.tex` (revision history at its end). In short: `RESULT`/`STATUS` became `CONFIRM` (0x80) with the 131-octet
|
||||||
status in `CONFIRM.detail` of `STATUS_REQUEST`; STATION_CONFIGURE is 6 octets (type, channel, power,
|
status in `CONFIRM.detail` of `STATUS_REQUEST`; STATION_CONFIGURE is 6 octets (type, channel, power,
|
||||||
security, beaconing; no MAC, the address derives from the ticket); BTP-DATA.request carries
|
security, beaconing; no MAC unless the 16-octet form names one, else the address derives from the ticket); BTP-DATA.request carries
|
||||||
`generated_at_ms` (requests older than 1 s are refused); request bodies up to 1536 and indications up
|
`generated_at_ms` (requests older than 1 s are refused); request bodies up to 1536 and indications up
|
||||||
to 65535 octets are fragmented; logs travel as LOG frames (0x7F) on the USB link, so a XIAO needs no
|
to 65535 octets are fragmented; logs travel as LOG frames (0x7F) on the USB link, so a XIAO needs no
|
||||||
UART adapter any more.
|
UART adapter any more.
|
||||||
|
|||||||
@@ -82,6 +82,7 @@ the board from the PC:
|
|||||||
|
|
||||||
```powershell
|
```powershell
|
||||||
py -3.11 tools/station_status_watch.py COMx 30 --configure --rx
|
py -3.11 tools/station_status_watch.py COMx 30 --configure --rx
|
||||||
|
py -3.11 tools/station_tx_test.py COMx --seconds 60 --mac 02:aa:bb:cc:dd:01 # plays the phone, reads the raw own-TX capture
|
||||||
```
|
```
|
||||||
|
|
||||||
It prints the log, the 131-octet STATUS once a second (uptime, signing and radio counters, heap,
|
It prints the log, the 131-octet STATUS once a second (uptime, signing and radio counters, heap,
|
||||||
@@ -107,14 +108,14 @@ BLE_pairing:
|
|||||||
The passkey is public, so the link is encrypted but not protected against an active attacker during
|
The passkey is public, so the link is encrypted but not protected against an active attacker during
|
||||||
the first pairing. A phone that was paired before must forget `micrOBU-XXXX` in Android's Bluetooth
|
the first pairing. A phone that was paired before must forget `micrOBU-XXXX` in Android's Bluetooth
|
||||||
settings after the board's NVS was erased. BLE and ITS-G5 share one RF front end: the firmware holds a
|
settings after the board's NVS was erased. BLE and ITS-G5 share one RF front end: the firmware holds a
|
||||||
frame out of the BLE connection-event windows (`CONFIG_MICROBU_TX_BLE_GUARD`).
|
frame out of the BLE connection-event windows (`CONFIG_MICROBU_TX_BLE_GUARD`; calibrated for a 20 ms connection interval only). The bond is one per board and survives a reset; with several micrOBUs nearby pair the right one in Android first (FLASHING.md).
|
||||||
|
|
||||||
## Tests
|
## Tests
|
||||||
|
|
||||||
```powershell
|
```powershell
|
||||||
$env:PATH = "C:\msys64\ucrt64\bin;C:\msys64\usr\bin;$env:PATH"
|
$env:PATH = "C:\msys64\ucrt64\bin;C:\msys64\usr\bin;$env:PATH"
|
||||||
cd obu-firmware\test\host
|
cd obu-firmware\test\host
|
||||||
make firmware # 39 unit tests: link codec, STATUS, reassembly, V2X_RX, policies. PASS or FAIL per test
|
make firmware # 40 unit tests: link codec, STATUS, reassembly, V2X_RX, policies. PASS or FAIL per test
|
||||||
make # everything: chain, replay of recorded frames, fuzz, battery, firmware
|
make # everything: chain, replay of recorded frames, fuzz, battery, firmware
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
results under "Running". Toolchain: MSYS2 UCRT64 gcc, Option B below (chosen and
|
results under "Running". Toolchain: MSYS2 UCRT64 gcc, Option B below (chosen and
|
||||||
installed 2026-09-11).
|
installed 2026-09-11).
|
||||||
|
|
||||||
**Firmware unit tests (`make firmware`, `test_firmware.cpp`, 39 tests):** the station-link codec byte-exact against
|
**Firmware unit tests (`make firmware`, `test_firmware.cpp`, 40 tests):** the station-link codec byte-exact against
|
||||||
the app's `StationLinkTest` hex, the 131-octet STATUS offsets, request reassembly, the V2X_RX extension
|
the app's `StationLinkTest` hex, the 131-octet STATUS offsets, request reassembly, the V2X_RX extension
|
||||||
(`main/v2x_rx.hpp`; the 494-octet limit, the 14-octet prefix, TX code -> air frame -> RX path), radio operating
|
(`main/v2x_rx.hpp`; the 494-octet limit, the 14-octet prefix, TX code -> air frame -> RX path), radio operating
|
||||||
points, the BLE TX guard, the ITS clock, CCA counters, BLE security and the battery policy. It prints PASS or FAIL
|
points, the BLE TX guard, the ITS clock, CCA counters, BLE security and the battery policy. It prints PASS or FAIL
|
||||||
|
|||||||
Reference in New Issue
Block a user