Proximity-sdk:0.1.0-alpha.6 does not detect the beacons!

I have try so many time with this code:

Notification notification = new Notification.Builder(this)
                .setSmallIcon(android.R.drawable.ic_dialog_info)
                .setContentTitle("Beacon Scanner")
                .setContentText("Scan is running...")
                .build();
        EstimoteCloudCredentials cloudCredentials = new EstimoteCloudCredentials("XXXX", "XXXXX");
        ProximityObserver proximityObserver = new ProximityObserverBuilder(getApplicationContext(), cloudCredentials)
                .withBalancedPowerMode ()
                .withScannerInForegroundService(notification)
                .withOnErrorAction(new Function1<Throwable, Unit>() {
                    @Override
                    public Unit invoke(Throwable throwable) {
                        return null;
                    }
                })
                .build();

        // Java
        ProximityZone venueZone =
                proximityObserver.zoneBuilder()
                        .forAttachmentKeyAndValue("venue", "office")
                        .inFarRange()
                        .withOnEnterAction(new Function1<ProximityAttachment, Unit>() {
                            @Override public Unit invoke(ProximityAttachment proximityAttachment) {
                                Log.d("testmax","withOnEnterAction");
                                return null;
                            }
                        })
                        .withOnExitAction(new Function1<ProximityAttachment, Unit>() {
                            @Override
                            public Unit invoke(ProximityAttachment proximityAttachment) {
                                Log.d("testmax","withOnExitAction");
                                return null;
                            }
                        })
                        .withOnChangeAction(new Function1<List<? extends ProximityAttachment>, Unit>() {
                            @Override
                            public Unit invoke(List<? extends ProximityAttachment> proximityAttachments) {
                                Log.d("testmax","pippo");
                                return null;
                            }
                        })
                        .create();
   
        observationHandler =
                proximityObserver
                        .addProximityZone(venueZone)
                        .start();

In EstimoteCloudCredentials I have insert my credential. I read the beacon unique ID in log Android Studio, so suppose that it is all correct but I not receve never callback in enter in exit or change action.
I have used Android 6.0.1 on Samsung SM-T805 and on Raspberry Pi with Android Things.

Check if you have location permissions enabled. Also try to replace .withBalancedPowerMode() with .withLowLatencyPowerMode(). I suppose that this phone might not support low power consumption modes and when told to start scanning it throws an error. We are working to have a fix in SDK that will do this automatically.
Android Things on Raspberry Pi3 has its own issues with Bluetooth. I tried to run the same code on PICO-IMX7 and Raspberry Pi3 and on first one it worked and on second one it failed. It seems that is platform problem.
If you have a problem with SDK please open an issue on GitHub: https://github.com/Estimote/Android-Proximity-SDK/issues

I have already tried change in .withLowLatencyPowerMode () but nothing has changed, permission is active, I have already developed other apps with estimative sdk and everything is ok. We want to get support for Android 8.1, so integrating the proximity. For android things for now it does not work on raspberry?

I have tried on ONE PLUS Andorid 7.1.1 but i have the same issue.

Could you get some logs from logcat? We need to find out if issue is in scanning or in Cloud communication. Without logs it will be quite hard. Can you also check if Estimote App can scan those beacons? And check if other apps are also scanning properly (for example nRFConnect).
Have you configured attachments in Estimote Cloud? Have you checked you don’t have any typos there?
For Android Things is does not work on Raspberry out of a box, but it does for PICO-IMX7.

These are the log:

