This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Problem with slow advertising nRF51 SDK9

I use SDK 9 and nrF51 in the advertising mode. I want to advertise each 1s packets. First, I call function

set_adv_params(&m_adv_params);

where I

static void set_adv_params(ble_gap_adv_params_t * adv_params)

{ memset(adv_params, 0, sizeof(ble_gap_adv_params_t));

adv_params->type        	= BLE_GAP_ADV_TYPE_ADV_IND;
adv_params->p_peer_addr 	= NULL;
adv_params->fp          	= BLE_GAP_ADV_FP_ANY;
adv_params->interval	    = 1600;
adv_params->timeout     	= 180;

}

Than

sd_ble_gap_adv_start(&m_adv_params);

It is work. But I see very strange behavior. When I insert battery in my deevice, after few time I see that adv packet send and central received it. Repeat, first start and advertise is fast. When I out of range from ble device, central loss adv packet and disconnect it. After that I again close peripherial to central and central again received adv packets but with some delay (5-8 seconds). I mean same program started on the peripherial without reset. What reason of this strange behavior?

Parents
  • Hello Mikhail

    I suspect the reason you see such varying delays before your central detects your peripheral is due an unlucky choice of advertising interval and scan interval/window.

    Your peripheral only advertises once every second, during which time it advertises sequentially on all three advertisement channels. The duration of this broadcast is very short.

    Your central is configured with a scan window and interval, and will look for the peripheral once per scan interval, for the time specified by the scan window, and in only one channel at a time. With a long advertisement interval as you have the central and peripheral intervals might "miss" one another, so that the peripheral isn't advertising when the central is looking for it.

    Please see section A in this blog post for more details on how central and peripheral behaves during advertisement devzone.nordicsemi.com/.../

    You could try to change your peripherals advertisement interval, or the central's scan interval and window, to see if you get a more predictable result.

    Best regards

    Jørn Frøysa

  • Thanks for answer. I readed that in some SDK were problems with it. I mean that no recommend use same settings. For example, if window = scan = 160 it is no good. Or I can use same settings in SDK 9?

Reply Children
No Data
Related