From 03efcfd4ee308c0969001c5adc367a6a720c3044 Mon Sep 17 00:00:00 2001 From: Ashin Walpola Date: Wed, 11 Nov 2026 15:23:01 +0100 Subject: [PATCH] Ask for an ATT MTU of 517 so a 512-octet link message is not split The app requests 517 and needs 515 for a 494-octet V2X_RX; the station's 512 left a message of 492 to 494 octets to be fragmented, which the app does not reassemble. Record the TX-loss measurement in TODO: BLE adds no measurable loss over USB. --- TODO.md | 14 +++++++++----- obu-firmware/sdkconfig | 4 ++-- obu-firmware/sdkconfig.defaults | 3 ++- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/TODO.md b/TODO.md index 91878f9..ac0613b 100644 --- a/TODO.md +++ b/TODO.md @@ -23,7 +23,8 @@ on the bench with the COM3 board as a listener: Still open: -- [ ] Bond persistence: unplug, power-cycle the board and see the phone reconnect without pairing. +- [ ] Bond persistence: the board was reflashed (MTU 517) with its NVS kept on 2026-11-11 15:25; open the app and see + it reconnect to micrOBU-66AA without a pairing prompt. - [ ] Verify a captured signature with `test/verify_signed_pcap.py` (needs the sniffer firmware). - [ ] 17 of 20 signed CAMs heard against 20 sent: measure the loss over a few minutes, with and without the BLE link busy (TX BLE guard). @@ -37,10 +38,13 @@ Still open: is the 802.11 source of signed and of unsigned frames; without one a signed frame carries the ticket-derived address and an unsigned one a random MAC. Still to see on a ride: the MAC changes at the rotation interval. -- [ ] TX loss: over USB with BLE off 287 of 300 signed CAMs were heard by the COM3 listener (95.7 %) while - the board reports 300 submitted and 300 completed, so about 4 % is lost on the air or in the listener - even without BLE. The same 5 minutes over BLE from the phone is still to run (needs the phone paired to - micrOBU-66AA first). +- [x] TX loss, measured 2026-11-11 with the COM3 listener: USB with BLE off 287 of 300 signed CAMs heard (95.7 %, + the board reports 300 submitted and 300 completed); BLE from the phone's pinger with the screen on 180 of + the 188 the board put on air (95.7 %). So the BLE link adds no measurable loss, and the ~4 % is on the air + or in the listener. One earlier BLE run, during which the phone screen turned off, heard 261 of about + 305 (86 %): to check whether Android's changed connection interval (the board logged 48.75 ms once; the TX + guard is calibrated for 20 ms only) is the cause, log the board's `BLE interval ... no calibrated TX guard` + warning over a longer run with the screen off. - [ ] BLE with several boards: with no bond the app connects to the first micrOBU it hears. On the bench four advertise at -49 to -55 dBm (4AFA, 3FAA, A25E, 66AA) and it paired with the wrong one (4AFA). Pair the right board in Android's Bluetooth settings first, or add a choice to the app. diff --git a/obu-firmware/sdkconfig b/obu-firmware/sdkconfig index 4c66b6a..aed7ce8 100644 --- a/obu-firmware/sdkconfig +++ b/obu-firmware/sdkconfig @@ -1427,7 +1427,7 @@ CONFIG_BT_NIMBLE_USE_ESP_TIMER=y # # GATT / ATT # -CONFIG_BT_NIMBLE_ATT_PREFERRED_MTU=512 +CONFIG_BT_NIMBLE_ATT_PREFERRED_MTU=517 # default: CONFIG_BT_NIMBLE_ATT_MAX_PREP_ENTRIES=64 # default: @@ -3896,7 +3896,7 @@ CONFIG_NIMBLE_RPA_TIMEOUT=900 CONFIG_NIMBLE_MAX_CONNECTIONS=1 CONFIG_NIMBLE_MAX_CCCDS=8 # CONFIG_NIMBLE_CRYPTO_STACK_MBEDTLS is not set -CONFIG_NIMBLE_ATT_PREFERRED_MTU=512 +CONFIG_NIMBLE_ATT_PREFERRED_MTU=517 CONFIG_NIMBLE_L2CAP_COC_MAX_NUM=0 CONFIG_BT_NIMBLE_MSYS1_BLOCK_COUNT=12 CONFIG_BT_NIMBLE_ACL_BUF_COUNT=24 diff --git a/obu-firmware/sdkconfig.defaults b/obu-firmware/sdkconfig.defaults index fcc7755..17175c3 100644 --- a/obu-firmware/sdkconfig.defaults +++ b/obu-firmware/sdkconfig.defaults @@ -35,7 +35,8 @@ CONFIG_LOG_COLORS=n CONFIG_BT_ENABLED=y CONFIG_BT_BLUEDROID_ENABLED=n CONFIG_BT_NIMBLE_ENABLED=y -CONFIG_BT_NIMBLE_ATT_PREFERRED_MTU=512 +# MicrOBU: 517, not 512: the app asks for 517 and wants an ATT value of 512 + 3 so that a 512-octet link message (a 494-octet V2X_RX) is not split. +CONFIG_BT_NIMBLE_ATT_PREFERRED_MTU=517 CONFIG_BT_NIMBLE_SM_SC=y CONFIG_BT_NIMBLE_SM_LEGACY=n CONFIG_BT_NIMBLE_SM_SC_ONLY=1