Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SecureBeaconRegion doesn't work with null proximity UUID #211

Closed
xcastoreo opened this issue Apr 19, 2017 · 37 comments
Closed

SecureBeaconRegion doesn't work with null proximity UUID #211

xcastoreo opened this issue Apr 19, 2017 · 37 comments
Assignees
Labels

Comments

@xcastoreo
Copy link

Hi,

it seems that new SecureBeaconRegion("my_region", null, null, null); does not work:

java.lang.NullPointerException: Attempt to invoke virtual method 'long.java.util.UUID.getMostSignificantBits()' on a null object reference

In the ScanFilter createSecureRegionfilter(UUID uuid) method, there is no check for null UUID before working on it.

JavaDoc page about SecureBeaconRegion:
http://estimote.github.io/Android-SDK/JavaDocs/com/estimote/coresdk/observation/region/beacon/SecureBeaconRegion.html

@pawelDylag
Copy link
Contributor

Hello @xcastoreo !

My fault - will be fixed in the next release :) Thanks for reporting that! Here is a cookie for you 🍪

Cheers!

@pawelDylag pawelDylag added the bug label Apr 19, 2017
@xcastoreo
Copy link
Author

Cool :)

Just another question:
when I enter a UUID (for example UUID.fromString("1E5D4373-E741-4F68-73EF-375ED2EDBE54")) to create the secure region, the app's crashes and the Android Device Monitor shows:

E/EstimoteSDK: LollipopBluetoothAdapter$1.onScanFailed:269 Unable to start BLE scanning. Error code 3

So it's that an other bug or am I doing it wrong?

@pawelDylag
Copy link
Contributor

pawelDylag commented Apr 19, 2017

This may be connected to the bug above. There is a problem with filtering, so any UUID will got parsed wrong. I'm fixing this right now :)
Will keep you informed - I have a release scheduled for today, so hopefully this fix will be added :)

@pawelDylag
Copy link
Contributor

Hey @xcastoreo !

Fix was introduced in version 1.0.2 :) Because SecureBeaconRegion needs at least proximity UUID to behave properly, I disabled possibility to use null UUID object.
Also, the problem with Error code 3 is a typical problem on some phones. It is because our SDK tries to set many low-level filters to match SecureRegions and some phones can't handle that. I improved it and it should work now for every device :)
Please tell me if everything is alright now.
Cheers!

@xcastoreo
Copy link
Author

xcastoreo commented Apr 20, 2017

Hey @pawelDylag,

Thanks you for your reactivity ;)

I'm trying to scan for non secured beacons with the new 1.0.2 release:
beaconManager.connect(new BeaconManager.ServiceReadyCallback() { @Override public void onServiceReady() { Log.i(TAG, "Starting Ranging " + BEACONS); beaconManager.startRanging(BEACONS); } });

But the Android Device Monitor doesn't say the "Starting Beacon ranging":

I/NearestBeaconManager: Starting Ranging BeaconRegion{identifier=secured_beacons, proximityUUID=null, major=null, minor=null, secure=false}

My Bluetooth is enabled, and they are both non-secured and secured beacons all around...

EDIT: my bad, I was filtering the monitor so I couldn't see the logs '-_-
Working on it, will update searches :)

@xcastoreo
Copy link
Author

So,

the ranging is starting right, but it always returns an empty list of beacons.
The same code works well with the 1.0.1 SDK version.

@pawelDylag
Copy link
Contributor

Are you scanning for both secure & non-secure beacons?
Could you try switching off hardware filters ? In your Android Manifest add below Application tag: <meta-data android:name="disable_hardware_filtering" android:value="true" />
Does it change anything? Also please let me know how do you specify your secure region. Are you using random UUID? Or the one that is encrypted?

@xcastoreo
Copy link
Author

xcastoreo commented Apr 20, 2017

  • I am only scanning for non-secure beacons (we will see secure beacons later ;)),
  • adding the <meta-data android:name="disable_hardware_filtering" android:value="true" /> tag
    does not change anything, the list is always empty,
  • when I create a secure-region, I do this:
    private static final SecureBeaconRegion BEACONS = new SecureBeaconRegion("secured beacons", UUID.fromString("XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"), null, null);
    The UUID is the resolved Real Proximity UUID (the one in the Estimote Cloud and in the Estimote app').

@xcastoreo
Copy link
Author

Hey @pawelDylag,

I've tried to range non-secured beacons with:

  1. BeaconRegion("all beacons", null, null, null);
  2. BeaconRegion("my beacon", UUID.fromString("XXXXXXXX-XXXX-XXXX-XXXX-XXXXXX"), null, null);

and range secure beacons with:

  1. SecureBeaconRegion("my secure beacon", UUID.fromString("XXXXXXXX-XXXX-XXXX-XXXX-XXXXXX"), null, null);

In 1.0.1, the 1. scans for both non-secure and secure beacons. The 2. scans only for the beacon requested (beeing secure or not). And 3. doesn't works.

But always returning empty lists in 1.0.2...

@javiersearight
Copy link

We are experiencing this exact same issue.

We are able to see unclaimed, unmodified beacons with v1.0.2, but not our own.

Do you have an estimate for this fix?

@agra1992
Copy link

agra1992 commented Apr 27, 2017

Hey all,

Looks like I've run into the exact same issue as well. I'm trying to range for beacons in my Nativescript app which uses Estimote's Android SDK version 1.0.2. However, moving to the latest version of the SDK seems to always return an empty list of beacons.

Also, adding the <meta-data android:name="disable_hardware_filtering" android:value="true" /> hasn't resolved the issue. :(

Is there any fix available for this?

Regards,
AK

@pawelDylag
Copy link
Contributor

Hello guys!

Please check the fresh version of our SDK 1.0.3 and let me know if the problem is gone. If not, we will proceed further and schedule it to the next release :)

Have a nice day!

@agra1992
Copy link

agra1992 commented May 2, 2017

Hey Pawel,

Thanks for the reply. I love how you guys get back so quickly with resolutions to any problem. 👍

I will test the app with v1.0.3 and let you know if the problem is gone.

Have a great day ahead and regards,
AK

@xcastoreo
Copy link
Author

Hey @pawelDylag,

happy to test the new 1.0.3! But I can't see any of my non-secure beacons ;(

@agra1992
Copy link

agra1992 commented May 2, 2017

I tested the v1.0.3. Still cannot see any ranged beacons. However, ConfigurableDevicesListener works fine as always.

@xcastoreo
Copy link
Author

versions.pdf

@pawelDylag
Copy link
Contributor

Ok guys, this is really interesting. According to our test suite, ranging works well on all the phones. Although we do not have the coverage of all available Android devices. I need to know:

  1. Phone models you did test on
  2. Your Beacons info - type, firmware & hardware version, TX power/ Interval of iBeacon packet,
  3. Any helpful snippets - like your BeaconManager setup and/or ranging listener.

We will figure it out, don't worry :)

@jitongkai
Copy link

i has different firmware and hardware version beacons,such as:

  1. firmware version: A3.2.0 hardware version: D3.3, (can not discover by ranging, but can discover by use sdk version 1.0.1)
  2. firmware version: 4.9.1 hardware version: F3.3, ( can discover by ranging, sdk version 1.0.1 and 1.0.3 either is fine)

@xcastoreo
Copy link
Author

My side:

  1. Samsung SM-G360F with Android 5.0.2,
  2. type: Proximity Beacon
    name:
    color:
    geolocation:
    indor location:
    tags:
    meshgroup:
    Remaining Battery Life: 2 months
    Basic Battery Saving: Off
    Smart Battery Saving: On
    Motion Detection: On
    Motion Only Broadcasting: Off
    Motion Only Broadcasting Delay: 0 ms
    Flip To Sleep: On
    Automatic Firmware Update: Off
    Firmware Version: 3.2.0
    Hardware Version: D3.4
    Primary Packet Type: Estimote Default
    Proximity UUID:
    Major:
    Minor:
    Security UUID: Off
    Broadcasting Power: Strong (4dBm)
    Maximum Range: ~ 70 m / 230 ft
    Advertising Interval: 100 ms
  3. I'm using a copy of the ProximityContent sample.
    I can see the ConfigurableDevice packets of this same beacon.

@pawelDylag
Copy link
Contributor

@xcastoreo , @jitongkai

Ok, wonderful insight. Now I know that both of you are using our old D3.X beacons. We are really moving forward with development and all the tests are being made on newer beacons. I will check ranging for older devices and will keep you informed. I will also compare changes from 1.0.1 and 1.0.3, maybe I made some mistakes when updating.
Also, I really recommend buying newer beacons (like proximity, or even location beacons). They are way cooler then old ones :)

@agra1992
Copy link

agra1992 commented May 5, 2017

Hey @pawelDylag ,

Just to confirm, I'm using D3.X beacons as well for development purposes. I'm also using a pretty old device Samsung SM-G531F. I will also try running my app on a Nexus 6 and check if it's working on that device. Also, my Android version is at 5.1.1 (pretty old as well :P).

Let me know if I need to upgrade my mobile device to be able to range for the beacons.

Regards,
AK

@sw-tt-devalpatel
Copy link

sw-tt-devalpatel commented May 18, 2017

Hey @pawelDylag

