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

Fails getting RSSI on Android >=5.0 (Samsung Galaxies) #135

Closed
24mu13 opened this issue Jan 4, 2016 · 5 comments
Closed

Fails getting RSSI on Android >=5.0 (Samsung Galaxies) #135

24mu13 opened this issue Jan 4, 2016 · 5 comments

Comments

@24mu13
Copy link

24mu13 commented Jan 4, 2016

I have a very simple code like that (using you Airport tutorial):

  for (Beacon rangedBeacon: list) {
    rangedBeacon.getRssi()
    double distance = computeAccuracy(rangedBeacon);
    Log.d("Airport", String.format("Estimated distance beacon %d: %.2f (RSSI: %d)",
      rangedBeacon.getMinor(), distance, rangedBeacon.getRssi()));
  }

When using Android < 5.0 (Galaxy S3 tested) I always get the right values for the ranged beacons:

12-30 15:22:30.844 11880-11880/com.agtinternational.airport D/Airport: Estimated distance beacon 100: 0.64
12-30 15:22:30.849 11880-11880/com.agtinternational.airport D/Airport: Estimated distance beacon 200: 1.62
12-30 15:22:30.849 11880-11880/com.agtinternational.airport D/Airport: Estimated distance beacon 300: 3.17

Instead when using Android >= 5.0 (Galaxy S6 tested) after some success, I start to get not values like the following:

12-30 15:22:30.844 11880-11880/com.agtinternational.airport D/Airport: Estimated distance beacon 100: 0.00 (RSSI: -7)
12-30 15:22:30.849 11880-11880/com.agtinternational.airport D/Airport: Estimated distance beacon 200: 0.00 (RSSI: -7)
12-30 15:22:30.849 11880-11880/com.agtinternational.airport D/Airport: Estimated distance beacon 300: 0.00 (RSSI: -7)

To get again right values, I have to switch off Bluetooth and let the application (com.estimote.apps.main) to request for Bluetooth turning-on again.

By the way the same behavior happens using only the app when scanning devices.

@heypiotr
Copy link
Contributor

heypiotr commented Jan 4, 2016

Thanks for your report!

Actually, just today I bumped into a conversation on Nordic's forums, mentioning that Galaxy S6 has some bugs in the Android 5.0 BLE API (which we switched to in SDK 0.9.5) implementation:

When using offloaded batching be aware that some devices (Samsung S6 and S6 Edge) have a bug and all packets reported with this mode have exactly the same RSSI value.

(source: https://devzone.nordicsemi.com/question/51453/android-bluetooth-smart-properties/)

As a temporary workaround, you can switch to SDK 0.9.4 … or, I think there's a flag you can set on our SDK to force it to use the old, Android 4 BLE API. (@Poberro knows more about it.) In the meantime, we'll see if/how we can address that.

@heypiotr
Copy link
Contributor

heypiotr commented Jan 5, 2016

Can you try adding this line:

<meta-data android:name="force_old_scanning_api" android:value="true" />

to your manifest file, inside the <application/> section? As the name implies, it forces the use of the Jelly Bean API, which should serve as a temporary workaround to the issue. Let us know how it goes!

@centos94
Copy link

centos94 commented Jan 8, 2016

Hello guys,
I've the same problem.
I'm trying to develop an app, based on your Android-SDK, and when i try it on devices with android >=5.1 (tried on last S6 and Nexus 7), the app don't show any beacons, or only rarely(after much time) to lost it immediatly.
Same problem with your app, downloaded from the store.

I've already triyed to add the line you suggested, but it didn't work.
Other suggestions?

@heypiotr
Copy link
Contributor

If the app doesn't show ANY beacons, then it looks like another issue. The problems we know about concern Samsung Galaxies on Android 5.0 or later, and result in incorrect RSSI readings.

Double-check if you have Bluetooth on, Location on, try rebooting your devices. If the problem of not being able to detect beacons persists, please open another issue. (This one is for the RSSI problems.)

@heypiotr heypiotr changed the title Fails getting RSSI on Android >=5.0 Fails getting RSSI on Android >=5.0 (Samsung Galaxies) Jan 12, 2016
Poberro added a commit that referenced this issue Jan 19, 2016
- Packet parser errors are logged and should not crash whole application.
- Fixed threading issue that cause scanning to continue when service was stopped (on some devices).
- onExitRegion should be now working on devices with pre-Lollipop Androids.
- Fixed (#135): Fails getting RSSI on Android >=5.0 (Samsung Galaxies)
- Fixed (#137): IllegalStateException when starting monitoring on SDK 0.9.6
@Poberro
Copy link
Contributor

Poberro commented Jan 19, 2016

Fixed in SDK release version 0.9.7

@Poberro Poberro closed this as completed Jan 19, 2016
Poberro added a commit that referenced this issue Jan 19, 2016
- Packet parser errors are logged and should not crash whole application.
- Fixed threading issue that cause scanning to continue when service was stopped (on some devices).
- onExitRegion should be now working on devices with pre-Lollipop Androids.
- Fixed (#135): Fails getting RSSI on Android >=5.0 (Samsung Galaxies)
- Fixed (#137): IllegalStateException when starting monitoring on SDK 0.9.6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants