Page 1 of 1

Blufi device name change?

Posted: Mon Feb 07, 2022 5:19 pm
by glrtheil
When using either the android or iOS espblufi app to configure a blufi device, it always shows up as "BLUFI_DEVICE". So if you have a few that are ready to be connected to, they all say "BLUFI_DEVICE". On Android it shows the MAC of the bluetooth interface, and on iOS is shows a bunch of letters/numbers that don't match to anything relevant. Is there a way, in the firmware, to change "BLUFI_DEVICE" to a different value?

Re: Blufi device name change?

Posted: Thu Mar 17, 2022 1:36 pm
by mcmega
I, too, faced such a need!
Any help!
How to change device name?

Re: Blufi device name change?

Posted: Sat Mar 19, 2022 1:40 pm
by irahul
In examples/bluetooth/blufi/main/blufi_init.c , i see the code to set the name

rc = ble_svc_gap_device_name_set(BLUFI_DEVICE_NAME);

Changing the macro to your desired name or passing preferred name to this API, should help.

Re: Blufi device name change?

Posted: Mon Mar 28, 2022 3:27 pm
by glrtheil
irahul wrote:
Sat Mar 19, 2022 1:40 pm
In examples/bluetooth/blufi/main/blufi_init.c , i see the code to set the name

rc = ble_svc_gap_device_name_set(BLUFI_DEVICE_NAME);

Changing the macro to your desired name or passing preferred name to this API, should help.
This is only #ifdef CONFIG_BT_NIMBLE_ENABLED. In the case of the blufi example app. Not using nimble, as bluedroid is the default. Even by redefining the BLUFI_DEVICE_NAME macro, it doesn't end up using that value.

Re: Blufi device name change?

Posted: Tue Mar 29, 2022 6:35 am
by irahul
glrtheil wrote:
Mon Mar 28, 2022 3:27 pm
irahul wrote:
Sat Mar 19, 2022 1:40 pm
In examples/bluetooth/blufi/main/blufi_init.c , i see the code to set the name

rc = ble_svc_gap_device_name_set(BLUFI_DEVICE_NAME);

Changing the macro to your desired name or passing preferred name to this API, should help.
This is only #ifdef CONFIG_BT_NIMBLE_ENABLED. In the case of the blufi example app. Not using nimble, as bluedroid is the default. Even by redefining the BLUFI_DEVICE_NAME macro, it doesn't end up using that value.

For bluedroid, please check if modifying the macro BLUFI_DEVICE_NAME in common/btc/profile/esp/blufi/include/esp_blufi.h file works for you.

Re: Blufi device name change?

Posted: Tue Apr 05, 2022 5:28 pm
by glrtheil
irahul wrote:
Tue Mar 29, 2022 6:35 am
For bluedroid, please check if modifying the macro BLUFI_DEVICE_NAME in common/btc/profile/esp/blufi/include/esp_blufi.h file works for you.
This seems to do something, but isn't working how I'd expect. On iOS when I change that value, the device no longer shows up in the EspBluFi app, however it shows up in the app we're developing but still shows "BLUFI_DEVICE" (this may be a problem with our app, will have to check with the developer).

There are a couple problems with this method. First, if I make that change, it's part of the IDF, so if another developer compiles and flashes, they are using the wrong value. Second, I need it to be dynamic. I need to be able to set the value to the unique identifier of the ESP32 (in our case, the wifi MAC).

Is there not another way to handle this?

Re: Blufi device name change?

Posted: Tue Apr 19, 2022 5:14 pm
by glrtheil
The solution here is to change esp_bt_dev_set_device_name() so that it works with blufi. I've updated this feature request, but it's been open for months. https://github.com/espressif/esp-idf/issues/8071