cancel
Showing results for 
Search instead for 
Did you mean: 

STM32WB05: How to change default device name (MP1_XXXXXX) in iBeacon advertising ?

burak_Guzeller
Associate III

Hello,

I am working with STM32WB05KN in beacon mode (non-connectable advertising, legacy advertising).

I am configuring advertising manually using:

  • aci_gap_set_advertising_configuration()

  • aci_gap_set_advertising_data_nwk()

  • aci_gap_set_advertising_enable()

My advertising data contains only:

  • Flags (0x01)

  • Manufacturer specific data (iBeacon format)  

aci_gap_init(PRIVACY_DISABLED, HCI_ADDR_PUBLIC);
:
:

uint8_t adv_data[] = {
/* Advertising data: Flags AD Type */
0x02,
0x01,
0x06,

/* Advertising data: manufacturer specific data */
26, /* len */

AD_TYPE_MANUFACTURER_SPECIFIC_DATA, /* manufacturer type */

0x30, 0x00, /* Company identifier code (Default is 0x0030 - STMicroelectronics: To be customized for specific identifier) */

0x02, /* ID */

0x15, /* Length of the remaining payload */

0xE2, 0x0A, 0x39, 0xF4, 0x73, 0xF5, 0x4B, 0xC4, /* Location UUID */
0xA1, 0x2F, 0x17, 0xD1, 0xAD, 0x07, 0xA9, 0x61,

0x00, 0x00, /* Major number */

0x00, 0x00, /* Minor number */

0xC8 /* 2's complement of the Tx power (-56dB --> (uint8_t)-56) */
};

ret = aci_gap_set_advertising_data_nwk(0, ADV_COMPLETE_DATA, sizeof(adv_data), adv_data);
if(ret != BLE_STATUS_SUCCESS) {
  PRINT_DBG("aci_gap_set_advertising_data_nwk() failed: 0x%02x\r\n", ret);
}
else {
  PRINT_DBG("aci_gap_set_advertising_data_nwk() --> SUCCESS\r\n");
}

 

However, when scanning from a mobile phone, the device name appears as:

MP1_47F8AA

I did not explicitly set any device name in my application.


My Questions:

  1. Where does the default name “MP1_XXXXXX” come from in STM32WB05?

  2. What is the correct way to override this name when using the *_nwk advertising APIs?

  3. Should I:

    • Use aci_gap_set_device_name()?

    • Or include AD type 0x09 (Complete Local Name) inside advertising data?

  4. If I add the Local Name in advertising, what is the recommended approach considering the 31-byte legacy advertising limit with iBeacon payload?

My goal is to deploy ~100 beacon devices in the field, each with:

  • Unique Major/Minor

  • Optional unique device name

Any best practice recommendations are appreciated.

Thank you.


Edited to apply source code formatting - please see How to insert source code for future reference.

1 REPLY 1
Imen.D
ST Employee

Hello @burak_Guzeller ,

The smartphone can recognize the device if it has been previously connected, bonded, and has read the related Device Name characteristic. In this case, the smartphone will recognize the device with related device name characteristic value. 

Have you tried to remove or clean up the list of devices associated (bonded) with the smartphone? Does this make any change?

On your code, are you setting the device name characteristic using the MP1_47F8AA string?  

After smartphone bonding devices cleanup, you could try to setup your specific device name characteristic on your WB05N device and then interact with your smartphone. 

Please refer to the SensorDemo_BLESensor-App example offered on X-CUBE-WB05N software expansion package which sets the Device name characteristic with a specific name defined by the user:

Projects\NUCLEO-U575ZI\Applications\UART\SensorDemo_BLESensor-App\ 

You can follow the instructions in the readme.txt file describing the application and the UM3406 Getting started with the X-CUBE-WB05N Bluetooth® Low Energy software expansion for STM32Cube - User manual

Follow the example code: 

#define SENSOR_DEMO_NAME   'S','T','M','3','2','W','B','0','5'

uint8_t  device_name[] = {SENSOR_DEMO_NAME};


   /* Init the GAP Profile */
  ret = aci_gap_profile_init(GAP_PERIPHERAL_ROLE, PRIVACY_DISABLED, &dev_name_char_handle, &appearance_char_handle, &Periph_Pref_Conn_Param_Char_Handle);
  if(ret != 0) {
    PRINT_DBG ("Error in aci_gap_profile_init() 0x%04xr\n", ret);
    while(1);
  }
  else
    PRINT_DBG ("aci_gap_profile_init() --> SUCCESS\r\n");

  /* Update device name */
  ret = aci_gatt_srv_write_handle_value_nwk(dev_name_char_handle + 1, 0, sizeof(device_name), device_name);
  if (ret != BLE_STATUS_SUCCESS) {
    PRINT_DBG("aci_gatt_srv_write_handle_value_nwk() failed: 0x%02x\r\n", ret);
    return ret;
  }
  else {
    PRINT_DBG("aci_gatt_srv_write_handle_value_nwk() --> SUCCESS\r\n");
  }

 

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen