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

Advertising/Scanning Problems

Issue is similar to devzone.nordicsemi.com/.../

I'm developing an application based on latest SoftDevice 130_1.0.0 and using two or more DevKits. My application starts advertising and scanning simultaneously with parameters:

	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    = BLE_GAP_ADV_INTERVAL_MIN;
	adv_params.timeout     = BLE_GAP_ADV_TIMEOUT_GENERAL_UNLIMITED;

	if(adv_mode == LIGO_ADVERT_MODE_CONNECTED)
	{		
		adv_params.type		= BLE_GAP_ADV_TYPE_ADV_NONCONN_IND;
		adv_params.interval	= BLE_GAP_ADV_NONCON_INTERVAL_MIN;
	}

	scan_param.active = 0;
    scan_param.selective = 0;
    scan_param.p_whitelist = NULL;
    scan_param.timeout = 0;
    scan_param.interval = 0x03C0;		// 600 ms
    scan_param.window = 0x0140;		// 200 ms

Each board using LED indicates receiving advertise reports.

So, I've noticed next:

  1. When I reset(or power on) two board at the same time - both boards don't indicate anything, it means there are no incoming advertising packets. Seems, nRF during scan doesn't advertise.

  2. When I reset(or power on) two board at different time - they both work fine but after some time (adout 15-30 min) I see that advertising's appear much rarely up to total stopping receiving adv packets for few minutes and then I see advertise packets again.

  3. When I set next scan interval = window, like:

    scan_param.interval = 0x03C0; // 600 ms scan_param.window = 0x03C0; // 600 ms I don't see any advertising using nRF MasterControlPanel for PC and/or for smartphone. Also both boards don't indicate anything.

  4. When I start a app_timer() in advertising report handler I notice that scanning activity becomes worst - I can see indications very rare.

So, could you explain this behavior?

Parents
    1. Edit 17.06.2015, my previous clarification of the behavior was incorrect. Sorry. Please see below.

    Could you clarify behavior at the next timings: - adv interval: 100mS - scan window: 200mS - scan interval: 600mS

    Let assume that scan starts first, then: 0-200ms scanning

    ~200 adv

    ~300 adv

    ~400 adv

    ~500 adv

    ~600 adv

    800-100 scanning

    and so on...

    So, is in correct?

    advertising interval = advInt = 100ms random delay = ranDel = 0-10ms

    You start with a scan of 200ms, after the scan window ends the scanner will try to schedule a timeslot for the next scan window, 400ms later.

    The ~0ms advertising event is blocked, since a scan is ongoing. The advertiser will try to schedule a timeslot one advInt+ranDel later. It will be blocked again, then the advertiser will try to schedule a timeslot advInt+ranDel later, and it will succeed. When the advertising event ends the advertiser will try to schedule a timeslot for the next advertising event, advInt+ranDel after the start of the previous one. It will succeed. And so on.

    There is a scan window scheduled to start at 600ms. So when the advertiser tries to schedule a timeslot inside it, it will be blocked. The advertiser will try to schedule a timeslot one advInt+ranDel later. If it is blocked it will try to schedule a timeslot one advInt+ranDel later. And so on.

    1. I have just tried an advertising interval of 20 ms, scan window=scan interval=100ms, and scan before advertise with both s130_nrf51_1.0.0-3.alpha_softdevice.hex and s130_nrf51_1.0.0_softdevice.hex. They are both advertising and their behavior seem identical in the sniffer log.
Reply
    1. Edit 17.06.2015, my previous clarification of the behavior was incorrect. Sorry. Please see below.

    Could you clarify behavior at the next timings: - adv interval: 100mS - scan window: 200mS - scan interval: 600mS

    Let assume that scan starts first, then: 0-200ms scanning

    ~200 adv

    ~300 adv

    ~400 adv

    ~500 adv

    ~600 adv

    800-100 scanning

    and so on...

    So, is in correct?

    advertising interval = advInt = 100ms random delay = ranDel = 0-10ms

    You start with a scan of 200ms, after the scan window ends the scanner will try to schedule a timeslot for the next scan window, 400ms later.

    The ~0ms advertising event is blocked, since a scan is ongoing. The advertiser will try to schedule a timeslot one advInt+ranDel later. It will be blocked again, then the advertiser will try to schedule a timeslot advInt+ranDel later, and it will succeed. When the advertising event ends the advertiser will try to schedule a timeslot for the next advertising event, advInt+ranDel after the start of the previous one. It will succeed. And so on.

    There is a scan window scheduled to start at 600ms. So when the advertiser tries to schedule a timeslot inside it, it will be blocked. The advertiser will try to schedule a timeslot one advInt+ranDel later. If it is blocked it will try to schedule a timeslot one advInt+ranDel later. And so on.

    1. I have just tried an advertising interval of 20 ms, scan window=scan interval=100ms, and scan before advertise with both s130_nrf51_1.0.0-3.alpha_softdevice.hex and s130_nrf51_1.0.0_softdevice.hex. They are both advertising and their behavior seem identical in the sniffer log.
Children
Related