Estimote Hardware D

Hi there :slight_smile:
I just finished off my dissertation project & in my code i implemented estimote beacons support using android studio.
I have been provided with a beacon, it is built with hardware D. My code uses beacon-managers, i just found out that it does not support hardware D.
is it possible to monitor ranges such as, “immediate”, “close”, “far”, using hardware D ?

When i access the beacon from the estimote app, the available category options are “cloud data”, “transmitted packets”, “device details” and “inbuilt senors”. There is no “Broadcasting Settings” category. Is this because the beacon is hardware D ?
The beacon is registered under the institute who provided it to me. Do these “Broadcasting Settings” have to be enabled from the account?

any feedback will be greatly appreciated :slight_smile:
123

The first-generation “D” beacons don’t work with our new Estimote Proximity SDK, but you can use our older “Estimote SDK”, here’s an integration tutorial:

https://developer.estimote.com/android/tutorial/part-1-setting-up/

We don’t generally recommend doing that anymore, but since it seems you’re stuck with the older hardware, there aren’t many other options. (Unless you can convince the institute to get you the latest generation! :wink:)

Alternatively, since these beacons broadcast standard iBeacon/Eddystone packets, you can use any other SDK that supports iBeacon or Eddystone.

I actually followed up on that link after i posted. The weird thing is that it is not detecting the beacon when entering a zone. I keep on getting

D/BluetoothAdapter: isLeEnabled(): ON
D/BluetoothLeScanner: onScannerRegistered() - status=0 scannerId=31 mScannerId=0
D/BluetoothAdapter: isLeEnabled(): ON
D/BluetoothLeScanner: onScannerRegistered() - status=0 scannerId=32 mScannerId=0
D/BluetoothAdapter: isLeEnabled(): ON
D/BluetoothLeScanner: onScannerRegistered() - status=133 scannerId=0 mScannerId=0
D/BluetoothAdapter: isLeEnabled(): ON
D/BluetoothLeScanner: onScannerRegistered() - status=133 scannerId=0 mScannerId=0

the status seems to change when i move it from one zone to another. however the ProximityZone method

