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

Multi-Tag scan, how can we ensure that 40 tag advertising are scanned within 1 second?

Hi,all

Multi-Tag scan, how can we ensure that 40 tag advertising are scanned within 1 second, and the tag are advertising at 300 millisecond intervals.

My current scan settings:

static ble_gap_scan_params_t const m_scan_param = {
    .active   = 0x01,  
    .interval = 155,   // NRF_BLE_SCAN_SCAN_INTERVAL, 
    .window   = 155,   // NRF_BLE_SCAN_SCAN_WINDOW, 
    .filter_policy = BLE_GAP_SCAN_FP_ACCEPT_ALL
    .timeout   = 0,               
    .scan_phys = BLE_GAP_PHY_1MBPS,  // 1 Mbps PHY
};
product: nRF52832
softdevice version: 17.2

Current performance:

It takes at least 3.5 seconds to scan all 40 tag, and even scanning 10 tag in 1 second is not guaranteed.

What do I need to do to achieve the performance I want?

Thanks!

Parents
  • Hi,

    There is no way to guarantee that you can receive x advertisement packets during y time, even if you scan 100% of the time. There are too many unknowns for that to be possible. Some of the major reasons are: Advertisement packets may collide, noise/interference of some other kind (like WiFi), changing scan frequency in the middle of reception, etc. Calculating the probability of receiving a specific amount of packets in a specific time under specific circumstances quickly become quite complex statistical calculations.

    There are a few things you can go to ensure that you detect as many packets as possible in as short time as possible:

    • Scan with a 100% duty cycle, and do not change scan frequency too often (i.e. use long scan windows).
    • Use short advertising packets (reduce the risk of collisions and packet loss)
    • Use a sensible advertising interval
  • HI,

    Thank you for your reply and suggestions.

    Do you have any good suggestions for the association setting between the advertising interval and the scanning interval?

    and.

    Do you think it takes 3 seconds to scan 30 tags to ensure that it is normal? Your opinion will be my motivation to continue to optimize.

    I have seen someone try to scan 100 or even 500 advertisers on the DevZone, so I think what I am doing is not good enough.

    links: How to deal with broadcasting collision?,    Scanning about 100 beacons at same time

Reply Children
  • Hi,

    taylor don said:
    Do you have any good suggestions for the association setting between the advertising interval and the scanning interval?

    You should scan 100% of the time, using long scan windows (assuming all three advertising channels are equally good). That way the scanner will be able to detect the most advertisement packets that are not lost on air due to collisions, noise or interference. The advertising interval is a bit tricky. Generally, the shorter the interval the faster it will be detected. If you have a high number of packets that will stop to be the case at some point as the likelihood of collisions increase. You can try to do some statistical calculations on that, but if not, then you can experiment. I suggest trying some other (and lower) advertising intervals to see if you get better performance with that. And again, make sure the advertisement packets are as short as possible to reduce likelihood of collisions.

    taylor don said:
    Do you think it takes 3 seconds to scan 30 tags to ensure that it is normal? Your opinion will be my motivation to continue to optimize.

    It does not seem to bad to me. But again, there are so many factors that affect this that it is difficult to say much with confidence without a proper statistical analysis. You typically get these numbers by experimentation.

    taylor don said:
    I have seen someone try to scan 100 or even 500 advertisers on the DevZone, so I think what I am doing is not good enough.

    I do not see why you come to that conclusion. You can detect a very high number of advertisers. But it will take a bit of time, there is no way around that.

Related