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

How i can implement advertise and scanning at the same time or concurrent?

hello ,

i want to perform advertise and scanning at the same time or concurrent. so, for this task i set advertise interval 90ms and scanning interval 105ms and windows size 100ms. for this value i am losing too many packets. i am using  two beacon same (both beacon having same firmware) type nRF52832 custom board. i also use two timer, SAADC and GPIO interrupt.

My questions :-

1. Any peripheral (like timer , SAADC , GPIO interrupt ) are effected to scanning or advertising.

    - Timer1 - 100ms.

    - Timer2 - 1000ms.

    - SAADC read every 5 sec. 

2.  so, how i choose value of advertise interval and scanning interval for that i get more packets.

please help to solve this problem.

thank you.  

Parents
  • Hi 

    1. No, the use of peripherals should not affect BLE stack activity. The BLE stack has exclusive access to the highest interrupt priorities, and has dedicated peripherals that are not available to the application. 

    2. The simple way to get less conflicts is to increase the advertising interval, but that will obviously reduce the number of advertise packets sent. 

    An alternative is to try to make the scanning interval smaller, so that you don't lose as much scanning time whenever the advertiser gets priority over the scanner. 

    As an example, try to set the scanning interval and scanning window to 20ms, and you should get more overall scanning time compared to the settings you are currently using. 

    Best regards
    Torbjørn

  • Thank you for your valuable reply. As per your suggestion i was set scanning window and scanning interval 20ms. so, for 20 ms i getting 7 to 8 packet in 1sec but my requirement is at least 12 to 13 packets in 1 sec. i already tested with number of different different advertising interval not getting more packets and some times for 1 sec i am not getting any packets. please help solve out this problem.     

  • Hi 

    How many packets do you get if you disable advertising completely?

    Best regards
    Torbjørn

  • Hello ovrebekk,

    If in one beacon i disable the advertising run only scanning and in second beacon advertising and scanning both then i got 17 to 23 packets in 1sec. 

  • Hi

    Are you using active or passive scanning?

    If I understand you correctly, the two devices are only sending advertise packets to each other? 
    Or do you have other beacons also sending packets to the two devices?

    Best regards
    Torbjørn

  • Hello ovrebekk,

    Are you using active or passive scanning?

    i am using passive scanning.

    If I understand you correctly, the two devices are only sending advertise packets to each other?

    right now, we have only two device (In feature we plan for multiple devices) both device are advertising and scanning in concurrent.

    Or do you have other beacons also sending packets to the two devices?

    Not now,

    If in one beacon i disable the advertising run only scanning and in second beacon advertising and scanning both then i got 17 to 23 packets in 1sec.

    For above testing i simply disable advertising run only scanning at one side and other side advertising and scanning both with advertising interval = 90ms , scanning interval = 20ms and scanning window size = 20ms. 

    My requirements is in 1sec i want 13 to 14 packets with large adverting interval. i don't want to reduce too much advertising interval.

    i hope you understand sorry for bad explanation.

      

    Thank you,

    vivek machchhar 

Reply
  • Hello ovrebekk,

    Are you using active or passive scanning?

    i am using passive scanning.

    If I understand you correctly, the two devices are only sending advertise packets to each other?

    right now, we have only two device (In feature we plan for multiple devices) both device are advertising and scanning in concurrent.

    Or do you have other beacons also sending packets to the two devices?

    Not now,

    If in one beacon i disable the advertising run only scanning and in second beacon advertising and scanning both then i got 17 to 23 packets in 1sec.

    For above testing i simply disable advertising run only scanning at one side and other side advertising and scanning both with advertising interval = 90ms , scanning interval = 20ms and scanning window size = 20ms. 

    My requirements is in 1sec i want 13 to 14 packets with large adverting interval. i don't want to reduce too much advertising interval.

    i hope you understand sorry for bad explanation.

      

    Thank you,

    vivek machchhar 

Children
Related