title: Bluetooth Low Engergy advertising/scanning rate and connection
body: <p>Our development team is working on a project where we need to connect 2 devices in around 1/1,5 seconds over BLE (no peering). The connection should only be established if the RSSI is between value x and y. </p>
  
  <p>The problem is that the RSSI is fluctuating a lot so using 1 value is not reliable. To make the signal more reliable we want to use multiple signals and take the average from all the signals we received in 1/1,5 seconds. We need at least 6 - 8 signals to get a bit reliable average.</p>
  
  <p>I read that BLE can advertise every 20ms in the fastest case. The scan rate can be around 11,25ms. This means getting 10 signals per second should be no problem. </p>
  
  <ul>
  <li>With my Galaxy S5 mini i receive 8-10 signals which is great for our purposes and calculating a average. </li>
  <li>I tested also with an LG G4C which receives 3-4 signals per second which is on the low side but would be ok if it are 4 signal all the time. </li>
  <li>At a brand new One+ 3 we receive around 10 signals per second for a few seconds and then we receive 10-15 seconds no signal.</li>
  </ul>
  
  <p>For our software we need a reliable way to get an RSSI value in the given time (1/1,5 seconds).I already read a lot over how iBeacons work, how BLE works and so on. Also our dev. team tried a lot (def. Android API for the BLE communication, a few other libraries, measure before connect, measure if connected and so on) but we where not able to find a reliable way. Does someone know how we can achieve our target to get a reliable RSSI value in less than 1,5 seconds? or are there people with the same problem?</p>
  
  <p>We made a video which shows the big difference between the devices. The video is downloadable: <a href="https://www.dropbox.com/s/49c5s5s617ozskp/VID-20170106-WA0000.mp4?dl=0" rel="nofollow noreferrer">https://www.dropbox.com/s/49c5s5s617ozskp/VID-20170106-WA0000.mp4?dl=0</a> </p>
  
  <hr>
  
  <p><strong>UPDATE:</strong>
  We noticed that we are able to collect at least 10 signals per second if we are connecting to the advertisement device first. So the hardware supports to get the amount of signals we need to calculate the average in max 1 second. The problem is that we should only connect if the calculated average is between x and y. </p>
  
  <p>We cant connect and calculate the average and disconnect if it not between x and y because there can be multiple devices (in a waiting line) who wants to connect to the advertisement device. The distance between advertisement device and connecting devices will increase at least 2 meter for each "new" device and only the first device should connect. If we connect first and disconnect if the average of the received RSSI signals is not between x and y, it is possible that the first device as a delay because of other devices.</p>
  
  <p>We also decided that we have 2 seconds instead of 1/1,5 seconds to connect. This is really the max time we have else our product is not usable anymore </p>
  
  <hr>
  
  <p>Thanks in advance.</p>