Page 1 of 1

Change the name of the node in the esp ble mesh

Posted: Sun May 23, 2021 10:49 am
by abansal22
Hello,

While building the esp ble mesh, the name of the node displayed while provisioning is displayed as the "ESP-BLE-MESH", I want to change the name to something else. Please let me know the procedure for that.

Re: Change the name of the node in the esp ble mesh

Posted: Mon Jan 10, 2022 11:03 pm
by ZacDaMan
EDIT: Don't use this method, see my later reply.
The name is set in "components/bt/esp_ble_mesh/mesh_core/proxy_server.c", on line 1442:

Code: Select all

strncpy(device_name, "ESP-BLE-MESH", DEVICE_NAME_SIZE);
You can trace this back up to figure out an appropriate point to insert your own name, or simply replace this string.

Re: Change the name of the node in the esp ble mesh

Posted: Tue Jan 11, 2022 6:41 am
by abansal22
thanks man!
ZacDaMan wrote:
Mon Jan 10, 2022 11:03 pm
The name is set in "components/bt/esp_ble_mesh/mesh_core/proxy_server.c", on line 1442:
`strncpy(device_name, "ESP-BLE-MESH", DEVICE_NAME_SIZE);

You can trace this back up to figure out an appropriate point to insert your own name, or simply replace this string.

Re: Change the name of the node in the esp ble mesh

Posted: Fri Feb 04, 2022 2:05 am
by ZacDaMan
OK since posting that earlier reply I've found a much better solution (even though it's old, putting it here for others with this issue), and it turns out there's just a function which wasn't in any of the documentation I had read called

Code: Select all

esp_bt_dev_set_device_name(const char* name)
which means you don't have to muck around with ESP-IDF's source code and can leave proxy_server.c alone. Call it after calling

Code: Select all

esp_bluedroid_enable()
. Makes sense there would be a function for it, just took me forever to actually find it!
https://docs.espressif.com/projects/esp ... evice.html

Re: Change the name of the node in the esp ble mesh

Posted: Fri Feb 04, 2022 2:32 am
by abansal22
Thanks man for the info!!

Re: Change the name of the node in the esp ble mesh

Posted: Thu Mar 10, 2022 8:03 am
by usmanmehmood55
Just wanted to point out that for the ESP32-C3, it can be done by

Code: Select all

bt_mesh_set_device_name(const char *name);