This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

How to Find Nordic Beacon Using BLE onLeScan() for Android

I'm an Android developer and I bought the NRF51822-Beacon kit. All I want to do is be able to "see" the beacon using Android's onLeScan() bluetooth call. However, the beacon doesn't register at all. I can see other BLE devices, but not the Nordic beacon. I have the battery installed and the purple light is flashing which should mean it's beaconing. I don't want to use the Nordic app to "see" the beacon---the whole point is to be able to do it in a generic Android app. Do you know why I can't see the beacon? Is it even possible?

Parents
  • Hi RaQ,

    The startLeScan() method from BluetoothAdapter should work for any BLE device, including nordic beacons. If you see the beacon in nRF Beacon app, nRF Master Control Panel or any other app that scans for Bluetooth Smart devices - they use the same API. I would also recommend you to use our compat library for scanning: github.com/.../Android-Scanner-Compat-Library. With t you'll have some more settings and filtering options. The scanning API on Android has changed in 5.0 and this library gives the new functionality to older platforms. but even if you use the bluetoothAdapter.startLeScan(callback) method it should work. Make sure you update your GUI in the UI thread, not in the callback thread.

    Could you post you code here?

  • Your code is very good should work. So I guess the problem is with a beacon. Give your app some more time to find it. By default the nordic beacon advertises every 760ms which is quite rare. This makes it hard to be found. You may also press the SW2 button on the beacon (this will start the Config Mode with different adv interval) or SW1 - enables the DFU mode. In the DFU mode the beacon advertises very often so your app should easily find it.

    You may also change the setting of the beacon and make it advertise more often. Press the SW2 button (it it's in DFU mode you need to take the battery out and in again and press SW2), connect to it using nRF Beacon app (the UPDATE tab) and change the advertising interval to 100ms. I would also recommend to disable the LED as it drains the most of the battery. After that you can check if your app can find it.

Reply
  • Your code is very good should work. So I guess the problem is with a beacon. Give your app some more time to find it. By default the nordic beacon advertises every 760ms which is quite rare. This makes it hard to be found. You may also press the SW2 button on the beacon (this will start the Config Mode with different adv interval) or SW1 - enables the DFU mode. In the DFU mode the beacon advertises very often so your app should easily find it.

    You may also change the setting of the beacon and make it advertise more often. Press the SW2 button (it it's in DFU mode you need to take the battery out and in again and press SW2), connect to it using nRF Beacon app (the UPDATE tab) and change the advertising interval to 100ms. I would also recommend to disable the LED as it drains the most of the battery. After that you can check if your app can find it.

Children
No Data
Related