ESP Module device name does not change for iOS

sameer_kelaskar
Posts: 7
Joined: Mon Apr 24, 2023 4:36 pm

ESP Module device name does not change for iOS

Postby sameer_kelaskar » Wed Apr 26, 2023 7:52 pm

Hello,

I have implemented a BLE GATT server in ESP-IDF v4.3.1 on ESP32-WROOM ESP32-DEVKITC and to connect I am using the LightBlue app. In the app when I connect to the esp module, the ESP module device name which I select remains constant; while the 'local name' in the advertised data changes as I do.
This only happens in case of iOS. While I use the same code for android light ble app ESP module device name which I select and the advertised local name both change together.
All kind help is appreciated.

Many thanks,
Sameer
Attachments
Skype_Picture_2023_04_26T19_49_25_056Z.jpeg
Skype_Picture_2023_04_26T19_49_25_056Z.jpeg (224 KiB) Viewed 2608 times

MicroController
Posts: 1707
Joined: Mon Oct 17, 2022 7:38 pm
Location: Europe, Germany

Re: ESP Module device name does not change for iOS

Postby MicroController » Thu Apr 27, 2023 5:59 pm

Might be a caching/bonding issue. You may be able to "refresh" the cached connection data in the app if it has such a function.
A "cleaner" solution may be issuing a "service changed" notification to let interested/bonded clients know that they'd have to re-discover services and attributes, including the "Device Name" characteristic (0x2A00) if present. Although the device name may also be stored/cached with the bonding data and not affected at all by any subsequent name changes from the peripheral after bonding is completed.

sameer_kelaskar
Posts: 7
Joined: Mon Apr 24, 2023 4:36 pm

Re: ESP Module device name does not change for iOS

Postby sameer_kelaskar » Fri Apr 28, 2023 12:56 pm

MicroController wrote:
Thu Apr 27, 2023 5:59 pm
Might be a caching/bonding issue. You may be able to "refresh" the cached connection data in the app if it has such a function.
A "cleaner" solution may be issuing a "service changed" notification to let interested/bonded clients know that they'd have to re-discover services and attributes, including the "Device Name" characteristic (0x2A00) if present. Although the device name may also be stored/cached with the bonding data and not affected at all by any subsequent name changes from the peripheral after bonding is completed.
Hello,
Can I please know that if whether the "service changed notification" be used with NIMBle, and you have mentioned "Device Name" characteristic (0x2A00) so that should be UUID what function apis can be used to access these two parameters. Also can the notification function be called explicitly?

MicroController
Posts: 1707
Joined: Mon Oct 17, 2022 7:38 pm
Location: Europe, Germany

Re: ESP Module device name does not change for iOS

Postby MicroController » Sat Apr 29, 2023 6:33 pm

sameer_kelaskar wrote:
Fri Apr 28, 2023 12:56 pm
Hello,
Can I please know that if whether the "service changed notification" be used with NIMBle, and you have mentioned "Device Name" characteristic (0x2A00) so that should be UUID what function apis can be used to access these two parameters.
You can set the 0x2A00 characteristic's value via ble_svc_gap_device_name_set(...). This is separate from the device name included in advertisements, but should be set to the same value, or, if using a shortened name in advertisements, the advertised value should be a prefix of that exact name.
Also can the notification function be called explicitly?

Code: Select all

#include "services/gatt/ble_svc_gatt.h"

ble_svc_gatt_changed(0,0xffff);

sameer_kelaskar
Posts: 7
Joined: Mon Apr 24, 2023 4:36 pm

Re: ESP Module device name does not change for iOS

Postby sameer_kelaskar » Wed May 10, 2023 4:53 am

MicroController wrote:
Sat Apr 29, 2023 6:33 pm
sameer_kelaskar wrote:
Fri Apr 28, 2023 12:56 pm
Hello,
Can I please know that if whether the "service changed notification" be used with NIMBle, and you have mentioned "Device Name" characteristic (0x2A00) so that should be UUID what function apis can be used to access these two parameters.
You can set the 0x2A00 characteristic's value via ble_svc_gap_device_name_set(...). This is separate from the device name included in advertisements, but should be set to the same value, or, if using a shortened name in advertisements, the advertised value should be a prefix of that exact name.
Also can the notification function be called explicitly?

Code: Select all

#include "services/gatt/ble_svc_gatt.h"

ble_svc_gatt_changed(0,0xffff);

Hi,
I have tried using ble_svc_gap_device_name_set() function, to change characteristic's value and the ble_svc_gatt_changed() function to notify but so far I did not get any notification indicating that the service change, please let me know where can I verify the result on both client and server side.
All kind help is appreciated.
Attachments
servicechange_api#03_1.png
usage of ble_svc_gap_device_name_set()
servicechange_api#03_1.png (271.41 KiB) Viewed 2261 times
servicechange_api#02_1.png
usage of ble_svc_gap_device_name_set()
servicechange_api#02_1.png (241.78 KiB) Viewed 2261 times

sameer_kelaskar
Posts: 7
Joined: Mon Apr 24, 2023 4:36 pm

Re: ESP Module device name does not change for iOS

Postby sameer_kelaskar » Wed May 10, 2023 4:55 am

sameer_kelaskar wrote:
Wed May 10, 2023 4:53 am
MicroController wrote:
Sat Apr 29, 2023 6:33 pm
sameer_kelaskar wrote:
Fri Apr 28, 2023 12:56 pm
Hello,
Can I please know that if whether the "service changed notification" be used with NIMBle, and you have mentioned "Device Name" characteristic (0x2A00) so that should be UUID what function apis can be used to access these two parameters.
You can set the 0x2A00 characteristic's value via ble_svc_gap_device_name_set(...). This is separate from the device name included in advertisements, but should be set to the same value, or, if using a shortened name in advertisements, the advertised value should be a prefix of that exact name.
Also can the notification function be called explicitly?

Code: Select all

#include "services/gatt/ble_svc_gatt.h"

ble_svc_gatt_changed(0,0xffff);

Hi,
I have tried using ble_svc_gap_device_name_set() function, to change characteristic's value and the ble_svc_gatt_changed() function to notify but so far I did not get any notification indicating that the service change, please let me know where can I verify the result on both client and server side.
All kind help is appreciated.
Attachments
app_2.jpg
light blue app result
app_2.jpg (158.15 KiB) Viewed 2259 times

Who is online

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