Blufi device name change?

glrtheil
Posts: 61
Joined: Tue Dec 07, 2021 2:48 pm

Blufi device name change?

Postby glrtheil » Mon Feb 07, 2022 5:19 pm

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?

mcmega
Posts: 16
Joined: Fri Oct 23, 2020 5:32 pm

Re: Blufi device name change?

Postby mcmega » Thu Mar 17, 2022 1:36 pm

I, too, faced such a need!
Any help!
How to change device name?

irahul
Posts: 46
Joined: Fri Jun 18, 2021 10:07 am

Re: Blufi device name change?

Postby irahul » 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.

glrtheil
Posts: 61
Joined: Tue Dec 07, 2021 2:48 pm

Re: Blufi device name change?

Postby glrtheil » 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.

irahul
Posts: 46
Joined: Fri Jun 18, 2021 10:07 am

Re: Blufi device name change?

Postby irahul » Tue Mar 29, 2022 6:35 am

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.

glrtheil
Posts: 61
Joined: Tue Dec 07, 2021 2:48 pm

Re: Blufi device name change?

Postby glrtheil » Tue Apr 05, 2022 5:28 pm

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?

glrtheil
Posts: 61
Joined: Tue Dec 07, 2021 2:48 pm

Re: Blufi device name change?

Postby glrtheil » Tue Apr 19, 2022 5:14 pm

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

Who is online

Users browsing this forum: Gaston1980 and 94 guests