12-19 02:17:43.006 30876-30876/? E/Zygote: v2
12-19 02:17:43.006 30876-30876/? I/libpersona: KNOX_SDCARD checking this for 10237
12-19 02:17:43.006 30876-30876/? I/libpersona: KNOX_SDCARD not a persona
12-19 02:17:43.006 30876-30876/? W/SELinux: Function: selinux_compare_spd_ram, index[1], priority [2], priority version is VE=SEPF_SECMOBILE_6.0.1_0013
12-19 02:17:43.011 30876-30876/? W/SELinux: SELinux: seapp_context_lookup: seinfo=default, level=s0:c512,c768, pkgname=it.a3fedin.test
12-19 02:17:43.016 30876-30876/? I/art: Late-enabling -Xcheck:jni
12-19 02:17:43.066 30876-30876/? D/ActivityThread: Added TimaKeyStore provider
12-19 02:17:43.136 30876-30876/it.a3fedin.test W/System: ClassLoader referenced unknown path: /data/app/it.a3fedin.test-2/lib/arm
12-19 02:17:43.321 30876-30876/it.a3fedin.test D/BluetoothAdapter: STATE_ON
12-19 02:17:43.321 30876-30876/it.a3fedin.test D/BluetoothAdapter: STATE_ON
12-19 02:17:43.461 30876-30876/it.a3fedin.test D/SecWifiDisplayUtil: Metadata value : none
12-19 02:17:43.466 30876-30876/it.a3fedin.test D/ViewRootImpl: #1 mView = com.android.internal.policy.PhoneWindow$DecorView{92cc4ff I.E… R…ID 0,0-0,0}
12-19 02:17:43.481 30876-30932/it.a3fedin.test D/OpenGLRenderer: Use EGL_SWAP_BEHAVIOR_PRESERVED: true
12-19 02:17:43.576 30876-30932/it.a3fedin.test D/libEGL: eglInitialize EGLDisplay = 0xae77f7c4
12-19 02:17:43.576 30876-30932/it.a3fedin.test I/OpenGLRenderer: Initialized EGL, version 1.4
12-19 02:17:43.591 30876-30932/it.a3fedin.test D/mali_winsys: new_window_surface returns 0x3000, [1600x2560]-format:1
12-19 02:17:43.616 30876-30876/it.a3fedin.test D/ViewRootImpl: MSG_RESIZED_REPORT: ci=Rect(0, 48 - 0, 0) vi=Rect(0, 48 - 0, 0) or=1
12-19 02:17:43.636 30876-30932/it.a3fedin.test D/libGLESv1: STS_GLApi : DTS is not allowed for Package : it.a3fedin.test
12-19 02:17:43.746 30876-30876/it.a3fedin.test I/Timeline: Timeline: Activity_idle id: android.os.BinderProxy@23e741e time:621869269
12-19 02:17:45.126 30876-30876/it.a3fedin.test D/ProximityAnalytics: Reporting start monitoring for 3cce0ce52028a8f580e4428808596a19
12-19 02:17:45.131 30876-30876/it.a3fedin.test D/ProximityAnalytics: Reporting start monitoring for 4a13f8a4add9b4330699aba9147d0f19
12-19 02:17:45.161 30876-30876/it.a3fedin.test D/BluetoothLeScanner: Start Scan
12-19 02:17:45.166 30876-30876/it.a3fedin.test D/BluetoothAdapter: STATE_ON
12-19 02:17:45.166 30876-30876/it.a3fedin.test D/BluetoothAdapter: STATE_ON
12-19 02:17:45.166 30876-30876/it.a3fedin.test D/BluetoothAdapter: STATE_ON
12-19 02:17:45.166 30876-30876/it.a3fedin.test D/BluetoothAdapter: STATE_ON
12-19 02:17:45.276 30876-30888/it.a3fedin.test D/BluetoothLeScanner: onClientRegistered() - status=0 clientIf=10
12-19 02:17:46.831 30876-30876/it.a3fedin.test D/ProximitySDK: Sent usage metrics of one id.
12-19 02:17:46.831 30876-30876/it.a3fedin.test D/ProximitySDK: Sent usage metrics of one id.

If shows this:

Reporting start monitoring for 4a13f8a4add9b4330699aba9147d0f19

i suppose the tag is correct or not?

I have tried with yours app on Play Store and nRFConnect i see the beacons.

Hey @max1987

Paweł here, from ProximitySDK team. We are currently adding enhancements to support more phone models (with some Samsung devices among them), and those changes will be introduced in the next alpha release. Also, we did test our SDK with Android Things platform recently. BLE scanning works well on NXP i.MX7D, but Raspberry Pi 3 has some bugs in kernel, that makes it difficult to scan beacons - we suggest using NXP for now. We are going to notify Google about the RPI problems, and I hope it will be fixed in the next DP of Android Things.

As for your problem - we checked your beacons in our database and it seems that they have Estimote Monitoring disabled. Well, basically, your beacons are not advertising the packet needed by our algorithm to work properly. You need to connect to your beacons (using our app from Play Store/App store) and enable Estimote Monitoring there. This should allow your app to work properly :slight_smile:

Regards,
Paweł

I can not enable the option, as a response I get “you can not change while the mesh is locked”. I used
https://cloud.estimote.com/v3/mesh/2036/override_lock to unlock and is really unlocked but when I try to enable the option it blocks the beacon and I get the same message “you can not change while the mesh is locked” .

Ok, it seems that there is a known-issue with caching mechanism on our Cloud - we are working on that. Your account should now be able to see your mesh as “unlocked”. The easiest way to turn on Estimote Monitoring is through our app - just connect to one of your beacons and enable it. The mesh should propagate this setting for you to other devices. You can also turn it on manually with connecting to each of your devices separately (I encourage you to use our NFC - just touch one of our beacons with a phone with Estimote App installed and NFC turned on)

Let me know if it works :slight_smile:

Regards,
Paweł

Hi, now everything is working correctly even if I noticed a long delay in trigger the exit. For Android Things on raspberry it is now working, what problems did you find?

Hey @max1987

We’re still improving the algorithm. You can play with inCustomRange() to find out the best setup for your case.
As for RaspberryPI - the issue is related to the large amounts of beacons around (as in our office), so it might not occur to you.

Regards,
Paweł

What is the orientation number of beacons with which you start having problems on RaspberryPI?

We never measured it, but it would depend on number of enabled packets and their advertising interval. I guesstimate you would need more than fifty.