Unable to find class ESTDeviceLocationBeacon in android SDK

We have referred the below blog

We have purchased Estimote Location beacons(3 quantity) and Stickers(10 quantity). We have upgraded the Location beacon firmware to 4.13.2.

We did the cloud-based configuration process and executed the below code snippet. We kept the 3 Location beacons and 5 stickers in a rectangular shaped room. We could see these beacons in Estimote Android App

fun generateReport() {
mm.prepareNearablesScanReportCommandForNetworkIdentifier(2640, object : MeshManager.MeshCallback<Void> {
override fun onError(e: EstimoteException?) {
            Logger.shortToast(context, "generateReport Failed...")
            e?.printStackTrace()
        }

override fun onSuccess(o: Void?) {
            Logger.shortToast(context, "generateReport Success...")
        }

    })
}

In above code 2640 is the mesh id. We also get the onSuccess() callback.

As per the blog, the next step is to execute the below code which we couldn’t find it in android. We need a respective android code snippet for the below code.

func readReportFromDevice(device: ESTDeviceLocationBeacon) {
	// Connection is required to read Asset Tracking report
	if device.connectionStatus != ESTConnectionStatus.connected {
		return
	}

	device.scanReports ? .readScanReport(completion: {
		(report: ESTMeshNearablesScanReportVO, error: Error)in

		guard let error = error else {
				return
			}

			// You should use first 4 bytes of Nearable identifier
			// Returned string contains first 4 bytes of beacon identifiers
			let closestDeviceIdentifier : String = report.closestDeviceIdentifier(forNearableIdentifier: "aabbccdd")
	})
}

Instead of the above code, we used the Estimote scan report API - https://cloud.estimote.com/v3/asset_tracking/reports
This API returns empty response - {“meta”:{“total_count”:0},“data”:[]}

We need your help in getting the location of the stickers. Let us know if we need to do any other configurations. Please revert us at the earliest.

Hi @praveencastelino

Android-based use-case of asset tracking solution is build on top of 3 parts. You managed to handle two of them . Luckily, the missing one is quite simple :). Here the full scenario you have to follow:

  1. Trigger Nearables Scan Report for given mesh network,
    This is done by MeshManager::prepareNearablesScanReportCommandForNetworkIdentifier method call.
    This method connect to Estimote Cloud and register Nearables Scan Report Request for your mesh.
    You actually managed to handle this step :slight_smile:

  2. Run mesh gateway (This is the stuff you are missing :slight_smile: )
    It’s quite simple, here is some example code:
    val notification = Notification.Builder(this) .setSmallIcon(R.drawable.beacon_gray) .setContentTitle("HERE GOES YOUR NOTIFICATION TITLE") .setContentText("HERE GOES YOUR NOTIFICATION CONTENT" ) .setPriority(Notification.PRIORITY_HIGH) .build() gatewayHandler = MeshGateway(applicationContext).startWithForegroundScanner(notification)
    Mesh gateway is actually long-running, background process which will automatically do all the necessary magic for you:

  • It will periodically check if there is something new to be synchronized from Estimote Cloud into your mesh.
  • If something new gets detected (e.g. Nearables Scan Report Request) - then mesh-gateway will scan for beacons in your mesh and apply necessary configuration updates straight from cloud in to your beacons.
  • If You have Nearables Scan Report Request scheduled in the cloud - then gateway will automatically synchronize it in to bacons and trigger asset scan. When the scan gets finished, gateway will detect it and - once again automatically - read scan report from bracons and post it to Estimote Cloud.

Please note that once mesh gateway gets fired up, it will constantly work in background and synchronize your Cloud-updates into your mesh network. So you can execute MeshManager::prepareNearablesScanReportCommandForNetworkIdentifier periodically while mesh-gateway is running and it will automatically trigger actual scans and sychronise results back to the Cloud

  1. All you need to do to obtain generated report is to utilize https://cloud.estimote.com/v3/asset_tracking/reports api to obtain stored repports - you already managed to do so :slight_smile:

Regards
Wojtek