I am using Job Service for scanning beacons in application Kill Mode. I am using D3.X version beacons and they are not able to discovered in onBeaconsDiscovered with Job Service but it's working fine with Activity.

Beacon not in secure mode
Estimote Version used 1.0.3
Android OS Version 6.0.1
Device Nexus 5

If I am replace estimote library to version 1.0.1 then I will got results in onBeaconsDiscovered.
Is their any issue with latest revision?

Regards,
Deval Patel

@xcastoreo
Copy link
Author

Hey @pawelDylag,

any news about this?
We would like to use both beacon ranging & packet discovery with our D3.X beacons :)

@RafaelSermenho
Copy link

Hi guys! I'm having the same problem using D3.X beacons on Samsung Galaxy S7 and Samsung Galaxy S8 (Android N) devices. Monitoring is working with version 1.0.1 but not with version 1.0.3.

@xcastoreo
Copy link
Author

Hi @pawelDylag,

any news for this hot topic? ><
We are going to need this feature very quickly, can you inform us about the time you will need to fix it?

Thanks!

@im-ng
Copy link

im-ng commented Jul 7, 2017

Hi @pawelDylag, Is this fixed in latest release(1.0.8)?

@pawelDylag
Copy link
Contributor

Hey all!

Sorry for the delays - we've got tons of work to do here :)
We'll be investigating this problem in the upcoming week - D3.X beacons are really old and they have low priority on our task list. But we'll try our best to fix the problem introduced by mistake in 1.0.3. If you need only stable ranging/monitoring for those old beacons, you can switch back to 1.0.1 for now.
We'll keep you informed about that :)

@xcastoreo
Copy link
Author

@pawelDylag,

I'm actually doing this, just unable to call the SecureRanging on Android and on iOS with the same JavaScript function, and on Android scanning for both secure and non secure beacons.
Waiting for news ;)

@xcastoreo
Copy link
Author

Hey,
I have little news:
in Estimote Android SDK version 1.0.1, the Secure Ranging works only when we scan for an empty BeaconRegion(). Defining a non-null UUID makes the Secure Ranging fail.
The simple Ranging always works.

@xcastoreo
Copy link
Author

What's new?

I have to implement the secure ranging with the D3.X beacons, but on Android the device is scanning both secure and non-secure beacons. So it's not really secure if someone discovers the true UUID, because he will be able to clone it :(

@pawelDylag
Copy link
Contributor

Hey!

We have released version 1.0.9 with slightly changed scanning mechanism on Nougat devices and fixed support for old D3.X beacons :)

@xcastoreo
Copy link
Author

Cool,

I will see that ;)

Ty

@xcastoreo
Copy link
Author

xcastoreo commented Jul 20, 2017

Hi,

new from my tests:

  • the ranging of a SecureBeaconRegion doesn't crash,
  • this ranging gives the Secure Beacons but also the non-secure Beacons...

So the issue was previously:

  • startRanging(BeaconRegion) was not crashing,
  • it delivered both non-secure and secure beacons.
  • startRanging(SecureBeaconRegion) was crashing,
  • it delivered nothing,

And after the 1.0.9, we have:

  • startRanging(BeaconRegion) is not crashing,
  • it only delivers non-secure beacons.
  • startRanging(SecureBeaconRegion) is not crashing,
  • it delivers both non-secure and secure beacons,

A last effort and we will get it ;)

@pawelDylag
Copy link
Contributor

Hey @xcastoreo

Thanks for the report - we'll make sure Secure region won't report non-secure beacons in the next release :)

Cheers!

@xcastoreo
Copy link
Author

Hey @pawelDylag,

I'm still here with my annoying issue, is there any news?

@shlok2iid
Copy link

shlok2iid commented Aug 10, 2017

Hi Pawel,

I am still getting, Region enter/exit problem in newer version 1.0.9, 1.0.11, 1.0.12.
Please help me thanks is advance.

@pawelDylag
Copy link
Contributor

I encourage you to try our new ProximitySDK 🚀 - it is dedicated for creating proximity interactions with our beacons - its main focus is to deliver the reliable enter/exit experience according to a different zones of beacons, based on our own data-science, and Estimote Monitoring packet.
It works extremely well with Android 5.0-8.0 devices (full support for Nougat, and Oreo included), and also allows you to configure it to keep scanning in the background.

As it comes for security, there is no support for it in the ProximitySDK, yet ;)

Here is the official repository page -> https://github.com/Estimote/Android-Proximity-SDK

Also, we keep posting updates about the progress of our development on this thread at our forums.
I encourage you to track it in order to be super up-to-date :)

Please, check the mentioned new SDK - the current SDK will soon be deprecated, and we will support only critical issues for some time.

@abiela abiela closed this as completed Nov 30, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

10 participants