Skip to content

Fix Device Name in ATT Read Request (0x2A00). - #2

Merged
vidplace7 merged 1 commit into
vidplace7:pioarduino-nimblefrom
cpatulea:pioarduino-nimble
Mar 2, 2026
Merged

vidplace7 merged 1 commit into
vidplace7:pioarduino-nimblefrom
cpatulea:pioarduino-nimble

Conversation

@cpatulea

Copy link
Copy Markdown

Device Name is exposed in two places:

  • Advertisement data: this is set properly in startAdvertising.
  • GATT attribute Device Name (0x2A00). This one is handled internally in NimBLE and comes from ble_svc_gap_device_name_set. This is set initially, but then BLEDevice::createServer calls ble_svc_gap_init which resets the device name. This causes the device to apparently "change name after pairing":

< ACL Data TX:... flags 0x00 dlen 7 meshtastic#113 [hci0] 14.241149
ATT: Read Request (0x0a) len 2
Handle: 0x0003 Type: Device Name (0x2a00)

ACL Data RX: Handle 2048 flags 0x02 dlen 11 meshtastic#115 [hci0] 14.269050
ATT: Read Response (0x0b) len 6
Value[6]: 6e696d626c65 # "nimble"

Workaround this by setting the device name once again after BLEDevice::createServer.

Device Name is exposed in two places:

- Advertisement data: this is set properly in startAdvertising.
- GATT attribute Device Name (0x2A00). This one is handled internally in NimBLE
  and comes from ble_svc_gap_device_name_set. This is set initially, but then
  BLEDevice::createServer calls ble_svc_gap_init which resets the device name.
  This causes the device to apparently "change name after pairing":

< ACL Data TX:... flags 0x00 dlen 7  meshtastic#113 [hci0] 14.241149
      ATT: Read Request (0x0a) len 2
        Handle: 0x0003 Type: Device Name (0x2a00)
> ACL Data RX: Handle 2048 flags 0x02 dlen 11             meshtastic#115 [hci0] 14.269050
      ATT: Read Response (0x0b) len 6
        Value[6]: 6e696d626c65   # "nimble"

Workaround this by setting the device name once again after
BLEDevice::createServer.
@cpatulea

Copy link
Copy Markdown
Author

@cpatulea

cpatulea commented Feb 25, 2026 •

Copy link
Copy Markdown
Author

@cpatulea

Copy link
Copy Markdown
Author

@dblaber

dblaber commented Feb 27, 2026

Copy link
Copy Markdown

firmware-heltec-v4-2.7.20.5a06843.bin.zip

Did some basic testing with this build(Heltec V4). Upgrading from the last stable release preserved existing BT bonds and everything functioned as expected. Forgetting and re-bonding worked at least as well as before. General interactions tested fine — no regressions noted.

@cpatulea

Copy link
Copy Markdown
Author

Thank you very much @dblaber

I have been running this on my Heltec v3, with Bluetooth connected, for two days. No issues. Reconnects automatically on power cycle. Reconnects automatically on config change.

@vidplace7 would you mind looking at this and merging if it looks OK?

@cpatulea

Copy link
Copy Markdown
Author

@cpatulea

Copy link
Copy Markdown
Author

Pinged vid on Discord

@vidplace7
vidplace7 merged commit ce505e1 into vidplace7:pioarduino-nimble Mar 2, 2026
1 check passed
@cpatulea
cpatulea deleted the pioarduino-nimble branch April 22, 2026 00:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants