melta101
melta101
DIIDevHeads IoT Integration Server
Created by melta101 on 8/29/2024 in #middleware-and-os
Bluetooth Device Stops Advertising After Pairing Failures in Zephyr RTOS
Hello everyone, I have a situation where the device tries to auto connect and then stops advertising.
*** Booting Zephyr OS build v3.7.0-rc1-106-g012520d2d7e8 ***
[00:00:00.327,148] <inf> fs_nvs: 4 Sectors of 4096 bytes
[00:00:00.327,178] <inf> fs_nvs: alloc wra: 0, d18
[00:00:00.327,178] <inf> fs_nvs: data wra: 0, 430
[00:00:00.328,582] <inf> bt_hci_core: HW Platform: Nordic Semiconductor (0x0002)
[00:00:00.328,613] <inf> bt_hci_core: HW Variant: nRF52x (0x0002)
[00:00:00.328,643] <inf> bt_hci_core: Firmware: Standard Bluetooth controller (0x00) Version 3.7 Build 0
[00:00:00.328,918] <inf> bt_hci_core: No ID address. App must call settings_load()
Bluetooth initialized
[00:00:00.330,993] <inf> bt_hci_core: Identity: D5:ED:9A:B3:35:2F (random)
[00:00:00.331,024] <inf> bt_hci_core: HCI: version 5.4 (0x0d) revision 0x0000, manufacturer 0x05f1
[00:00:00.331,054] <inf> bt_hci_core: LMP: version 5.4 (0x0d) subver 0xffff
Advertising successfully started
Bluetooth authentication callbacks registered.
Connected C8:E2:65:D4:FA:57 (public)
[00:00:00.672,821] <err> bt_smp: pairing failed (peer reason 0x5)
Security failed: C8:E2:65:D4:FA:57 (public) level 1 err 5
[00:00:00.852,386] <err> bt_smp: pairing failed (peer reason 0x3)
Security failed: C8:E2:65:D4:FA:57 (public) level 1 err 4
*** Booting Zephyr OS build v3.7.0-rc1-106-g012520d2d7e8 ***
[00:00:00.327,148] <inf> fs_nvs: 4 Sectors of 4096 bytes
[00:00:00.327,178] <inf> fs_nvs: alloc wra: 0, d18
[00:00:00.327,178] <inf> fs_nvs: data wra: 0, 430
[00:00:00.328,582] <inf> bt_hci_core: HW Platform: Nordic Semiconductor (0x0002)
[00:00:00.328,613] <inf> bt_hci_core: HW Variant: nRF52x (0x0002)
[00:00:00.328,643] <inf> bt_hci_core: Firmware: Standard Bluetooth controller (0x00) Version 3.7 Build 0
[00:00:00.328,918] <inf> bt_hci_core: No ID address. App must call settings_load()
Bluetooth initialized
[00:00:00.330,993] <inf> bt_hci_core: Identity: D5:ED:9A:B3:35:2F (random)
[00:00:00.331,024] <inf> bt_hci_core: HCI: version 5.4 (0x0d) revision 0x0000, manufacturer 0x05f1
[00:00:00.331,054] <inf> bt_hci_core: LMP: version 5.4 (0x0d) subver 0xffff
Advertising successfully started
Bluetooth authentication callbacks registered.
Connected C8:E2:65:D4:FA:57 (public)
[00:00:00.672,821] <err> bt_smp: pairing failed (peer reason 0x5)
Security failed: C8:E2:65:D4:FA:57 (public) level 1 err 5
[00:00:00.852,386] <err> bt_smp: pairing failed (peer reason 0x3)
Security failed: C8:E2:65:D4:FA:57 (public) level 1 err 4
the functionality is of HoG Mouse sample with a few changes mainly changing to bt_le_adv_start(BT_LE_ADV_CONN, ad, ARRAY_SIZE(ad), sd, ARRAY_SIZE(sd)); my proj.conf is
CONFIG_BT=y
CONFIG_LOG=y
CONFIG_BT_SMP=y
CONFIG_BT_PERIPHERAL=y
CONFIG_BT_DIS=y
CONFIG_BT_BAS=y
CONFIG_BT_DEVICE_APPEARANCE=962
CONFIG_SAMPLE_BT_USE_AUTHENTICATION=y
CONFIG_BT_SETTINGS=y
CONFIG_BT_KEYS_OVERWRITE_OLDEST=y
CONFIG_FLASH=y
CONFIG_FLASH_MAP=y
CONFIG_NVS=y
CONFIG_SETTINGS=y

CONFIG_CONSOLE_SUBSYS=y
CONFIG_CONSOLE_GETLINE=y
CONFIG_BT=y
CONFIG_LOG=y
CONFIG_BT_SMP=y
CONFIG_BT_PERIPHERAL=y
CONFIG_BT_DIS=y
CONFIG_BT_BAS=y
CONFIG_BT_DEVICE_APPEARANCE=962
CONFIG_SAMPLE_BT_USE_AUTHENTICATION=y
CONFIG_BT_SETTINGS=y
CONFIG_BT_KEYS_OVERWRITE_OLDEST=y
CONFIG_FLASH=y
CONFIG_FLASH_MAP=y
CONFIG_NVS=y
CONFIG_SETTINGS=y

CONFIG_CONSOLE_SUBSYS=y
CONFIG_CONSOLE_GETLINE=y
23 replies