-
Notifications
You must be signed in to change notification settings - Fork 7.7k
change(ble_mesh): Allow setting the default pb-gatt device name (IDFGH-14914) #15623
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Currently, even if you call esp_ble_mesh_set_unprovisioned_device_name immediately after esp_ble_mesh_init, you can end up sending out an advertisement using the default 'ESP-BLE-MESH' name. Unfortunately, due to iOS limitations, this can be problematic as there's no way for a user app to flush the cached names. Resolve this by allowing the default name to be set before calling esp_ble_mesh_init.
👋 Hello s0be, we appreciate your contribution to this project! 📘 Please review the project's Contributions Guide for key guidelines on code, documentation, testing, and more. 🖊️ Please also make sure you have read and signed the Contributor License Agreement for this project. Click to see more instructions ...
Review and merge process you can expect ...
|
Currently this part of the functionality is already available, you can learn about the API: |
@forx157 Unfortunately |
For context, here's the change we made to our app when introducing this patch and it resolved seeing 'ESP-BLE-MESH' as the name:
|
Any chance you can comment on if there's a better way for us to solve the problem this patch solves? We're fine with carrying a patch to cover deficiencies in esp-idf, but I'm sure we're not the only customer who has or will see this problem. |
@forx157 Friendly ping. Can you review my comments here? The existing API is not sufficient for our needs for the reasons outlined. |
Hi, @s0be |
Sadly no, we use our device's serial number as the BLE Gatt Name, and need that as part of our pairing flow. |
Hi, @s0be The following code sequence for mesh initialization may meet your needs:
The node does not start advertising immediately after esp_ble_mesh_init is called, but only after esp_ble_mesh_prov_enable is invoked. Thus, changing the device name before advertising starts can prevent iOS cache issues. |
Sadly, that calling path was not sufficient, as I called out above. A small percentage of the time, the BLE stack would send out 1 advertisement with 'ESP-BLE-MESH' which would then get seen by iOS and cached. |
Theoretically, this situation shouldn't occur. I haven't encountered this issue in my local tests. Would you mind sharing your testing method and logs? |
I believe the reason you don't see it is you're invoking prov_enable, while my device was already provisioned and has proxy enabled. I'm putting together a minimal example that repro's it on an esp32s3 devkit board. |
Description
Currently, even if you call esp_ble_mesh_set_unprovisioned_device_name immediately after esp_ble_mesh_init, you can end up sending out an advertisement using the default 'ESP-BLE-MESH' name. Unfortunately, due to iOS limitations, this can be problematic as there's no way for a user app to flush the cached names.
Resolve this by allowing the default name to be set before calling esp_ble_mesh_init.
Testing
Modified our esp_ble_mesh test hardware and confirmed iOS never saw ESP-BLE-MESH advertised. Backported to esp-idf 5.2 for testing.
Checklist
Before submitting a Pull Request, please ensure the following: