Static passkey - central and peripheral code issues (NCS connect)

Good morning everyone,

I am going crazy to solve this problem, but I hope we can figure it out with some help.

I am working on a prototype for which we need to use a static passkey (we know the security risks and that this is strongly discouraged, so please let's not focus on this point).

We are working with two nrf52833 boards and with NCS 2.3.0, and the code used as a starting point is the UART (for both roles).

On the peripheral side, I am able to correctly configure the board, so that when I try to connect with the NRF Connect app from my smartphone, the static passkey

is asked, and upon correct insertion of the password, the devices are bonded correctly.

I am unable to obtain the same behavior on the central.

The point where I am stuck is that apparently, after getting connected, the central invokes the bt_conn_set_security command, and I got the following error on the central

[00:00:04.986,694] .[1;31m<err> bt_smp: pairing failed (peer reason 0x8).[0m
[00:00:04.987,304] .[1;33m<wrn> ebrain_uart_bridge_central: Security failed: FA:51:0B:6F:06:18 (random) level 1 err 9.[0m
[00:00:04.987,701] .[1;33m<wrn> ebrain_uart_bridge_central: Pairing failed conn: FA:51:0B:6F:06:18 (random), reason 9.[0m

and at the same time on the peripheral I get the following error message

[00:00:09.587,799] .[1;33m<wrn> bt_smp: Unexpected SMP code 0x01.[0m

I defined in the prj.conf file the options

CONFIG_BT_SMP=y

CONFIG_BT_FIXED_PASSKEY=y

and I tried several combinations of the callbacks indicated in the forum, the last one being

static struct bt_conn_auth_cb conn_auth_callbacks = {
	.passkey_entry = passkey_entry,
	.cancel = auth_cancel,
};

static struct bt_conn_auth_info_cb conn_auth_info_callbacks = {
	.pairing_complete = pairing_complete,
	.pairing_failed = pairing_failed,
};

but I do not seem to find a solution....

Is anyone able to provide a complete example (especially for the central side) where a static passkey is succesfully transmitted from the central to the peripheral?

Thanks in advance for your help!

Lorenzo

Parents
  • Has anyone been able to fix this issue? I'm using a nRF52 PCA10040 as my central and I always get "Device found: EB:E1:BD:6F:9F:82 (random), RSSI: -56
    Found device name: SB-3100043
    Matching device found: EB:E1:BD:6F:9F:82 (random). Attempting to connect...
    Connection successfully created
    Connected
    Security level 3 requested (encrypted connection)
    [00:00:05.560,272] <err> bt_smp: pairing failed (peer reason 0x8)
    Security failed: EB:E1:BD:6F:9F:82 (random) level 1 err 9" Please help

Reply
  • Has anyone been able to fix this issue? I'm using a nRF52 PCA10040 as my central and I always get "Device found: EB:E1:BD:6F:9F:82 (random), RSSI: -56
    Found device name: SB-3100043
    Matching device found: EB:E1:BD:6F:9F:82 (random). Attempting to connect...
    Connection successfully created
    Connected
    Security level 3 requested (encrypted connection)
    [00:00:05.560,272] <err> bt_smp: pairing failed (peer reason 0x8)
    Security failed: EB:E1:BD:6F:9F:82 (random) level 1 err 9" Please help

Children
Related