Summary
We'd like a supported way to give each device a unique, application-controlled name during BLE provisioning (e.g. embedding our own factory serial number) instead of the fixed <VENDOR_PREFIX> <TEMPLATE_NAME>- format.
Environment
Edgent-ESP-IDF v1.0.3
ESP-IDF v6.0.1
Target: ESP32-S3
What we tried
-
Pre-seeding NVS blynk/rand_suffix before edgent_init(). Edgent persists a suffix to this key, so we assumed it might read an existing value instead of always regenerating one. It doesn't — the advertised name still shows Edgent's own freshly-generated suffix regardless of what's already in NVS at init time.
-
Calling the NimBLE public API ble_svc_gap_device_name_set() after Edgent's init. Returns success, but only updates the GATT Device Name characteristic (0x2A00) — it has no effect on the actual advertising/scan-response payload a BLE scanner shows before connecting, since Edgent already baked its own name into that payload during its own advertising setup.
-
Stopping and replacing Edgent's live advertisement ourselves (ble_gap_adv_stop() → our own ble_gap_adv_set_fields() + ble_gap_adv_rsp_set_fields() → ble_gap_adv_start() with a pass-through GAP event callback, working around the 31-byte legacy-ADV limit by splitting flags into the primary packet and the name into the scan response). This does successfully change the advertised name. But it breaks the provisioning protocol itself: once our callback replaces Edgent's, provisioning_svr.c logs Error: can't lock semaphore in reasonable time and the credential exchange never completes. Whatever synchronization Edgent's own GAP callback performs for the provisioning handshake is lost when that callback is replaced.
Request
A public API or config option to set a custom BLE device name (or just the "suffix" portion) that's actually honored by the internal advertising setup, or
Documentation on how applications are meant to safely add to or observe the BLE advertisement/GAP events during provisioning without breaking provisioning_svr.c's internal state tracking.
Summary
We'd like a supported way to give each device a unique, application-controlled name during BLE provisioning (e.g. embedding our own factory serial number) instead of the fixed <VENDOR_PREFIX> <TEMPLATE_NAME>- format.
Environment
Edgent-ESP-IDF v1.0.3
ESP-IDF v6.0.1
Target: ESP32-S3
What we tried
Pre-seeding NVS blynk/rand_suffix before edgent_init(). Edgent persists a suffix to this key, so we assumed it might read an existing value instead of always regenerating one. It doesn't — the advertised name still shows Edgent's own freshly-generated suffix regardless of what's already in NVS at init time.
Calling the NimBLE public API ble_svc_gap_device_name_set() after Edgent's init. Returns success, but only updates the GATT Device Name characteristic (0x2A00) — it has no effect on the actual advertising/scan-response payload a BLE scanner shows before connecting, since Edgent already baked its own name into that payload during its own advertising setup.
Stopping and replacing Edgent's live advertisement ourselves (ble_gap_adv_stop() → our own ble_gap_adv_set_fields() + ble_gap_adv_rsp_set_fields() → ble_gap_adv_start() with a pass-through GAP event callback, working around the 31-byte legacy-ADV limit by splitting flags into the primary packet and the name into the scan response). This does successfully change the advertised name. But it breaks the provisioning protocol itself: once our callback replaces Edgent's, provisioning_svr.c logs Error: can't lock semaphore in reasonable time and the credential exchange never completes. Whatever synchronization Edgent's own GAP callback performs for the provisioning handshake is lost when that callback is replaced.
Request
A public API or config option to set a custom BLE device name (or just the "suffix" portion) that's actually honored by the internal advertising setup, or
Documentation on how applications are meant to safely add to or observe the BLE advertisement/GAP events during provisioning without breaking provisioning_svr.c's internal state tracking.