Reputation: 308
Here is my code
I have 3 beacons on cloud estimote account. All 3 beacons put on some distance with same floor but i can't get all beacon details when I enter in beacon range area. please help me what is wrong with my code.
private void beaconRegionConfig() {
BeaconRegion beaconRegion = new BeaconRegion("", null, null, null);
beaconManager.setBackgroundScanPeriod(5000, 30000);
beaconManager.setForegroundScanPeriod(10000, 5000);
beaconManager.connect(() -> {
beaconManager.startRanging(beaconRegion);
beaconManager.setConfigurableDevicesListener(configurableDevices -> {
Log.e(TAG, "configurableDevicesList = " + configurableDevices);
});
});
// Set up ranging for get all beacons
beaconManager.setRangingListener(new BeaconManager.BeaconRangingListener() {
@Override
public void onBeaconsDiscovered(BeaconRegion region, List<Beacon> beacons) {
// Handle discovered beacons here
//Log.e(TAG, "region: " + region);
Log.e(TAG, "region " + region + " , _beaconsSize: " + beacons.size() + " ," + beacons);
}
});
}
I Get o/p like this
_beaconsSize: 1 ,[Beacon{macAddress=[F0:1A:A0:11:D5:A8],
proximityUUID=5861636c-716e-2301-be01-6c731222f008, major=1,
minor=0, measuredPower=-53, rssi=-102}]
In menifest file
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<!-- for beacons-->
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION"/>
<uses-permission android:name="android.permission.BLUETOOTH"/>
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
<uses-permission android:name="android.permission.BLUETOOTH_SCAN"/>
In gradle
implementation 'com.estimote:sdk:1.0.12'
This 3 beacons in my estomote cloud account
ice
Identifier: a7....
Tags:IceTag
Packets:None
Location:385,..., India
lemon
Identifier:79.....
Tags:LemonTag
Packets:None
Location:385,..., India
caramel
Identifier:db....
Tags:Test
Packets:None
Location: 385, ...,India
Upvotes: 2
Views: 256
Reputation: 21
Estimote Team here,
it seems you have Estimote UWB Beacons, but the code you posted is related to BLE beacons.
Estimote had two generation of beacons:
BLE (Bluetooth) popular in 2013-2019. They were typically configured as iBeacon or Eddystone and allowed phones to detect them with 1-3m accuracy. They were typically green, blue or white.
UWB (Ultra Wideband) launched in 2019 that are configured with FiRa protocol and compatible with U1/U2 UWB chip from Apple and Core UWB JetPack library from Google Android. They provide 10cm accuracy. They were typically yellow, caramel, white like this:
Mobile SDK for these UWB beacons are here:
iOS SDK for UWB Beacons: https://github.com/Estimote/iOS-Estimote-UWB-SDK
Android SDK for UWB Beacons: https://github.com/Estimote/Android-Estimote-UWB-SDK
Please note UWB Beacons have also BLE radio, but it is mostly used to discover these beacons before connecting to them via UWB.
Typical cycle is:
So the proper way to discover these UWB beacons on Android would be:
uwbManager.startDeviceScanning(this)
Then you can print discovered UWB beacons like this:
uwbManager.uwbDevices.collect { scanResult: EstimoteUWBScanResult ->
when (scanResult) {
is EstimoteUWBScanResult.Devices -> {
scanResult.devices.forEach { device ->
println("Discovered device: ${device.deviceId} rssi: ${device.rssi}")
}
}
else -> println("No devices found or error occurred")
}
}
you should see something like this:
Discovered device: 317804 rssi: -71 Discovered device: b288ef rssi: -40
And then after you connect to each beacon and range via UWB you should see:
Device address prefix: 02:39:.... Distance 0.99 m, Azimuth: -40.240578, Elevation angle: 18.97932
Device address prefix: 02:39:.... Distance 0.86 m, Azimuth: -33.938553, Elevation angle: 57.48887
Upvotes: 1