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

How can I decide scan window, interval for continuous scanning for Central

Hi.

I'm currently trying to scan non-connectable advertisement for continuously.

it’s unclear to me. I doubt will be worked scanning 1000 peripherals.

so. i have to get best value of scan window and scan interval for my project that is scan non-connectable advertisement  continuous packets from peripherals.

what is best value of scan windows and scan interval for performance and minimum packet losing.

how can i right approach?

Project Service Environment

1. Number of Peripherals  : 1000 advertiser

2. Peripherals(advertiser) adverting interval  7 seconds.(7000ms)

- Adverting interval change to 10 seconds if i need.

3. I  consider to use nRF52840 for scanner (Central)

4. I don't have to worry about power consumption of scanner(central)

Question

1. I'd be highly appreciated if someone could explain the details to get "scan window" value and  "scan interval" of scanner ?(Central)

2. what is best value of "scan window" for My project service Environment ?

2. what is best value of "scan Interval" for My project service Environment ?

Parents
  • Hello,

    If the only thing that your device is doing is scanning, then the answer to both of your question "2" is that they should be the same. In other words, set the scan window = scan interval to ensure that you are scanning 100% of the time.

     

    Just some info regarding scanning and advertising:

    I really suggest that you read this blog post if you haven't already, since it is quite relevant for your application.

     

    The scanner will scan on one of the advertising channels (37, 38 or 39) for the entire scan interval, and it will change to the next channel in between scan intervals. The advertising devices will advertise on all 3 advertising channels each advertising interval.

    An advertisement (on all channels take between 0.5ms and 1ms, depending on your advertising packet size. (see the online power profiler tool and enter the payload size to see the timing charts.)

     

    If two devices are advertising at the same time, you will risk that the scanning device only will see jibberish, and ignore both of the advertising packets. So you can do some calculations on what advertising interval you should use on your peripherals.

    Please also note, as it says in the blog post I linked above, that there is a random delay between 0ms and 10ms added in addition to the advertising interval. This is to prevent that two devices always advertise on the same point in time. 

    If you have 1000 devices, and 10 seconds advertising interval, it means that you will have on average 1 advertising every 10ms. This means that some packets probably will collide, but because of the random delay, you will eventually hear all devices. I don't know how important it is that you receive all the advertising packets from every device.

     

    Regarding the scanning device:

    As I said, it will scan on one channel for the entire scan window, and it will use some time to change the radio configuration in between the scan intervals. So you would want this interval to not be too short, since that will mean that you will have more time changing channels (and thus not listening). If a packet is not done sending when you change the channel, you will miss that advertising packet.

    But also, you shouldn't set the scan interval too long, as we have experienced some bugs with a scan window too long.

    I would suggest that you set the scan interval and scan window to approx 10 seconds. It doesn't really matter whether you set it to 5 or 10. This means that you will have the radio "offline" for some µs every 5 seconds instead of every 10 seconds. But 10 seconds shouldn't be a problem. 

     

    Please note that the scan window and interval are given in units of 0.625 ms. So 10 seconds is 16000 units = 0x3E80. 

     

    Best regards,

    Edvin

Reply
  • Hello,

    If the only thing that your device is doing is scanning, then the answer to both of your question "2" is that they should be the same. In other words, set the scan window = scan interval to ensure that you are scanning 100% of the time.

     

    Just some info regarding scanning and advertising:

    I really suggest that you read this blog post if you haven't already, since it is quite relevant for your application.

     

    The scanner will scan on one of the advertising channels (37, 38 or 39) for the entire scan interval, and it will change to the next channel in between scan intervals. The advertising devices will advertise on all 3 advertising channels each advertising interval.

    An advertisement (on all channels take between 0.5ms and 1ms, depending on your advertising packet size. (see the online power profiler tool and enter the payload size to see the timing charts.)

     

    If two devices are advertising at the same time, you will risk that the scanning device only will see jibberish, and ignore both of the advertising packets. So you can do some calculations on what advertising interval you should use on your peripherals.

    Please also note, as it says in the blog post I linked above, that there is a random delay between 0ms and 10ms added in addition to the advertising interval. This is to prevent that two devices always advertise on the same point in time. 

    If you have 1000 devices, and 10 seconds advertising interval, it means that you will have on average 1 advertising every 10ms. This means that some packets probably will collide, but because of the random delay, you will eventually hear all devices. I don't know how important it is that you receive all the advertising packets from every device.

     

    Regarding the scanning device:

    As I said, it will scan on one channel for the entire scan window, and it will use some time to change the radio configuration in between the scan intervals. So you would want this interval to not be too short, since that will mean that you will have more time changing channels (and thus not listening). If a packet is not done sending when you change the channel, you will miss that advertising packet.

    But also, you shouldn't set the scan interval too long, as we have experienced some bugs with a scan window too long.

    I would suggest that you set the scan interval and scan window to approx 10 seconds. It doesn't really matter whether you set it to 5 or 10. This means that you will have the radio "offline" for some µs every 5 seconds instead of every 10 seconds. But 10 seconds shouldn't be a problem. 

     

    Please note that the scan window and interval are given in units of 0.625 ms. So 10 seconds is 16000 units = 0x3E80. 

     

    Best regards,

    Edvin

Children
No Data
Related