Altbeacon Bible Library detects a beacon only 30% of the time

I am using AltBeacon library for a range of beacons near my device. I am using all the library defaults, i.e. 1100ms scan period and 0ms between scan periods.

The library calls my listener every 1100ms, but the problem is that no beacon was found in many of these calls. The lighthouse is only detected by about 30% -40% of calls, the remaining 70% of calls say there are no beacons around.

What can I do to fix this problem?

Hello

+3


source to share


2 answers


After watching a very large 50 second snippet of LogCat posted privately, I saw that two beacons were detected at irregular intervals:

Beacon #1 7383942b-xxxx-xxxx-xxxx-xxxxxxxxxxxx id2: 5 id3: 5000
   Max time between detections:   5.75600001 s
   Mean time between detections:  2.03854544 s
   % range cycles with detection: 51%

Beacon #2 b9407f30-xxxx-xxxx-xxxx-xxxxxxxxxxxx id2: 60039 id3: 2279
   Max time between detections:   4.794999515 s
   Mean time between detections:  1.377583336 s
   % range cycles with detection: 82 %

      

The library code started and stopped the bluetooth scan every 1100ms as expected, and at least one of the two beacons was found in 89% of the ranking cycles. This indicates that the application, library, and operating system are working fine - there are no significant periods of time when beacons are not detected. With more RSSI each beacon offers a strong enough signal that is reasonably consistent over the log period. But the detection interval of beacons is highly irregular. It's unusual.

This speaks of some problems with the radio or hardware, be it beacons, telephone or radio edition. Several possibilities:

  • Beacons don't really broadcast regularly, and in fact they have dropouts. (This is unlikely if you are using two different models of beacon radios.)
  • The hardware of the bluetooth phone has a problem causing it to miss a lot of bluetooth ad packets (possibly due to CRC errors) so the operating system, library, and app never see them.
  • Testing is performed in an area with a lot of radio noise, which causes the CRC errors mentioned in Capability 2.


I think an Android device problem is the most likely possibility, although I admit this is the first such case I've seen. I would suggest that you try with a second Android device and see if you can reproduce the problem. Due to the possibility that this is a hardware issue, it would be helpful to document the model of the device you are using.

EDIT: The questioner posted additional information offline saying that he was using a Nexus 5 with the 2.0 beta version of the library and said the problem did not exist and only appeared when updating to this version of this library. I did some additional tests myself on Nexus 5 and 2.0-beta7 by modifying the android-beacon-library-reference app to add the following codes for each callback range:

public void didRangeBeaconsInRegion(Collection<Beacon> beacons, Region region) {
    if (beacons.size() > 0) {
        EditText editText = (EditText)RangingActivity.this
                .findViewById(R.id.rangingText);
        int rssi = -100;
        for (Beacon beacon: beacons) {
            logToDisplay("Beacon "+beacon.toString()+" is about "+beacon.getDistance()+" meters away, with Rssi: "+beacon.getRssi());
            if (beacon.getId1().toString().equals("2f234454-cf6d-4a0f-adf2-f4911ba9ffa6") && beacon.getId2().toString().equals("1") && beacon.getId3().toString().equals("1")) {
                rssi = beacon.getRssi();
            }
        }
        if (rssi > -100) {
            Log.d(TAG, "Beacon found in ranging cycle.  rssi: "+rssi);
        }
        else {
            Log.d(TAG, "Beacon not found in ranging cycle");
        }

    }
}

      

Then I turned on the RadBeacon USB adapter with 2f234454-cf6d-4a0f-adf2-f4911ba9ffa6 / 1/1 at 10Hz and then looked at the debug output with filter and results below. As you can see, there was no cycle in 60 seconds when I ran the test when any beacons were not detected.

$ adb logcat -v time | grep "ranging cycle"

