0

I have an iBeacon from XYFindit. Need to have it detected by a Samsung Galaxy S4 Mini running KitKat.

I run the Locate app from Radius network, and it seems to find the beacon just fine.

Here is a screenshot: LOCATE SS But when I run the AltBeacon Reference program, I get nothing on the screen at all. I click "Start Ranging" button and it brings up a blank screen, and nothing ever appears.

Looking in the Log, I see this:

D/BluetoothAdapter﹕ startLeScan(): null
D/BluetoothAdapter﹕ onClientRegistered() - status=0 clientIf=5
D/BluetoothAdapter﹕ onScanResult() - Device=00:EA:20:00:12:80 RSSI=-87
D/BluetoothAdapter﹕ stopLeScan()
D/BluetoothAdapter﹕ startLeScan(): null
D/BluetoothAdapter﹕ onClientRegistered() - status=0 clientIf=5
D/BluetoothAdapter﹕ stopLeScan()
D/BluetoothAdapter﹕ startLeScan(): null
D/BluetoothAdapter﹕ onClientRegistered() - status=0 clientIf=5
D/BluetoothAdapter﹕ onScanResult() - Device=00:EA:20:00:12:80 RSSI=-90
D/BluetoothAdapter﹕ stopLeScan()

So, it seems that it is finding the MAC address of the device, but nothing else? I looked at some of the answers that @davidgyoung has given but the things tried there don't seem to be working for me.

What is Radius Network's Locate App doing that the Reference App is not?

MarkJoel60
  • 537
  • 2
  • 6
  • 24

2 Answers2

0

Understand that by default, the Android Beacon Library and its reference app only detect AltBeacons by default. If you want to detect proprietary beacons like the one shown in the screenshot, you have to add a special beacon parser expression. It's a simple one line code addition.

This is unfortunately necessary because the beacon layouts are proprietary, and cannot be published in the open source project.

To find the proper line of code to add, try doing a Google search for "getBeaconParsers"

davidgyoung
  • 63,876
  • 14
  • 121
  • 204
  • 2 questions: 1) How does the Locate Beacon by Radius Networks pull a range on this beacon? Isn't it using the same AltBeacon library? 2) I see getBeaconParsers, but how do you know what layout to use? – MarkJoel60 Jul 07 '15 at 20:37
  • You use the layout for your beacon type. If you are looking to match an iBeacon, you find a layout that matches that. All apps including Locate must use these layouts when using the library. – davidgyoung Jul 07 '15 at 21:34
0

In case anyone else comes here trying to figure this out, of course @davidgyoung is right about the parser. But if you are looking for the layout that works with XYFindit beacons, I found this on SO:

Is This The Correct Layout?

And it worked for me.

The modified class (if you want to use the reference example) is actually

BeaconReferenceApplication

And it looks like this after the modification:

public void onCreate()
{
    super.onCreate();
    BeaconManager beaconManager = org.altbeacon.beacon.BeaconManager.getInstanceForApplication(this);
    beaconManager.getBeaconParsers().add(new BeaconParser().
            setBeaconLayout("m:0-3=4c000215,i:4-19,i:20-21,i:22-23,p:24-24"));

    Log.d(TAG, "setting up background monitoring for beacons and power saving");
    // wake up the app when a beacon is seen
    Region region = new Region("backgroundRegion",
            null, null, null);
    regionBootstrap = new RegionBootstrap(this, region);

    // simply constructing this class and holding a reference to it in your custom Application
    // class will automatically cause the BeaconLibrary to save battery whenever the application
    // is not visible.  This reduces bluetooth power usage by about 60%
    backgroundPowerSaver = new BackgroundPowerSaver(this);

    // If you wish to test beacon detection in the Android Emulator, you can use code like this:
    // BeaconManager.setBeaconSimulator(new TimedBeaconSimulator() );
    // ((TimedBeaconSimulator) BeaconManager.getBeaconSimulator()).createTimedSimulatedBeacons();
}
Community
  • 1
  • 1
MarkJoel60
  • 537
  • 2
  • 6
  • 24