BLE: Advertising name stays as 'ESP32'
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?
examples/bluetooth/ble_advertising.py: Error when advertising payload is too large instead of silently failing
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.