0

When I tried to create iBeacon and then detect the beacon for some region range notifier does't notify the bacon for very small interval of time after again it starts appearing but there is drop for second and beacon gets disappear and again is start to appear.

I expect when an beacon is emitting then Range notifier should always return the beacon but sometimes it goes to 0 count and then again it returns the beacon.

**val beacon = Beacon.Builder()
.setId1("f7826da6-4fa2-4e98-8024-bc5b71e0893e")
.setId2("1")
.setId3("2")
.setManufacturer(0x004c)
.setTxPower("-59")
.build()**

**beaconTransmitter = BeaconTransmitter (this, BeaconParser()
.setBeaconLayout ("m:2-3=0215,i:4-19,i:20-21,i:22-23,p:24-24");
beaconTransmitter?.startAdvertising(beacon)
mBeaconManager = BeaconManager.getInstanceForApplication(applicationContext)
mBeaconManager?.beaconParsers?.add(BeaconParser().setBeaconLayout("m:2-3=0215,i:4-19,i:20-21,i:22-23,p:24-24"))**

**private val mRangeNotifier = RangeNotifier { beacons, region ->
   //Here I receive zero beacon some time, mostly it works but form very small interval of time beacon count is zero
}**

There should be proper detection of beacon so no inconsistency occurs, at least I could always track the beacons.

I have tested it on -
One plus 5 with Android version 9
One plus 6 Plus with Android version 9
Poco F1 with Android version 8

Library version - 2.16.4

1 Answers1

1

There are lots of variables here where there could be a problem:

  1. The code shown (or supporting code not shown in the question.)
  2. Hardware issues with the transmitting phone.
  3. Hardware issues with the receiving phone.

Because you are working with three different phones, the combinations of possible sources of trouble grow with the combinations of phones.

In order to track this down, you must simplify your test cases:

  1. Use a reference beacon transmitter for your tests that is most reliable. Choose a hardware beacon (best) or laptop-based beacon transmitter program (better) if you have one available. If you have no other choice, pick one of the phones to be the transmitter, and choose the one you suspect is most reliable.
  2. Use an off-the-shelf beacon detector program based on this same library such as Beacon Scope, and test detections of the beacon. Using an off the shelf program will eliminate any coding errors in your detection software.
  3. Test the off the shelf detection on each of your phones. This will tell you which, if any, have hardware trouble if they fail to detect reliably.
  4. Once you have a reliable transmitter and know which phones are reliable detectors, go back to your program and work to make it as reliable as what you see with Beacon Scope using the most reliable transmitter.
davidgyoung
  • 63,876
  • 14
  • 121
  • 204
  • I have tried creating iBeacon from iOS device and retrieve the beacon on Android device and it works perfectly awesome without any issues - - iOS Device transmitting and Android Device receiving -> Works perfect - Android device transmitting & Receiving devices iOS & Android -> both suffers signal drops. – TheWolverine Apr 22 '20 at 13:16
  • I suggest you use my [BeaconScope app](https://play.google.com/store/apps/details?id=com.davidgyoungtech.beaconscanner&hl=en_US) to analyze that flaky Android transmitter. (Don't worry it's free.) If you tap on the row of a specific beacon, it will give you a number of "Reception Statistics" including packets/sec, average rssi, and detection rate. (The detection rate tells you the % of one second scan cycles see at least one beacon packet.) If you can run this test and post those numbers for both the iOS Transmitter and the flaky Android transmitter, it will shed some light on the details. – davidgyoung Apr 22 '20 at 19:53