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

nRF51 interval and scan window

Hi,

How can I know the value of the interval and scan window for an nRF51 dongle? Is there any way to change these values? What is the valid range for both parameters?

I'm using BLE beacons iBKS105 (based on the nrf51822 chipset from Nordic Semiconductor) and Wireshark 2.4.6

Thanks in advance!

Parents
  • Hello.

    What do you mean with "know the value of the interval and scan window"?

    Do you write an application for the dongle using the SoftDevice, or are you using the nRF Sniffer?

     

    If you use the softdevice in your application, e.g. in an example, you will see the scanning interval and -window in the top of the main.c file.
    Typically, you have the parameters SCAN_INTERVAL and SCAN_WINDOW. These are given in units of 0.625 milliseconds. These have to be between BLE_GAP_SCAN_INTERVAL_MIN and BLE_GAP_SCAN_INTERVAL_MAX, which is 0x0004 and 0xFFFF, respectively.

    This gives the softdevice limits of scanning interval of minimum 2.5ms and 40.959 375 seconds.

    Also, the scan window <= scan interval.


    Best regards,

    Edvin

  • Hello Edvin,

    Thank you very much for your quick response and help. I am a newbie in this subject and I regret not having explained myself correctly: I am just using the nRF51 sniffer and not writing any application.

    What I really wanted to ask is that, if I am using the dongle as a central device and sniffing the advertising packets sent by the peripheral device (dongle), what are exactly the values (in milliseconds) of the scan interval and scan window? (as explained here: (section A.I) https://devzone.nordicsemi.com/b/blog/posts/bluetooth-smart-and-the-nordics-softdevices-part-1) . I'm assuming (maybe wrongly) that these are values set in the dongle: Is there any way to change them and how?

    Thank you very much again!

    Best regards,

    G.

  • If you are using the nRF Sniffer firmware, found here (are you?), then it is not possible to change the interval. I am not certain exactly what the interval is, but if it is important, I can try to find it out. But it is sniffing 100% of the interval. Why are you asking? Are you missing any packs?

     

    Best regards,

    Edvin

  • Hello Edvin,

    Yes, I am using nRF Sniffer v2.

    My question arose after seeing the attached image (from the URL I mentioned in my previous message) and doing a couple of tests with 1 beacon iBKS105 +1 dongle nRF51 + Wireshark 2.4.6.

    The problem is not that I am missing packages but that I receive too many (as I explain here), and I thought that I was not taking into account some important theoretical concepts like Scanner scan interval and Scanner scan window. 

    Well, you said that with the nRF Sniffer it is not possible to change the scan interval and it is sniffing 100% of the interval, so I assume that in my tests the sampling time is the same as the scan interval, right?

    Thanks again for you help!

    G.

  • I didn't know that you had a separate case on this issue. Ok, so you see too many advertising packets. What is your advertising interval? It is called something like APP_ADV_INTERVAL, depending on what SDK you use. Remember that this value is given in 0.625ms, so if you want 1s advertising interval, you must set this to 1600.

    You should only see 3 advertising packets per second using the nRF Sniffer. I have tested this now on my computer, and with an advertising interval of 1600 (1000ms), I can only see 3 advertising packets per second (one for each channel).

    How do you switch between the two beacon modes? Can you try it with only one beacon mode, and an advertising interval of 1600 (1000ms)?

     

    Best regards,

    Edvin

  • Hello Edvin,

    My initial question was how can I find out the scan interval and the scan window because I am not using any SDK. I would like to set those parameters in a simple way, that is, without programming any application: is there any application that allows me to set those parameters directly to the dongle?

    With respect to receiving too many advertising packets, I solved the problem going back to nRF51 Sniffer v1.01 + Wireshark 1.10.14 + JLink v616a instead of using Sniffer v2 + Wireshark 2.4.6 + JLink v616c. Maybe the problem is due to the beta version of the Sniffer (v2).

    Thank you very much for your support!

    G.

    Edit1: Sorry, I forgot to tell you that I set the advertising interval of the beacon to 1000ms

Reply
  • Hello Edvin,

    My initial question was how can I find out the scan interval and the scan window because I am not using any SDK. I would like to set those parameters in a simple way, that is, without programming any application: is there any application that allows me to set those parameters directly to the dongle?

    With respect to receiving too many advertising packets, I solved the problem going back to nRF51 Sniffer v1.01 + Wireshark 1.10.14 + JLink v616a instead of using Sniffer v2 + Wireshark 2.4.6 + JLink v616c. Maybe the problem is due to the beta version of the Sniffer (v2).

    Thank you very much for your support!

    G.

    Edit1: Sorry, I forgot to tell you that I set the advertising interval of the beacon to 1000ms

Children
  • Hello,

    The sniffer firmware does not use the SoftDevice, so it works a little different than when you program it. It does not use a scan interval and window like in the link that you posted. When you have selected a specific device, it will follow that device between the channel hops. 

     

    But are you sure that you see more packets when you use the v2 of the sniffer than you see on v1? I have not managed to replicate this, but the only thing I can think of is that this is due to the fact that you have several beacons in the same application. Are both of the beacons on the same nRF? Would it be possible to share the application, so that I can reproduce the sniffer issue here?

     

    Best regards,

    Edvin

  • Hello Edvin,
    I think I understood your clarification: the Sniffer v1.01 simply scans all frames coming from the beacon and does not use a scan interval or a scan window, right?

    I am completely sure of receiving more packages with v2 than with v1: I have tried it on three computers (two laptops and a desktop) always with the same result. Although I have more beacons but I did the tests with just one (the rest of the beacons were off and there were no other Bluetooth devices on in the area). Attached you will find a .pcap file in which you will see something very strange: from frame 1 to frame 44 the time increment is completely different with respect to frame 45 onwards. Also you will see that from frame 45 onwards I receive the expected packets number, 1-3 packets per second, according to advertising interval set in the beacon (1000ms).

    7853.test.pcap

    If you need more information do not hesitate to ask me.

    Thank you very much!

    Cheers,

    G.

  • What I would like to know is what beacon firmware you are using? I have tested it on my computer, and I see only 3 packets every second when I select it from the dropdown menu (Device->"the beacon I want to sniff") using v.2.

     

    Would it be possible to send the beacon firmware? The reason I ask is because I understand from your other case that you are shifting between two beacon modes? This may cause some unexpected behavior regarding the advertisement, and it would be interresting to see whether it is the beacon transmitting more than 3 packets per second, or if it is the sniffer v2 that behaves weird. Either way, we would have to reproduce it in order to find a fix.

     

    If you do not want to share the project here, you can send me (or the support engineer from your other case)  a PM.

     

    Best regards,

    Edvin

  • Hello Edvin,

    I am using Accent Systems beacons, model iBKS105, firmware version EDSTEID V5.2016.12.13.1, Hardware version: v2.0. These are the same factory parameters that I have not changed and that I have also used with the two versions of the Sniffer + Wireshark.

    Thank you very much for your support!

    Best regards,

    Gabriel

    Edit1: I guess you already know, but just in case I have to tell you that the iBKS105 beacons are based on the Nordic Semiconductor nRF51822 chipset.

  • Hello,
    It seems you are working on the same issue on the other case, so I don't see the point in having this duplicate. Let me know if I misunderstood this.

     

    Best regards,

    Edvin

Related