NCS 2.2.0 - Connect two nRF52840-DKs paired with level 3 security using fixed key.

Hello, 

I created a BLE Peripheral (ble_custom_auth) that has a custom service. I also create a BLE Central (scan_adv) that scans for that service UUID in devices, once found connects and should pair level 3 using a fixed password.

I validated both sides versus the nRF Connect for Bluetooth Low Energy Standalone v4.0.4, as follows:

1) Validating the BLE Peripheral - nRF52840-DK Peripheral - BLE Standalone Central

1.1) Run app and start advertising. Using nRF Connect BLE Standalone, scan for the device, connect and ask to pair using the fixed 123456 password:

*** Booting Zephyr OS build v3.2.99-ncs1 ***
[00:00:00.004,180] <inf> app: main: Starting Hello Bluetooth
[00:00:00.004,455] <inf> sdc_hci_driver: hci_driver_open: SoftDevice Controller build revision:
                                         6d 90 41 2a 38 e8 ad 17  29 a5 03 38 39 27 d7 85 |m.A*8... )..89'..
                                         1f 85 d8 e1                                      |....
[00:00:00.006,896] <inf> bt_hci_core: hci_vs_init: HW Platform: Nordic Semiconductor (0x0002)
[00:00:00.006,927] <inf> bt_hci_core: hci_vs_init: HW Variant: nRF52x (0x0002)
[00:00:00.006,958] <inf> bt_hci_core: hci_vs_init: Firmware: Standard Bluetooth controller (0x00) Version 109.16784 Build 2917677098
[00:00:00.007,965] <inf> bt_hci_core: bt_dev_show_info: Identity: F9:FC:08:12:08:72 (random)
[00:00:00.007,995] <inf> bt_hci_core: bt_dev_show_info: HCI: version 5.3 (0x0c) revision 0x11fa, manufacturer 0x0059
[00:00:00.008,026] <inf> bt_hci_core: bt_dev_show_info: LMP: version 5.3 (0x0c) subver 0x11fa
[00:00:00.008,056] <inf> app: main: Bluetooth initialized
[00:00:00.008,880] <inf> app: main: Advertising successfully started
[00:01:18.554,290] <inf> app: connected: Connected
[00:01:24.879,211] <inf> app: auth_passkey_display: Passkey for CD:40:25:0F:69:68 (random): 123456
[00:01:24.879,425] <inf> app: pairing_confirm: Pairing confirmed: CD:40:25:0F:69:68 (random)
[00:01:28.898,468] <inf> app: pairing_complete: Pairing completed: CD:40:25:0F:69:68 (random), bonded: 0
[00:01:28.898,681] <wrn> app: security_changed: Security changed: CD:40:25:0F:69:68 (random) level 3

Notice that it works, as I get security changed to level 3.

2) Validating the BLE Central - BLE Standalone Peripheral -  nRF52840-DK Central 

2.2 Create a SERVER SETUP in the BLE Standalone software with the same service UUID in the DK peripheral and set the same 123456 password. Advertise and let the DK central scan for it and try to connect and pair.

*** Booting Zephyr OS build v3.2.99-ncs1 ***
[00:00:00.004,241] <inf> sdc_hci_driver: hci_driver_open: SoftDevice Controller build revision:
                                         6d 90 41 2a 38 e8 ad 17  29 a5 03 38 39 27 d7 85 |m.A*8... )..89'..
                                         1f 85 d8 e1                                      |....
[00:00:00.006,652] <inf> bt_hci_core: hci_vs_init: HW Platform: Nordic Semiconductor (0x0002)
[00:00:00.006,713] <inf> bt_hci_core: hci_vs_init: HW Variant: nRF52x (0x0002)
[00:00:00.006,744] <inf> bt_hci_core: hci_vs_init: Firmware: Standard Bluetooth controller (0x00) Version 109.16784 Build 2917677098
[00:00:00.007,781] <inf> bt_hci_core: bt_dev_show_info: Identity: E9:1E:67:7E:39:E7 (random)
[00:00:00.007,812] <inf> bt_hci_core: bt_dev_show_info: HCI: version 5.3 (0x0c) revision 0x11fa, manufacturer 0x0059
[00:00:00.007,843] <inf> bt_hci_core: bt_dev_show_info: LMP: version 5.3 (0x0c) subver 0x11fa
[00:00:00.007,843] <inf> ble_scanner: main: Bluetooth initialized
[00:00:00.007,873] <inf> ble_scanner: scan_init: Scan module initialized
[00:00:00.008,483] <inf> ble_scanner: start_scan: Scanning successfully started
[00:00:06.330,047] <inf> ble_scanner: scan_filter_match: Filters matched. Address: CD:40:25:0F:69:68 (random) connectable: 1
[00:00:44.996,490] <inf> ble_scanner: connected: Connected: CD:40:25:0F:69:68 (random)
[00:00:51.097,961] <inf> ble_scanner: pairing_complete: Pairing completed: CD:40:25:0F:69:68 (random), bonded: 0
[00:00:51.098,175] <inf> ble_scanner: security_changed: Security changed: CD:40:25:0F:69:68 (random) level 3