.withOnEnterAction(new Function1<ProximityAttachment, Unit>()

does not run any commands.

I’m running on android 8.1

This is precisely the Proximity SDK that doesn’t work with the first-generation beacons :smiley:

You need to use this one:
https://github.com/estimote/android-sdk

(Best to follow the tutorial I’ve linked to above.)

So I followed the instructions of the first link you sent. Applied everything except for the “Tying beacon data and app data together”. As for now, I just want to detect them.

So now I’m getting these messages

I/EstimoteSDK: BeaconManager.startMonitoring:891 Not starting monitoring, not connected to service
BeaconManager.startRanging:637 Not starting ranging, not connected to service
I/EstimoteSDK: BeaconService.onCreate:79 Creating beacon service for android version 27
D/BluetoothAdapter: isLeEnabled(): ON
D/BluetoothLeScanner: onScannerRegistered() - status=0 scannerId=15 mScannerId=0

You are starting monitoring before service is initialised. Here is an example from tutorial:

beaconManager = new BeaconManager(getApplicationContext());
// add this below:
beaconManager.connect(new BeaconManager.ServiceReadyCallback() {
    @Override
    public void onServiceReady() {
        beaconManager.startMonitoring(new BeaconRegion(
                "monitored region",
                UUID.fromString("B9407F30-F5F8-466E-AFF9-25556B57FE6D"),
                22504, 48827));
    }
});

You need to call startMonitoring or 'startRanging__after__ you getonServiceReady` callback.
Logs are showing that you first try starting monitoring:

I/EstimoteSDK: BeaconManager.startMonitoring:891 Not starting monitoring, not connected to service
BeaconManager.startRanging:637 Not starting ranging, not connected to service

and then you get information that beacon service has started:

 I/EstimoteSDK: BeaconService.onCreate:79 Creating beacon service for android version 27

Perfect, now these errors are fixed and not showing up :

Not starting monitoring, not connected to service 
Not starting ranging, not connected to service

Now i’m only getting this,

I/EstimoteSDK: BeaconService.onCreate:79 Creating beacon service for android version 27
D/BluetoothAdapter: isLeEnabled(): ON
D/BluetoothLeScanner: onScannerRegistered() - status=0 scannerId=15 mScannerId=0

still not detecting it for some reason for now

Thank you so much for all your help :smile: :sunny:

Does rangingListener returns empty list or it is not called at all?
Have you properly set ranging region? Can you try with region that matches all beacons:

   beaconManager.startRanging(new BeaconRegion("test", null, null, null));
    beaconManager.setRangingListener(new BeaconManager.BeaconRangingListener() {
      @Override
      public void onBeaconsDiscovered(BeaconRegion beaconRegion, List<Beacon> beacons) {
        Log.i("TEST", "Here are beacons: " + beacons);
      }
    });

Check if your Estimote SDK is in version 1.4.1. Also it would be good to know your Android version and phone model.

First of all, the sdk version was much lower than the current one.
Just so you have an idea of my code

beaconManager = new BeaconManager(this);
    
    beaconManager.connect(new BeaconManager.ServiceReadyCallback() {
        @Override
        public void onServiceReady() {
            beaconManager.startRanging(new BeaconRegion("immediate", UUID.fromString("B9407F30-F5F8-466E-AFF9-AAAAAAAA"), null, null));
            beaconManager.setRangingListener(new BeaconManager.BeaconRangingListener() {
                @Override
                public void onBeaconsDiscovered(BeaconRegion beaconRegion, List<Beacon> beacons) {
                    Log.i("TEST", "Here are beacons: " + beacons);
                }
            });

            beaconManager.startMonitoring(new BeaconRegion(
                    "immediate",
                    UUID.fromString("B9407F30-F5F8-466E-AFF9-AAAAAAAA"),
                    null, null));
        }
    });

now i also have another class, by following the instructions on the link.
so this code is from the “MainActivity”. The funny thing is, on the url there is nothing which calls either classes to one another
atm i’m running android 8.1 on a google pixel 2 xl
however, when i do my testing for data aggregation. it’s going to probability be Android 6.0 (API 23, marshmallow )

the output is still

I/EstimoteSDK: BeaconService.onCreate:79 Creating beacon service for android version 27
D/BluetoothAdapter: isLeEnabled(): ON
D/BluetoothLeScanner: onScannerRegistered() - status=0 scannerId=16 mScannerId=0

is there something i’m missing?

Logs suggest that phone is scanning. Can you try start ranging for all beacons:

 beaconManager.startRanging(new BeaconRegion("immediate", null, null, null));

On the screenshot I don’t see any beacon with UUID: “B9407F30-F5F8-466E-AFF9-AAAAAAAA”

I actually tried that before, to see if it will detect any of the beacons, the results were still the same.
about the UUID, i changed it for the code example i provided above, forgot about the screenshot tbh.
I have been rereading the tutorials, reading some documentation. There was something regarding time intervals, i don’t think it applies for this hardware (D3.4) version. am i correct? if i’m not then i’ll implement them and hopefully solve the issue :slight_smile:
I also just tired it on a moto g4 android 7.0 , the result was the same

I/EstimoteSDK: BeaconService.onCreate:79 Creating beacon service for android version 24
D/BluetoothAdapter: STATE_ON
D/BluetoothLeScanner: onClientRegistered() - status=0 clientIf=6 mClientIf=0

Thanks once again :slight_smile:

Hi again :slight_smile:
just wanted to let you know that i tried

setBackgroundScanPeriod 

&

setForegroundScanPeriod

even tho the default is 25seconds
the result is still the same

problem solved. it was really really stupid
I just put the code in

protected void onResume() 

instead of :

protected void onCreate() 

done :smiley:
now it’s time to play around! these are going to work so well with the speech,weather and calendar interaction i’m using :smiley: let the fun begin! :smiley:

thanks again to everyone who answered back, greatly appreciated.:star_struck:

1 Like

now there is something weird going on
it is discovering (onBeaconsDiscovered) 5 beacons, however the “onEnteredRegion” is only showing one beacon.

now when i move that one out of range and restart, the “onEnteredRegion” is detecting the same one.
the “onExitedRegion” didn’t even work once. i also tried cleaning and rebuilding the project and tried different methods to see if it will get detected.

i’m using android 8.1, google pixel 2

if anyone has any ideas, i would be very happy to hear them :slight_smile:

That is normal. Monitoring only returns beacons that triggered onEnter event. See JavaDoc

You may try to test it on older Android versions. This SDK might not work work well with Android 8 scanning restrictions (however Proximity SDK handles that well).

strange thing is that the onEnter event trigger is only works once. i am thinking that it has got something to do with android 8.0 .
i got to wait a couple of days before i can try it on an older android version.
what i realized is that it is always detecting the closest beacon to the phone, without any onEnter trigger

fingers crossed :smiley: i love these beacons and it would be so awesome if the version number is the only issue.
in the meantime i’ll keep on trying, maybe it’s something from my side. i’ll keep this thread updated, so maybe it might help someone else in the future :slight_smile:

hey everyone :slight_smile: so i got a couple of days to test it on a lower version of android. so i decided to come up with a backup. if you simply want to detect the closest beacon, you might want to try this

its something very simple

 beaconManager.startRanging(region);

            beaconManager.setRangingListener(new BeaconManager.BeaconRangingListener() {

                @Override
                public void onBeaconsDiscovered(BeaconRegion beaconRegion, List<Beacon> beacons) {
                    System.out.println("beacons detected");
                    for (int i = 0; i < beacons.size(); i++) {
                        for (int j = 0; j < beacons.size(); j++) {
                            if(beacons.get(i).getRssi() > beacons.get(j).getRssi()) {
                                System.out.println("the closest beacon is : "+beacons.get(i).getProximityUUID());
                            }

                        }
                    }
                }
            }); 

hope it helps :slight_smile:

Beacons are should be already sorted by RSSI, so you only need take first one:

 public void onBeaconsDiscovered(BeaconRegion beaconRegion, List<Beacon> beacons) {
          System.out.println("beacons detected");
          if(!beacons.isEmpty()) {
                System.out.println("the closest beacon is : "+beacons.get(0).getProximityUUID());
           }
   }