Cannot get telemetry data with Proximity SDK

Hi! I am fighting with the new Proximity SDK telemetry features (moved from Estimote SDK). However the documents are Kotlin only, which is kind of a new experience for me :slight_smile: I have tried to hook up different gists and created a simple app to log telemetry data. However after compiling I get an error Bluetooth Low Energy scan failed with error code

   override fun onCreate(savedInstanceState: Bundle?) {
    super.onCreate(savedInstanceState)
    setContentView(R.layout.activity_main)
        val scanner = EstimoteBluetoothScannerFactory(applicationContext).getSimpleScanner()
        val scanHandler = scanner.estimoteTelemetryFullScan()
                .withBalancedPowerMode()
                .withOnPacketFoundAction {
                    Log.d("Full Telemetry", "Got Full Telemetry packet: $it")
                }
                .start()
}

Can you help me with that?

Hey @norbi

You can use this code inside your Java app just as any other Java library. Although I really encourage you to move to Kotlin - it’s far better than Java in my personal opinion :slight_smile:

As for you problem - it seems that there is something wrong with your phone’s bluetooth. The data I need to know:

  1. Your phone model
  2. Your phone’s android version
  3. The error code value returned in your error log
  4. Does your app have location permissions enabled?
  5. Does your phone have bluetooth enabled?

Btw. you can take a look at our example app here. :slight_smile:

Kind regards,
Paweł

1 Like

Thanks @paweldylag!

Here are the information you have requested:

  1. OnePlus 3
  2. 8.0.0
  3. io.reactivex.exceptions.UndeliverableException: java.lang.Exception: Bluetooth Low Energy scan failed with error code: 2
  4. Yes, it is set on in the app settings
  5. Yes

Thanks for the information.

  1. Scan error code 2 is, according to Google’s docs, SCAN_FAILED_APPLICATION_REGISTRATION_FAILED -> This is commonly returned when something happened in bluetooth service that runs within your OS. The common solution for that is to restart bluetooth on your phone. You might either disable/enable it, or if that doesn’t help, you can reset wireless data settings:

Find and tap Settings > Network & Internet. Tap the menu button (three vertical dots) > Network settings reset > RESET SETTINGS.

  1. If your app is crashing due to an UndeliverableException you might want to update our SDK to version 0.3.1, where this should be fixed.

Kind regards,
Paweł

1 Like

Works like charm! Thanks!

1 Like