Bluetooth Low Energy Fundamentals Lesson 5 Exercise 2 does not work

Hi

I'm working on understanding how whitelist filtering is implemented and works in Bluetooth Low Energy. I'm currently following Exercise 2 in Lesson 5 of DevAcademy's Bluetooth Low Energy Fundamentals, but I can't get it to work - even using the solution provided by Nordic.

I've compiled and flashed the blefund_less5_exer2_solution to the nRF52-DK and I'm using the nRF Connect app on my phone for the scanning and GATT Client part. However, I can't connect. I have tried clearing the accept list and advertising in pairing mode, but the app returns a generic error: 133(0x85): GATT ERROR.

Here is also the output from the serial terminal:

Could someone test this to see if it’s just me experiencing this issue? Or, does anyone have suggestions for what I might be doing wrong?

 

Is there a sample code where a connected central initiates a pairing request?I currently have a central implementation of NUS (Nordic UART Service) and a peripheral implementation of NUS. My goal is to have the peripheral NUS whitelist only one specific central NUS and always pair with the same one, even if there are other central NUS devices nearby.

My understanding is that I need to pair the devices first in order to set up a filter accept list. When no longer needed, I could unpair the devices with bt_unpair() and clear the whitelist with bt_le_filter_accept_list_clear() and do a new advertisement with different parameters.

Is this correct?

SDK: v2.7.0-5cb85570ca43

Thanks in advance.


Parents
  • Is this correct?

    Yes, that sounds about right.

    When you try with your phone, can you please make sure that there is no old bonding information stored on the phone for the nRF? That means, go to your phone settings -> Bluetooth, and look for the device in "known devices" or something like that. Then click something like "Forget device". After that, to be sure that the whitelist is properly deleted from your peripheral, erase the device (either in command line, using "nrfjprog --eraseall", and re-program it, or use the nRF Connect for VS Code, and click the small icon next to "Flash":

    To make sure that no old bonding information is stored on the nRF either. Then try again, knowing that both devices shouldn't contain any bonding information.

    If you are still struggling to get it to work, please provide your current application, and/or a sniffer trace of the connection attempt (you can use the nRF Sniffer for Bluetooth LE), and I can have a look.

    Best regards,

    Edvin

  • Hi Edvin,

    When using the whitelist to filter connections, is it necessary to re-add the device to the whitelist every time after clearing bonding information, or should it automatically recognize the paired device if bonding is set up again?

    Incredibox Colorbox Mustard

  • I think you need to maintain this list yourself. This means adding a new device to the list when you bond, and clearing the list if you clear all bonding data, or removing one device from the list if you just delete the bonding information for that device specifically. 

    Best regards,

    Edvin

  • Hi

    Thanks for the update. This issue is a bit frustrating - I'm not sure if the problem is with the nRF Connect app or if something is wrong with the BLE peripheral. ( I tried to erase the whole flash with "erase all and flash" and it did not help.)

    On the first run, everything works as expected: connecting, whitelisting and bonding all work fine. However, when I try to delete everything (bonding and whitelisting) on both the phone and the peripheral, I can no longer connect. To make it work again, I have to 'force stop' the app on Android and then re-open it; only then can I connect, whitelist and bond again.

    I’ve repeated this process a few times and encountered the same outcome each time.

    Could anyone else try to reproduce this issue? I’m hopeful this can be resolved in a future update.

    Thanks again!

  • J0sh1101 said:
    I have to 'force stop' the app on Android and then re-open it; only then can I connect, whitelist and bond again.

    What app is that? The nRF Connect for Android? 

    Can you please upload the peripheral application that you are testing on? This will make it a lot faster for me to reproduce.

    Best regards,

    Edvin

  • Hi,

    What app is that? The nRF Connect for Android? 

    Yes, the app is the nRF Connect for Android. 

    Can you please upload the peripheral application that you are testing on? This will make it a lot faster for me to reproduce.

    I used the code from the Nordic Academy. Here is the code.


    Kind regards

Reply Children
Related