This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

HRS_Advertiser Example - After Connection, Beacon is Working?

  • Custom Board which has NordicSemi nRF51822-QFAA MCU,

Custom Board's Chip

The circuit follows the internal LDO setup.

(Ref. nRF51822_PS v3.1 Section 11.3.1)

  • Softdevice S110 7.1

  • IAR for ARM 7.1

  • SDK 7.2 using experimental_ble_app_multiactivity_beacon example (hrs_advertiser).

  • Testing with iPhone 5S, 6 and iPad air (iOS 8.1.3)

/ Nexus 5 and Galaxy Note 3 (Android 4.4.2).

  • Using J-Link Debugger

/**********************************************/

I was trying hrs_advertiser example.

Using the sniffer, my custom board did advertised as a beacon.

However, the packet was weird when I looked through Wireshark.

hrs_advertiser.pcapng

Wireshark

After I connect the board to my Galaxy Note 3, I recieved heart rate data.

Master Panel

Master - HRS

However, the beacon wasn't discovered using the nRF Beacon App.

I turned this App using my Nexus 5.

nRF Beacon

My custom board worked as a beacon when I tested the ble_app_beacon example.

One suspicious point is about the flag bits.

This is the packet when I test with the beacon example (ble_app_beacon).

beacon normal

Whereas this hrs_advertiser example, shows a bit different.

example flag

What could be the problem?

In the code of hrs_advertiser,

static void advertising_init(void)
{
uint32_t      err_code;
ble_advdata_t advdata;
uint8_t       flags = BLE_GAP_ADV_FLAGS_LE_ONLY_GENERAL_DISC_MODE;
//whereas BLE_GAP_ADV_FLAG_BR_EDR_NOT_SUPPORTED is set at the ble_app_beacon example

ble_uuid_t adv_uuids[] =
{
    {BLE_UUID_HEART_RATE_SERVICE,         BLE_UUID_TYPE_BLE},
    {BLE_UUID_BATTERY_SERVICE,            BLE_UUID_TYPE_BLE},
    {BLE_UUID_DEVICE_INFORMATION_SERVICE, BLE_UUID_TYPE_BLE}
};

I think the flag causes this problem. Also the length of the packet is longer (1 byte more).

What changes might be needed to work properly?

Changing the flag did not resolved the problem.

I also tested with the PCA10001(V 2.0) board.

Board's Chip

It didn't work either, unfortunately.

-Regards, Mango922

  • Hi Mango,

    It's a known issue that we are going to fix. The beacon advertisement is not recognized by Android or iOS device. It's only visible with Master Control panel on PC and the nRF Sniffer.

    We will try to fix this. In the mean time what you can do is to simply use sd_ble_gap_adv_start() to start advertising when you are in a connection. From S110 v7.0 this feature to broadcast when in a connection is supported. Note that only non-connectable advertising is accepted (but that what you need with beacon application)

  • Oh, didn't knew it had an issue. Does this issue applies to the SDK 8.0 and S110 8.0 version too?

    About sd_ble_gap_adv_start,

    do you mean replace the app_beacon_start to sd_ble_gap_adv_start?

    Or just advertise the Heart Rate Services and don't advertise the beacon?

    Also I'm sorry to ask you this, but when will this issue be solved?

    I apologize if I gave you pressure.

  • @Mango922: To broadcast when connected you can try with any example, the normal hrs project for example. When connected event occurs, you can call sd_ble_gap_adv_start() to start the non-connectable advertising.

    I actually found another issue with the example on SDK 8.0. Unfortunatelly most of our staff are on vacation during Easter period. So I can't guarantee when will it be fixed. I would suggest you to try the approach that I mentioned above.

  • @Hung Bui : I see. I tried to call sd_ble_gap_adv_start. I used the HID keyboard example.

    At on_ble_evt function of case BLE_GAP_EVT_CONNECTED, I call advertising_start().

    However, it didn't work. Am I doing it properly?

  • Hi mango,

    Be sure to set the advertising interval to >=100ms to advertise with non-connectable flag. I made an example that you can refer here.

Related