Thanks for the quick reply.

  1. We have followed the steps provided by you. We could actually get the reports. However we got a crash with the below exception 3 times.
    Process: com.codecraft.assettracking, PID: 11372
    io.reactivex.exceptions.UndeliverableException: com.estimote.mgmtsdk.common.exceptions.DeviceConnectionException: Timeout while connecting to beacon
    at io.reactivex.plugins.RxJavaPlugins.onError(RxJavaPlugins.java:349)
    at io.reactivex.internal.operators.observable.ObservableCreate$CreateEmitter.onError(ObservableCreate.java:83)
    at com.estimote.mgmtsdk.feature.mesh.gateway.internal.use_cases.ExecuteMeshCommandUseCase$connectToBeacon$1$1$1.onConnectionFailed(ExecuteMeshCommandUseCase.kt:127)
    at com.estimote.mgmtsdk.connection.api.management_sdk_mocks.ManagementSDKDeviceConnectionCallback.onConnectionFailed(ManagementSDKDeviceConnectionCallback.kt:52)
    at com.estimote.mgmtsdk.connection.strategy.DeviceConnectionInternalLink$1$3.run(DeviceConnectionInternalLink.java:73)
    at android.os.Handler.handleCallback(Handler.java:751)
    at android.os.Handler.dispatchMessage(Handler.java:95)
    at android.os.Looper.loop(Looper.java:154)
    at android.app.ActivityThread.main(ActivityThread.java:6119)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
    Caused by: com.estimote.mgmtsdk.common.exceptions.DeviceConnectionException: Timeout while connecting to beacon
    at com.estimote.mgmtsdk.connection.strategy.DeviceConnectionInternal$1.onError(DeviceConnectionInternal.java:262)
    at com.estimote.mgmtsdk.connection.strategy.BasicConnectionStrategy$1.onConnectionError(BasicConnectionStrategy.java:73)
    at com.estimote.coresdk.connection.bluerock.BlueRock.notifyConnectionError(BlueRock.java:434)
    at com.estimote.coresdk.connection.bluerock.BlueRock.access$800(BlueRock.java:52)
    at com.estimote.coresdk.connection.bluerock.BlueRock$4.run(BlueRock.java:411)
    at android.os.Handler.handleCallback(Handler.java:751)
    at android.os.Handler.dispatchMessage(Handler.java:95)
    at android.os.Looper.loop(Looper.java:154)
    at android.app.ActivityThread.main(ActivityThread.java:6119)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)

After the crash, generating the scan report from the app was always failing with below error. Hence we were getting the same old scan reports.
W/System.err: at com.estimote.coresdk.cloud.internal.InternalEstimoteCloud$7.failure(InternalEstimoteCloud.java:535)
W/System.err: at com.estimote.coresdk.repackaged.retrofit_v1_9_0.retrofit.CallbackRunnable$2.run(CallbackRunnable.java:53)
W/System.err: at android.os.Handler.handleCallback(Handler.java:751)
W/System.err: at android.os.Handler.dispatchMessage(Handler.java:95)
W/System.err: at android.os.Looper.loop(Looper.java:154)
W/System.err: at android.app.ActivityThread.main(ActivityThread.java:6119)
W/System.err: at java.lang.reflect.Method.invoke(Native Method)
W/System.err: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
W/System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
W/System.err: Caused by: com.estimote.coresdk.repackaged.retrofit_v1_9_0.retrofit.RetrofitError: 404 Not Found
W/System.err: at com.estimote.coresdk.repackaged.retrofit_v1_9_0.retrofit.RestAdapter$RestHandler.invokeRequest(RestAdapter.java:387)
W/System.err: at com.estimote.coresdk.repackaged.retrofit_v1_9_0.retrofit.RestAdapter$RestHandler.access$000(RestAdapter.java:219)
W/System.err: at com.estimote.coresdk.repackaged.retrofit_v1_9_0.retrofit.RestAdapter$RestHandler$1.obtainResponse(RestAdapter.java:277)
W/System.err: at com.estimote.coresdk.repackaged.retrofit_v1_9_0.retrofit.CallbackRunnable.run(CallbackRunnable.java:42)
W/System.err: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
W/System.err: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
W/System.err: at com.estimote.coresdk.repackaged.retrofit_v1_9_0.retrofit.Platform$Android$2$1.run(Platform.java:134)
W/System.err: at java.lang.Thread.run(Thread.java:761)

  1. We would also like to know the next steps for generating the X,Y coordinates of the sticker’s location from the below scan reports.

