From da36e0503ee950353d309872396d592d9c7c27c6 Mon Sep 17 00:00:00 2001 From: TeTeHacko Date: Tue, 4 Aug 2026 13:48:07 +0200 Subject: [PATCH] fix(repeater): advertise the node's real name over BLE; harden the UF2 flasher Co-Authored-By: Claude Opus 5 --- examples/simple_repeater/main.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/examples/simple_repeater/main.cpp b/examples/simple_repeater/main.cpp index 32e8a4af..080253eb 100644 --- a/examples/simple_repeater/main.cpp +++ b/examples/simple_repeater/main.cpp @@ -651,7 +651,18 @@ void setup() { // the library ever sets the CONN role, so an established link runs at the // SoftDevice default 0 dBm. See RPT_BLE_CONN_TX_POWER / `blepwr` for that half. Bluefruit.setTxPower(8); - Bluefruit.setName(BLE_DEVICE_NAME); + // CUSTOM (TeTeHacko): advertise the node's ACTUAL name, not the build-time + // constant. BLE_DEVICE_NAME defaults to ADVERT_NAME, which only ever seeds a + // fresh install -- so once several boards share one image, they all advertise + // the same string no matter what `set name` says, and a BLE scan cannot tell + // them apart. Four boards here advertised "bench-board" at once, including the + // one with a dead radio. The prefs name is the one that was deliberately set, + // so that is the one to broadcast; the build constant stays the fallback for a + // node that has never been named. + { + const char* nm = the_mesh.getNodePrefs()->node_name; + Bluefruit.setName((nm && nm[0]) ? nm : BLE_DEVICE_NAME); + } Bluefruit.Security.setPIN(_MC_STR(BLE_PIN_CODE)); // widen the BLE connection params so the busy LoRa loop can't trip the // (default 2 s) supervision timeout -> no more reconnect churn. PPCP is