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

missing ADV events while scanning

I am using nrf52DK board as an observer to test my beacons. I have kept scanning enabled all the time (scanning interval & scanning window same), but the scan_evt_handler() is missing beacons many times, it is not able to capture all the beacons. I am setting filter while scanning to receive beacons only from the intended device.

#define SCAN_INTERVAL 0x00A0 /**< Determines scan interval in units of 0.625 millisecond. */
#define SCAN_WINDOW 0x00A0 /**< Determines scan window in units of 0.625 millisecond. */
#define SCAN_DURATION 0x0000 /**< Timout when scanning. 0x0000 disables timeout. */

nrf_ble_scan_filters_enable(&m_scan, SCAN_ADDR_FILTER, false);

What can I do to make sure that my nrf52DK board is receiving all the beacons sent by the peripheral. Both peripheral and scanner are kept near by. will connecting an antenna to nrf52 DK board (as given below)  help it to receive all the ADV events.

Parents Reply Children
  • they are kept close by, less than 30 cm. But sometimes the interval changes to one beacon/2 minute. I am advertising on all 3 channels. Is there a chance that, the scanner misses the beacon when it switches the channel (37->38->39) while scanning ?

  • The BLE spec requires a jitter in the advertising interval. I.e. there is a random extra time delay of 10ms added to each advertising interval. This is to avoid situations where a peripheral and a central device with the exact same advertising- and scan interval never hear each other. Hence, with a scan window equal to the advertising interval you might actually still miss the advertising packet.

    If you have a scan window that is exactly as long as the advertising interval then it comes down to the scan interval. With short intervals you will find your device fast, and with long intervals it might take some time. However, I guess that statistically you will need to have your radio on for an equal amount of time. 

Related