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

Scanning of Advertisements - channel and scan settings

With iOS and Android smartphones we are advertising some ble frames.

With our own code on the nrf 52840 we get around 2-4 advertisements each seconds on the nrf 52840 chip.
As SCAN_INTERVAL and SCAN_WINDOW we use 0x00A0 in order to switch the channels every 100ms and scans all the time.  When we play around by decreasing it to much, we get much les, but increasing it we doesnt get more.

When using the nrf Sniffer tool with the same chip we do get around 10 advertisements each seconds from the devices. That looks really great and we like to get the same result in our code.

As the source code is not public, could you please help us with the correct settings for scanning to get as much advertisements as possible as you have done it in the sniffer app?
I read in the sniffer documentation that it switches the channel after every retrieved packet. Does this do the trick and how can we do this?

Thank you so much!

Parents
  • Hello,

    So you get about 3 advertisements in your application, and about 9 in the nRF Sniffer. Are these 9 on all the channels? That is, is it 3 advertisements, but on all 3 channels (3*3)?

    When you scan using the softdevice, it will only change advertising channel on each scan interval. It is not possible to change this. This is because there is no point in scanning the same advertisement on all channels. 

    The reason you see fewer advertisements when you decrease the scan interval is that it takes time to scan an advertising packet. You can see how long an advertising packet takes here:

    https://devzone.nordicsemi.com/nordic/power

    With 31 bytes, it takes about 0.37ms. If you set a very low scan interval then the chances of picking up half a packet increases. Perhaps that is what you are seeing.

    If you for some reason need to scan all advertisements (on all channels) you can't use the softdevice. You must use the radio directly. Whenever you pick up an advertisement on channel 37, you must start scanning on channel 38, and then 39. We don't have anything that does this except for the sniffer itself, but that is not open source, unfortunately.

Reply
  • Hello,

    So you get about 3 advertisements in your application, and about 9 in the nRF Sniffer. Are these 9 on all the channels? That is, is it 3 advertisements, but on all 3 channels (3*3)?

    When you scan using the softdevice, it will only change advertising channel on each scan interval. It is not possible to change this. This is because there is no point in scanning the same advertisement on all channels. 

    The reason you see fewer advertisements when you decrease the scan interval is that it takes time to scan an advertising packet. You can see how long an advertising packet takes here:

    https://devzone.nordicsemi.com/nordic/power

    With 31 bytes, it takes about 0.37ms. If you set a very low scan interval then the chances of picking up half a packet increases. Perhaps that is what you are seeing.

    If you for some reason need to scan all advertisements (on all channels) you can't use the softdevice. You must use the radio directly. Whenever you pick up an advertisement on channel 37, you must start scanning on channel 38, and then 39. We don't have anything that does this except for the sniffer itself, but that is not open source, unfortunately.

Children
No Data
Related