Pairing works only on some android phones

Hi,

I am modifying the peripheral_uart code to set a fixed pairing method so that I will have to enter a pre-defined passkey in my nrf connect application on my android. It works fine with my android. So I assume my callbacks and workflows are all fine. However, when I try to pair from some other phones, it does not work anymore. I am not even prompted for a passkey in other phone. In some phones, pairing fails with an error message on central (android) side with message 'Couldn't pair with Nordic_UART_Service. Make sure that it's ready to pair' . After this, every attempt to pairing fails without any messages. For some other phones, we do not even see a message. The central says 'Bonding..' and then says 'Not bonded'.

The logs in the peripheral side does not say much either.

I cannot use Just Works or fixed passkey for pairing here. I am using NCS V2.1.0 and nrf52832DK

have anyone faced this kind of problem ? Any help would be appreciated. Thank you

Parents
  • Hello,

    Midhunjac said:
    Just so we are clear, nrfjprog --eraseall erases the flash. Am I right ?

    Yes that's true.

    I pointed to the peripheral_bms sample for showing how the erasing works from the Application. You are not able to connect to another phone using the peripheral_uart sample because it is restricted with 1 connection and bonding by defining the  CONFIG_BT_MAX_CONN=1 and  CONFIG_BT_MAX_PAIRED=1 in the configuration file. You can change this and give a try, but I also need to check the main source file whether anything is restricted there.

    Take look at the bt_unpair function which can be used to delete the bond/pairing  information without erasing the board. 

    Kind Regards,

    Abhijith

  • Hi,

    bt_unpair did the trick. Called it in the disconnect callback. This is the new disconnect callback in peripheral_uart example.

    Hope this helps anyone facing a similar issue. If this is to be done, why is this not included in the sample build ?

    Anyway, thank you for your assistance Abhijith.

Reply Children
No Data
Related