10-07 15:17:00.076 D/RangingActivity(16630): Beacon found in ranging cycle.  rssi: -67
10-07 15:17:01.180 D/RangingActivity(16630): Beacon found in ranging cycle.  rssi: -73
10-07 15:17:02.287 D/RangingActivity(16630): Beacon found in ranging cycle.  rssi: -75
10-07 15:17:03.422 D/RangingActivity(16630): Beacon found in ranging cycle.  rssi: -66
10-07 15:17:04.545 D/RangingActivity(16630): Beacon found in ranging cycle.  rssi: -67
10-07 15:17:05.714 D/RangingActivity(16630): Beacon found in ranging cycle.  rssi: -66
10-07 15:17:06.815 D/RangingActivity(16630): Beacon found in ranging cycle.  rssi: -66
10-07 15:17:07.989 D/RangingActivity(16630): Beacon found in ranging cycle.  rssi: -65
10-07 15:17:09.087 D/RangingActivity(16630): Beacon found in ranging cycle.  rssi: -72
10-07 15:17:10.198 D/RangingActivity(16630): Beacon found in ranging cycle.  rssi: -65
10-07 15:17:11.322 D/RangingActivity(16630): Beacon found in ranging cycle.  rssi: -71
10-07 15:17:12.484 D/RangingActivity(16630): Beacon found in ranging cycle.  rssi: -67
10-07 15:17:13.587 D/RangingActivity(16630): Beacon found in ranging cycle.  rssi: -64
10-07 15:17:14.758 D/RangingActivity(16630): Beacon found in ranging cycle.  rssi: -66
10-07 15:17:15.867 D/RangingActivity(16630): Beacon found in ranging cycle.  rssi: -66
10-07 15:17:16.998 D/RangingActivity(16630): Beacon found in ranging cycle.  rssi: -66
10-07 15:17:18.195 D/RangingActivity(16630): Beacon found in ranging cycle.  rssi: -67
10-07 15:17:19.280 D/RangingActivity(16630): Beacon found in ranging cycle.  rssi: -67
10-07 15:17:20.415 D/RangingActivity(16630): Beacon found in ranging cycle.  rssi: -67
10-07 15:17:21.560 D/RangingActivity(16630): Beacon found in ranging cycle.  rssi: -66
10-07 15:17:22.659 D/RangingActivity(16630): Beacon found in ranging cycle.  rssi: -67
10-07 15:17:23.802 D/RangingActivity(16630): Beacon found in ranging cycle.  rssi: -66
10-07 15:17:25.035 D/RangingActivity(16630): Beacon found in ranging cycle.  rssi: -66
10-07 15:17:26.189 D/RangingActivity(16630): Beacon found in ranging cycle.  rssi: -67
10-07 15:17:27.331 D/RangingActivity(16630): Beacon found in ranging cycle.  rssi: -73
10-07 15:17:28.458 D/RangingActivity(16630): Beacon found in ranging cycle.  rssi: -67
10-07 15:17:29.618 D/RangingActivity(16630): Beacon found in ranging cycle.  rssi: -67
10-07 15:17:30.756 D/RangingActivity(16630): Beacon found in ranging cycle.  rssi: -84
10-07 15:17:31.886 D/RangingActivity(16630): Beacon found in ranging cycle.  rssi: -76
10-07 15:17:33.047 D/RangingActivity(16630): Beacon found in ranging cycle.  rssi: -76
10-07 15:17:34.193 D/RangingActivity(16630): Beacon found in ranging cycle.  rssi: -85
10-07 15:17:35.339 D/RangingActivity(16630): Beacon found in ranging cycle.  rssi: -83
10-07 15:17:36.502 D/RangingActivity(16630): Beacon found in ranging cycle.  rssi: -90
10-07 15:17:37.683 D/RangingActivity(16630): Beacon found in ranging cycle.  rssi: -78
10-07 15:17:38.871 D/RangingActivity(16630): Beacon found in ranging cycle.  rssi: -87
10-07 15:17:40.079 D/RangingActivity(16630): Beacon found in ranging cycle.  rssi: -90
10-07 15:17:41.234 D/RangingActivity(16630): Beacon found in ranging cycle.  rssi: -85
10-07 15:17:42.422 D/RangingActivity(16630): Beacon found in ranging cycle.  rssi: -87
10-07 15:17:43.588 D/RangingActivity(16630): Beacon found in ranging cycle.  rssi: -88
10-07 15:17:44.751 D/RangingActivity(16630): Beacon found in ranging cycle.  rssi: -88
10-07 15:17:45.924 D/RangingActivity(16630): Beacon found in ranging cycle.  rssi: -86
10-07 15:17:47.114 D/RangingActivity(16630): Beacon found in ranging cycle.  rssi: -83
10-07 15:17:48.264 D/RangingActivity(16630): Beacon found in ranging cycle.  rssi: -82
10-07 15:17:49.409 D/RangingActivity(16630): Beacon found in ranging cycle.  rssi: -82
10-07 15:17:50.612 D/RangingActivity(16630): Beacon found in ranging cycle.  rssi: -88
10-07 15:17:51.781 D/RangingActivity(16630): Beacon found in ranging cycle.  rssi: -79
10-07 15:17:52.913 D/RangingActivity(16630): Beacon found in ranging cycle.  rssi: -79
10-07 15:17:54.122 D/RangingActivity(16630): Beacon found in ranging cycle.  rssi: -82
10-07 15:17:55.296 D/RangingActivity(16630): Beacon found in ranging cycle.  rssi: -84
10-07 15:17:56.441 D/RangingActivity(16630): Beacon found in ranging cycle.  rssi: -89
10-07 15:17:57.631 D/RangingActivity(16630): Beacon found in ranging cycle.  rssi: -75
10-07 15:17:58.782 D/RangingActivity(16630): Beacon found in ranging cycle.  rssi: -63
10-07 15:17:59.924 D/RangingActivity(16630): Beacon found in ranging cycle.  rssi: -71
10-07 15:18:01.098 D/RangingActivity(16630): Beacon found in ranging cycle.  rssi: -72

      

+5


source


EDIT: After looking at the log excerpt, I presented a second answer.

Two possibilities come to mind:



  • Try repeating this test with WiFi disabled on your Android device. Some Android devices combine WiFi / Bluetooth components that interfere with each other when used at the same time.

  • Make sure this is not a hardware problem. Try using a known working scanner, such as an iOS device with the Locate app or Android Locate app installed (using your own beacon parsing expression) and see if you see the same behavior.

+1


source







All Articles