Security failed level 1 err 9 connecting error with bonded device

Hi all!

I'm developing a BLE device implementing automation IO profile, peripheral role.

I can connect normally and discover all services and characteristics from nRF Connect android app, but after bonding, I never can connect again, I receive 

Security failed: 3C:CD:5D:3F:DC:50 (public) level 1 err 9
Disconnected (reason 61)

Am I missing something? Do I need to manually save bond information?

My code is the following:

Thanks!

Pedro.

  • Hi Pedro,

    Are you able to upload your project so I can try to reproduce the error on my end? The pairing fails because the link is encrypted/decrypted incorrectly, which is unusual error. The bonding information should be stored to flash automatically be the Zephyr host. 

    Best regards,

    Vidar

  • Hi Vidar,

    Attached to this post you can find the project. 

    Thanks for your help!

    ble-io-bridge-periph.zip

    Edit: I'm using ncs 2.0.2

  • Hi,

    I think the problem may be that all setting values, including the bond data, are reloaded again in get_adv_name(). Please try to replace the settings_load() call in this function with settings_load_subtree("app/ble_name"); and see if you get the same result.

  • Hi Vidar,

    Thanks for your answer. I've tried completely removing second call to settings api. Now it's a simple program that just show a single characteristic, but I still receive the same error when trying to connect, after the bonding is done. 

    Could you please test it to check if you receive the same error?

    Thanks!

    ble-io-bridge-periph-v2.zip

  • Hi Pedro,

    I've not been able to reproduce the error here. Please try my modified version of your project attached below and see if you get the same result.

    ble-io-bridge-periph-mod.zip

    Best regards,

    Vidar

    Edit: Forgot to remove the reduntant call to settings_load_subtree("app/ble_name") in attached code. It is not needed now as I moved the storage_init() function before settings_load(),

1 2 3 4 5 »