← index #7220PR #11831
Related · high · value 0.778
QUERY · ISSUE

BLE: Advertising name stays as 'ESP32'

openby plugowskiopened 2021-05-05updated 2021-05-10
extmod

I have an issue while advertise my device, I used ble_advertise helper from examples, which generates payload as below:

payload = b'\x02\x01\x06\x05\tLEDs\x11\x07\xdb\xa7\x7fgl\xbfG\x9c\x89@\x16\x05S@\x8a<'

So visible name in Bluetooth scanners should be LEDs but it is advertising as ESP32 all the time (I saw LEDs, few times only, after that it has been override as ESP32).

Any suggestions?

CANDIDATE · PULL REQUEST

examples/bluetooth/ble_advertising.py: Error when advertising payload is too large instead of silently failing

closedby North101opened 2023-06-20updated 2023-09-01
examples

When adverting a name + _UART_SERVICE using the bluetooth module, I ran into an issue where a name longer than 8 characters would not be advertising the data I set, It would instead be advertising as if no other data was set. After debugging and looking into the BLE docs I finally figured out that the maximum size of the advertising payload is 31 bytes and I was exceeding it.

To prevent others from running into this issue I've modified the examples to warn when the payload is too large and show that you can send any other data using resp_data.

Keyboard

j / / n
next pair
k / / p
previous pair
1 / / h
show query pane
2 / / l
show candidate pane
c
copy suggested comment
r
toggle reasoning
g i
go to index
?
show this help
esc
close overlays

press ? or esc to close

copied