Hi,
We are developing a new project using the nRF52832 as our controller and nRF5 SDK 17.0.2 as our SDK.
We have integrated the NUS client and NUS peripheral parts from the ble_app_uart_c and ble_app_uart example projects. We've checked the functionality and it works well in the first stage. That is, the device can scan for nearby advertised devices based on the NUS service and connect to them. After the connection, the device acts as a peripheral and can connect with the nRF Connect app, sending and receiving data to and from the app through the connected device. Essentially, the device acts as a gateway between the app and connected peripherals.
Initially, there was no issue with the BLE connection. However, after disconnecting the nearby advertised peripherals, we are unable to connect to the two peripherals again. We can only connect to the same peripheral. What could be the issue?
Device (gateway acting as central and peripheral): NUS client and NUS peripheral integrated ble_app_hrs_rscs_relay example code flashed board . Connected peripheral: Modified NUS client and NUS peripheral integrated ble_app_hrs_rscs_relay example code flashed board , capable of capturing nearby beacon data and sending it to the connected gateway.
When we initially flash the code, we can connect the gateway to two nearby peripherals. However, when a peripheral disconnects, we can't connect to that two peripheral again.but we can connect only one same peripherl . The log output shows this:
SCAN START
12:13:07.819 -> <info> app: Connected to target F0C798AA5E92
12:13:07.819 -> <info> app: Central connected
12:13:07.819 -> <info> app: Attempt to find HRS, RSC, or NUS conn_handle 0x0
12:13:07.819 -> <info> app: NUS client assigned to conn_handle 0x0 (index: 0)
12:13:07.866 -> <info> app: nrf_ble_scan_start : 0
12:13:07.866 ->
12:13:07.866 -> <info> app: SCAN START
12:13:08.287 -> <info> app: ATT MTU exchange completed.
12:13:08.334 -> <info> app: Ble NUS max data length set to 0xF4(244)
12:13:08.334 -> <info> peer_manager_handler: Connection security failed: role: Central, conn_handle: 0x0, procedure: Bonding, error: 133
12:13:08.334 -> <warning> peer_manager_handler: Disconnecting conn_handle 0.
12:13:08.475 -> <error> nrf_ble_gq: SD GATT procedure (3) failed on connection handle 0 with error: 0x00000008.
12:13:08.475 -> <info> app: DB Discovery instance 0x2000477C available on conn handle: 0
12:13:08.522 -> <info> app: Found 1 services on conn_handle: 0
12:13:08.522 -> <info> app: current instance index 0
12:13:08.522 ->
12:13:08.522 -> <info> app: Disconnected from instance 0
12:13:08.522 -> <info> app: nrf_ble_scan_start : 0
12:13:08.522 ->
12:13:08.522 -> <info> app: SCAN START
12:13:08.522 -> <info> app: Device disconnected, conn_handle: 0x0, reason: 0x16
12:13:08.522 -> <info> app: nrf_ble_scan_start : 0
12:13:08.522 ->
12:13:08.522 -> <info> app: SCAN START
12:13:09.646 -> <info> app: Connected to target F0C798AA5E92
12:13:09.646 -> <info> app: Central connected
12:13:09.646 -> <info> app: Attempt to find HRS, RSC, or NUS conn_handle 0x0
12:13:09.646 -> <info> app: NUS client assigned to conn_handle 0x0 (index: 0)
12:13:09.646 -> <info> app: nrf_ble_scan_start : 0
12:13:09.646 ->
12:13:09.646 -> <info> app: SCAN START
12:13:10.256 -> <info> app: ATT MTU exchange completed.
12:13:10.303 -> <info> app: Ble NUS max data length set to 0xF4(244)
12:13:10.443 -> <info> peer_manager_handler: Connection security failed: role: Central, conn_handle: 0x0, procedure: Bonding, error: 133
12:13:10.490 -> <warning> peer_manager_handler: Disconnecting conn_handle 0.
12:13:10.678 -> <error> nrf_ble_gq: SD GATT procedure (3) failed on connection handle 0 with error: 0x00000008.
12:13:10.678 -> <info> app: DB Discovery instance 0x2000477C available on conn handle: 0
12:13:10.678 -> <info> app: Found 1 services on conn_handle: 0
12:13:10.678 -> <info> app: current instance index 0
12:13:10.678 ->
12:13:10.678 -> <info> app: Disconnected from instance 0
kindly Please provide your response as soon as possible. Your valuable input is urgently needed.