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

S132 Central Scanner Performance

I am using the S132 Central + Peripheral Relay example as a basis for my tests.  I have a peripheral advertising at an interval of 20ms.  I verified this timing using a BLE sniffer, so I know that part is working.  The NRF52832 is setup using a scan interval (and window) have been set to 10 (or 6.25ms).  I am unable to reliably receive the advertisements at 20ms.  I see them at 20ms, 60ms, sometimes even 150+ms.  Any idea how I can increase the performance?

  • As a follow-up to this, I setup this equipment in a RF chamber.  I set my phone up to advertise at 100ms interval.  With the Nordic set for scan interval and window value of 6.25ms, I was still missing advertisements.  Most came in at 100ms, but many came in at 200ms gaps as well.  Is there something in the example that can cause this?  I would have expected to see them at 100ms every time in this environment.

  • Hello ,

    I find it strange that when you advertise on 20ms intervals, and scan on 6.25, it would sometimes take up to 150+ms between the detected advertisements.

    As you may know, a device advertises on three different channels each advertising interval. An advertising event will typically look like this:

      (from the online power profiling calculator)

    Each of the three spikes is the actual advertisements on each of the three channels. The length of these may vary depending on the length of the advertising packet. This length is for 31 bytes of advertising payload.

    Now, a scanner will scan on one channel each scan interval/window, then it will change to the next advertising channel, and scan there for the next scan window. This means that even if you scan 100% of the time (scan interval = scan window), there will still be a short amount of time where it stops scanning and  changes channel before starting scanning. As you see, an advertisement on one channel takes roughly 1ms. This means that if the end of scan window occurs in the middle of the advertisement, you will not receive that advertisement (the event BLE_GAP_EVT_ADV_REPORT).

    Since you change channel every 6.25ms, this could occur quite often, about 1 in 6 times. Also note that there is a random time delay between each advertisement from 0-10ms (required by spec), so that if you are unlucky, you may get several of these in a row.

    One way of improving the number of BLE_GAP_EVT_ADV_REPORTs, is to increase your scan interval and scan window. If you set it to 100ms instead of 6.25, you will have a lot less switching channel-events, and you can still receive several BLE_GAP_EVT_ADV_REPORTs in one scan interval.

    Try this, and see if that helps.

Related