{
“meta”: {
“total_count”: 1
},
“data”: {
“devices_reports”: [
{
“704ec0365d565264e84b2c02bc83522c”: [
{
“seen_nearable”: “79ad3add”,
“rssi”: -58
},
{
“seen_nearable”: “3d6d786f”,
“rssi”: -80
}
]
},
“settings_version”: 1507040724,
“collected_at”: 1507040724,
“report_id”: 4
}
}
]

  1. After getting the X,Y position of the sticker, What are the next steps to view the stickers on the floor map?

Thanks for the quick reply.

  1. We have followed the steps provided by you. We could actually get the reports. However we got a crash with the below exception 3 times.
    Process: com.codecraft.assettracking, PID: 11372
    io.reactivex.exceptions.UndeliverableException: com.estimote.mgmtsdk.common.exceptions.DeviceConnectionException: Timeout while connecting to beacon
    at io.reactivex.plugins.RxJavaPlugins.onError(RxJavaPlugins.java:349)
    at io.reactivex.internal.operators.observable.ObservableCreate$CreateEmitter.onError(ObservableCreate.java:83)
    at com.estimote.mgmtsdk.feature.mesh.gateway.internal.use_cases.ExecuteMeshCommandUseCase$connectToBeacon$1$1$1.onConnectionFailed(ExecuteMeshCommandUseCase.kt:127)
    at com.estimote.mgmtsdk.connection.api.management_sdk_mocks.ManagementSDKDeviceConnectionCallback.onConnectionFailed(ManagementSDKDeviceConnectionCallback.kt:52)
    at com.estimote.mgmtsdk.connection.strategy.DeviceConnectionInternalLink$1$3.run(DeviceConnectionInternalLink.java:73)
    at android.os.Handler.handleCallback(Handler.java:751)
    at android.os.Handler.dispatchMessage(Handler.java:95)
    at android.os.Looper.loop(Looper.java:154)
    at android.app.ActivityThread.main(ActivityThread.java:6119)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
    Caused by: com.estimote.mgmtsdk.common.exceptions.DeviceConnectionException: Timeout while connecting to beacon
    at com.estimote.mgmtsdk.connection.strategy.DeviceConnectionInternal$1.onError(DeviceConnectionInternal.java:262)
    at com.estimote.mgmtsdk.connection.strategy.BasicConnectionStrategy$1.onConnectionError(BasicConnectionStrategy.java:73)
    at com.estimote.coresdk.connection.bluerock.BlueRock.notifyConnectionError(BlueRock.java:434)
    at com.estimote.coresdk.connection.bluerock.BlueRock.access$800(BlueRock.java:52)
    at com.estimote.coresdk.connection.bluerock.BlueRock$4.run(BlueRock.java:411)
    at android.os.Handler.handleCallback(Handler.java:751)
    at android.os.Handler.dispatchMessage(Handler.java:95)
    at android.os.Looper.loop(Looper.java:154)
    at android.app.ActivityThread.main(ActivityThread.java:6119)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)

    After the crash, generating the scan report from the app was always failing with below error. Hence we were getting the same old scan reports.
    W/System.err: at com.estimote.coresdk.cloud.internal.InternalEstimoteCloud$7.failure(InternalEstimoteCloud.java:535)
    W/System.err: at com.estimote.coresdk.repackaged.retrofit_v1_9_0.retrofit.CallbackRunnable$2.run(CallbackRunnable.java:53)
    W/System.err: at android.os.Handler.handleCallback(Handler.java:751)
    W/System.err: at android.os.Handler.dispatchMessage(Handler.java:95)
    W/System.err: at android.os.Looper.loop(Looper.java:154)
    W/System.err: at android.app.ActivityThread.main(ActivityThread.java:6119)
    W/System.err: at java.lang.reflect.Method.invoke(Native Method)
    W/System.err: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
    W/System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
    W/System.err: Caused by: com.estimote.coresdk.repackaged.retrofit_v1_9_0.retrofit.RetrofitError: 404 Not Found
    W/System.err: at com.estimote.coresdk.repackaged.retrofit_v1_9_0.retrofit.RestAdapter$RestHandler.invokeRequest(RestAdapter.java:387)
    W/System.err: at com.estimote.coresdk.repackaged.retrofit_v1_9_0.retrofit.RestAdapter$RestHandler.access$000(RestAdapter.java:219)
    W/System.err: at com.estimote.coresdk.repackaged.retrofit_v1_9_0.retrofit.RestAdapter$RestHandler$1.obtainResponse(RestAdapter.java:277)
    W/System.err: at com.estimote.coresdk.repackaged.retrofit_v1_9_0.retrofit.CallbackRunnable.run(CallbackRunnable.java:42)
    W/System.err: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
    W/System.err: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
    W/System.err: at com.estimote.coresdk.repackaged.retrofit_v1_9_0.retrofit.Platform$Android$2$1.run(Platform.java:134)
    W/System.err: at java.lang.Thread.run(Thread.java:761)

  2. We would also like to know the next steps for generating the X,Y coordinates of the sticker’s location from the below scan reports.

    {
    “meta”: {
    “total_count”: 1
    },
    “data”: {
    “devices_reports”: [
    {
    “704ec0365d565264e84b2c02bc83522c”: [
    {
    “seen_nearable”: “79ad3add”,
    “rssi”: -58
    },
    {
    “seen_nearable”: “3d6d786f”,
    “rssi”: -80
    }
    ]
    },
    “settings_version”: 1507040724,
    “collected_at”: 1507040724,
    “report_id”: 4
    }
    }
    ]

  3. After getting the X,Y position of the sticker, What are the next steps to view the stickers on the floor map?

