From 5afeca1b76977cee2eb99756a498bb6aafdbb7b1 Mon Sep 17 00:00:00 2001 From: TeTeHacko Date: Tue, 21 Jul 2026 13:43:34 +0200 Subject: [PATCH] fix(repeater/ble): widen conn interval 15-30 -> 60-80 ms; pktfeed ring 32 -> 64 Co-Authored-By: Claude Fable 5 --- examples/simple_repeater/main.cpp | 11 +++++++++-- variants/sensecap_solar/platformio.ini | 10 ++++++---- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/examples/simple_repeater/main.cpp b/examples/simple_repeater/main.cpp index f2ffb193..f09fb716 100644 --- a/examples/simple_repeater/main.cpp +++ b/examples/simple_repeater/main.cpp @@ -50,8 +50,15 @@ // freeze is still caught by the 20 s hardware watchdog (16 s < 20 s). Like the // companion, request the params explicitly on 'secured' (some centrals ignore // the advertised PPCP). - #define RPT_BLE_MIN_CONN_INTERVAL 12 // 15 ms (1.25 ms units) - #define RPT_BLE_MAX_CONN_INTERVAL 24 // 30 ms + // Interval 60-80 ms (was 15-30 ms): a controlled A/B test (21 Jul 2026) showed + // ~40 % of DIRECT-route LoRa forwards silently lost with an IDLE BLE + // connection at 15-30 ms — the SoftDevice's per-event preemption disturbs the + // SX126x TX path (startTransmit fail / send-complete timeout). Fewer + // connection events = proportionally fewer collisions; the Dispatcher TX + // retry (MESH_TX_RETRIES) covers the rest. Console throughput drops ~3x, + // which the duty-cycled bridge tolerates fine. + #define RPT_BLE_MIN_CONN_INTERVAL 48 // 60 ms (1.25 ms units) + #define RPT_BLE_MAX_CONN_INTERVAL 64 // 80 ms // latency 0 (not the companion's 4): the mast link is marginal (RSSI -75..-90) // and the disconnects are HCI reason 0x3E (lost sync), not supervision timeout. // With latency>0 the node may skip connection events -> the central loses sync diff --git a/variants/sensecap_solar/platformio.ini b/variants/sensecap_solar/platformio.ini index 9e9d9994..cd2ea96a 100644 --- a/variants/sensecap_solar/platformio.ini +++ b/variants/sensecap_solar/platformio.ini @@ -94,11 +94,13 @@ build_flags = ; neighbour advert period even on inversion evenings. -D MAX_HEARD_NODES=128 -D RXLOG_SIZE=512 - ; PKTFEED_SIZE 32 (~268 B/rec, 8.6 KB): observer feed ring -- like rxlog but + ; PKTFEED_SIZE 64 (~268 B/rec, 17 KB): observer feed ring -- like rxlog but ; with full raw frame bytes (`pktlog` cmd) for the meshcoretomqtt-compatible - ; community analyzer feed. 32 records ≈ 4+ min of typical traffic between - ; 5 s bridge polls; drop detection via the E-trailer catches any overflow. - -D PKTFEED_SIZE=32 + ; community analyzer feed. The bridge now polls in a connect->drain->disconnect + ; duty cycle (BLE connections disturb LoRa TX, see MESH_TX_RETRIES), so drains + ; are ~3-4 min apart: 64 records ≈ 10+ min of typical traffic buys margin for + ; busy evenings; drop detection via the E-trailer catches any overflow. + -D PKTFEED_SIZE=64 ; -D MESH_PACKET_LOGGING=1 build_src_filter = ${SenseCap_Solar.build_src_filter} +<../examples/simple_repeater/*.cpp>