Change the name of the node in the esp ble mesh

abansal22
Posts: 105
Joined: Wed Apr 22, 2020 8:24 am

Change the name of the node in the esp ble mesh

Postby abansal22 » Sun May 23, 2021 10:49 am

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.

ZacDaMan
Posts: 47
Joined: Wed Dec 22, 2021 7:40 pm

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

Postby ZacDaMan » Mon Jan 10, 2022 11:03 pm

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.
Last edited by ZacDaMan on Fri Feb 04, 2022 2:09 am, edited 2 times in total.

abansal22
Posts: 105
Joined: Wed Apr 22, 2020 8:24 am

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

Postby abansal22 » Tue Jan 11, 2022 6:41 am

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.

ZacDaMan
Posts: 47
Joined: Wed Dec 22, 2021 7:40 pm

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

Postby ZacDaMan » Fri Feb 04, 2022 2:05 am

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

abansal22
Posts: 105
Joined: Wed Apr 22, 2020 8:24 am

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

Postby abansal22 » Fri Feb 04, 2022 2:32 am

Thanks man for the info!!

usmanmehmood55
Posts: 10
Joined: Wed Feb 03, 2021 7:54 am

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

Postby usmanmehmood55 » Thu Mar 10, 2022 8:03 am

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);

Who is online

Users browsing this forum: Bing [Bot] and 64 guests