Hey guys,
@Wojciech_Wawerek @praveencastelino

I have followed the same steps as @praveencastelino for asset tracking.

My expectation: To see the nearable-stickers updated in the estimote cloud (as I run the application on phone)

Reality: I get an error with the following function, MeshGateway(applicationcontext).startWithForegroundScanner(notification)

The error looks like this: (I am posting just the first few lines, and making in bold the final place of the crash)
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.yushakareem.myfirstapp, PID: 11865
java.lang.NoSuchMethodError: No virtual method createScannerWithForegroundService(Landroid/app/Notification;)Lcom/estimote/internal_plugins_api/scanning/BluetoothScanner; in class Lcom/estimote/scanning_sdk/api/EstimoteBluetoothScannerFactory; or its super classes (declaration of ‘com.estimote.scanning_sdk.api.EstimoteBluetoothScannerFactory’ appears in /data/app/com.example.yushakareem.myfirstapp-1l1juK33ZJdbr5ouJm09EQ==/split_lib_dependencies_apk.apk)
at com.estimote.mgmtsdk.feature.mesh.gateway.MeshGateway.startWithForegroundScanner(MeshGateway.kt:28)
at com.example.yushakareem.myfirstapp.MainActivity.startNearableObservation(MainActivity.kt:139)
at com.example.yushakareem.myfirstapp.MainActivity.access$startNearableObservation(MainActivity.kt:39)
at com.example.yushakareem.myfirstapp.MainActivity$onCreate$2.invoke(MainActivity.kt:85)
at com.example.yushakareem.myfirstapp.MainActivity$onCreate$2.invoke(MainActivity.kt:39)
at com.estimote.mustard.rx_goodness.rx_requirements_wizard.EstimoteRequirementsWizard$notifyCallbacks$1.accept(EstimoteRequirementsWizard.kt:43)
at com.estimote.mustard.rx_goodness.rx_requirements_wizard.EstimoteRequirementsWizard$notifyCallbacks$1.accept(EstimoteRequirementsWizard.kt:10)
at io.reactivex.internal.observers.ConsumerSingleObserver.onSuccess(ConsumerSingleObserver.java:63)
at io.reactivex.internal.operators.single.SingleFlatMap$SingleFlatMapCallback$FlatMapSingleObserver.onSuccess(SingleFlatMap.java:111)
at io.reactivex.internal.operators.single.SingleMap$MapSingleObserver.onSuccess(SingleMap.java:64)
at io.reactivex.internal.operators.single.SingleJust.subscribeActual(SingleJust.java:30)

Any hints or suggestion for Asset tracking, most welcome :slight_smile:

Thank you,
Kind regards
Yusha Kareem