Notice that this also pair at level 3.

3) Running both BLE Peripheral and BLE Central in the DKs:

Notice that, in this case, even running the same firmware as the tests above, there is a SMP timeout error and the boards wont pair.

BLE Peripheral:

*** Booting Zephyr OS build v3.2.99-ncs1 ***
[00:00:00.004,180] <inf> app: main: Starting Hello Bluetooth
[00:00:00.004,455] <inf> sdc_hci_driver: hci_driver_open: SoftDevice Controller build revision:
                                         6d 90 41 2a 38 e8 ad 17  29 a5 03 38 39 27 d7 85 |m.A*8... )..89'..
                                         1f 85 d8 e1                                      |....
[00:00:00.006,896] <inf> bt_hci_core: hci_vs_init: HW Platform: Nordic Semiconductor (0x0002)
[00:00:00.006,927] <inf> bt_hci_core: hci_vs_init: HW Variant: nRF52x (0x0002)
[00:00:00.006,958] <inf> bt_hci_core: hci_vs_init: Firmware: Standard Bluetooth controller (0x00) Version 109.16784 Build 2917677098
[00:00:00.007,965] <inf> bt_hci_core: bt_dev_show_info: Identity: F9:FC:08:12:08:72 (random)
[00:00:00.007,995] <inf> bt_hci_core: bt_dev_show_info: HCI: version 5.3 (0x0c) revision 0x11fa, manufacturer 0x0059
[00:00:00.008,026] <inf> bt_hci_core: bt_dev_show_info: LMP: version 5.3 (0x0c) subver 0x11fa
[00:00:00.008,056] <inf> app: main: Bluetooth initialized
[00:00:00.008,880] <inf> app: main: Advertising successfully started
[00:00:00.339,050] <inf> app: connected: Connected
[00:00:00.491,027] <inf> app: pairing_confirm: Pairing confirmed: E9:1E:67:7E:39:E7 (random)
[00:00:00.740,661] <inf> app: auth_passkey_display: Passkey for E9:1E:67:7E:39:E7 (random): 123456
[00:00:30.740,539] <err> bt_smp: smp_timeout: SMP Timeout
[00:00:30.740,753] <err> app: security_changed: Security failed: E9:1E:67:7E:39:E7 (random) level 1 err 9
[00:00:30.740,936] <inf> app: pairing_failed: Pairing failed conn: E9:1E:67:7E:39:E7 (random), reason 9

BLE Central:

*** Booting Zephyr OS build v3.2.99-ncs1 ***
[00:00:00.004,241] <inf> sdc_hci_driver: hci_driver_open: SoftDevice Controller build revision:
6d 90 41 2a 38 e8 ad 17 29 a5 03 38 39 27 d7 85 |m.A*8... )..89'..
1f 85 d8 e1 |....
[00:00:00.006,683] <inf> bt_hci_core: hci_vs_init: HW Platform: Nordic Semiconductor (0x0002)
[00:00:00.006,713] <inf> bt_hci_core: hci_vs_init: HW Variant: nRF52x (0x0002)
[00:00:00.006,744] <inf> bt_hci_core: hci_vs_init: Firmware: Standard Bluetooth controller (0x00) Version 109.16784 Build 2917677098
[00:00:00.007,781] <inf> bt_hci_core: bt_dev_show_info: Identity: E9:1E:67:7E:39:E7 (random)
[00:00:00.007,843] <inf> bt_hci_core: bt_dev_show_info: HCI: version 5.3 (0x0c) revision 0x11fa, manufacturer 0x0059
[00:00:00.007,873] <inf> bt_hci_core: bt_dev_show_info: LMP: version 5.3 (0x0c) subver 0x11fa
[00:00:00.007,873] <inf> ble_scanner: main: Bluetooth initialized
[00:00:00.007,904] <inf> ble_scanner: scan_init: Scan module initialized
[00:00:00.008,514] <inf> ble_scanner: start_scan: Scanning successfully started
[00:00:00.690,155] <inf> ble_scanner: scan_filter_match: Filters matched. Address: F9:FC:08:12:08:72 (random) connectable: 0
[00:00:00.801,269] <inf> ble_scanner: connected: Connected: F9:FC:08:12:08:72 (random)
[00:00:01.254,241] <inf> ble_scanner: passkey_entry: Passkey entry request for F9:FC:08:12:08:72 (random)
[00:00:31.002,807] <err> bt_smp: smp_timeout: SMP Timeout
[00:00:31.003,021] <wrn> ble_scanner: security_changed: Security failed: F9:FC:08:12:08:72 (random) level 1 err 9
[00:00:31.003,204] <err> ble_scanner: pairing_failed: Pairing failed conn: F9:FC:08:12:08:72 (random), reason 9

Questions:

How can I further debug this to understand why when running DK vs DK I get this SMP error? Both fixed passwords are set the same (123456), as validated on tests 1 and 2 above.

How can I check if the Peripheral DK is receiving the right password from the Central DK?

Please see codes in this file:

pair_level3_error_840dk.zip

Related