This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

a little timeout between closing and new connection

Hi

We use nrf52832 as central.

Phone is connected to it as peripheral.

If phone has disconnected and is connecting after that, connection is not established.

If time between disconnecting and new connecting is more (If go out for some time or switch off bluetooth on phone for some time) - connection will be established successfuly.

Connected has closed by reason 0x08

<info> app: Scanning start
<info> app: BLE_GAP_EVT_ADV_REPORT peer_id=0x0
<info> app: Start_connection for Bonded peer
<info> app: scan_evt_handler id = 6
<info> app: Connecting to target 0x4212F3DE9B61
<info> peer_manager_handler: Peer data updated in flash: peer_id: 0, data_id: Peer rank, action: Update, no chan
<info> app: Scanning start
<info> app: BLE_GAP_EVT_DISCONNECTED: 0 , reason=0x8
<info> app: Scanning start


It has happen periodically.

Sometimes other reasons are occured.

#define BLE_HCI_LOCAL_HOST_TERMINATED_CONNECTION 0x16 /**< Local Host Terminated Connection. */

#define BLE_HCI_STATUS_CODE_LMP_RESPONSE_TIMEOUT 0x22 /**< LMP Response Timeout. */

It seems to me that some timeout settings have effect.

Please advice which settings could be changed to solve this issue.

Thanks

Parents
  • Hi,

    The following information will be helpful:

    Which SDK and Softdevice version are you using?

    Are you using a DK or a custom board?

    Which example are you running? Have you done any modifications to the example?

    Which Phone are you using?

    Which App are you using to connect the phone as peripheral? Are you using our nRF Connect app?

  • Hi

    NRF52832 is used as central for connecting with phones as peripheral.
    NUS service is used. Lesc is used too.

    SDK 17.0.0
    SoftDevice S132 V7.0.1

    Board is our.

    Application for phone is our.

    It seems to me now that problem is in our application for phone.

    Because restarting of central doesn't help.
    Removal of phone doesn't help too (In previous message i was wrong)

    Connect established after off/on bluetooth on phone only.


    I'll try look in the application now.

    Sorry for worry.

    Thanks

  • Hi.

    Issue is actual still.

    I try to understand it.


    It has following view:
    Device as central works with phone as peripheral. (Details about sdk and family of chip are in previous post)
    Working is stable. It can be many hours so.
    Disconnections and reconnections are working fine.
    But if I use system in the car, Issue is showed in few minutes.

    Connection is dismounting.
    Central make new attempt to connect at once. (I tried to pause there. It doesn't help.)
    But connections are failed every time.

    Restarting of central device doesn't help.
    Restarting of phone application doesn't help too.

    New good connection is available after re switching Bluetooth on phone only.


    Logs on device side and phone side:

    phone side:

    2020-12-18 17:25:56.476 24509-24527/com.microline.ble D/BluetoothGattServer: onServerConnectionState() - status=0 serverIf=7 device=F6:F0:90:BB:E4:9F
    2020-12-18 17:25:56.479 21409-21450/? D/IOP_DB_BT: db_query_execute: result 1
    2020-12-18 17:25:56.479 21409-21450/? D/IOP_DB_BT: db_query_create: id Downloadable_BleSCBlackList :: key KEY_BDADDR
    2020-12-18 17:25:56.479 21409-21450/? D/IOP_DB_BT: db_query_add_key: key KEY_NAME
    2020-12-18 17:25:56.480 21409-21433/? E/bt_btif: btif_dm_upstreams_evt: ev: BTA_DM_LINK_UP_EVT
    2020-12-18 17:25:56.480 21409-21433/? W/bt_btif: BTA_DM_LINK_UP_EVT. Sending BT_ACL_STATE_CONNECTED
    2020-12-18 17:25:56.482 21409-21450/? D/IOP_DB_BT: db_query_execute: result 1
    2020-12-18 17:25:56.482 21409-21450/? D/IOP_DB_BT: db_query_create: id Downloadable_BleSCBlackList :: key KEY_BDADDR
    2020-12-18 17:25:56.482 21409-21450/? D/IOP_DB_BT: db_query_add_key: key KEY_NAME
    2020-12-18 17:25:56.482 21409-21433/? E/BluetoothRemoteDevices: aclStateChangeCallback: State:Connected to Device:F6F090, linktype is 2
    2020-12-18 17:25:56.485 21409-21450/? D/IOP_DB_BT: db_query_execute: result 1
    2020-12-18 17:25:56.485 21409-21450/? W/bt_smp: lmp_version_below LMP version 10 < 8
    2020-12-18 17:25:56.485 21409-21450/? W/bt_smp: set auth_req: 0x2d, local_i_key: 0x0f, local_r_key: 0x0f
    2020-12-18 17:25:56.486 21409-21450/? D/IOP_DB_BT: db_query_create: id Downloadable_BleCIBlackList :: key KEY_BDADDR
    2020-12-18 17:25:56.486 21409-21450/? D/IOP_DB_BT: db_query_add_key: key KEY_NAME
    2020-12-18 17:25:56.488 24509-24527/com.microline.ble E/BIBA: createNotification Устройство подключилось
    2020-12-18 17:25:56.489 21409-21450/? D/IOP_DB_BT: db_query_execute: result 1
    2020-12-18 17:25:56.489 21409-21450/? D/IOP_DB_BT: db_query_create: id Downloadable_BleCIBlackList :: key KEY_BDADDR
    2020-12-18 17:25:56.489 21409-21450/? D/IOP_DB_BT: db_query_add_key: key KEY_NAME
    2020-12-18 17:25:56.492 21409-21450/? D/IOP_DB_BT: db_query_execute: result 1
    2020-12-18 17:25:56.493 21409-21450/? D/IOP_DB_BT: db_query_create: id Downloadable_BleCIBlackList :: key KEY_BDADDR
    2020-12-18 17:25:56.493 21409-21450/? D/IOP_DB_BT: db_query_add_key: key KEY_NAME
    2020-12-18 17:25:56.494 21409-21450/? D/IOP_DB_BT: db_query_execute: result 1
    2020-12-18 17:25:56.497 24509-24527/com.microline.ble E/BIBA: updateNotification
    2020-12-18 17:25:56.500 24509-24527/com.microline.ble D/Notification: allPendingIntents
    2020-12-18 17:25:56.501 3486-3501/? W/BroadcastQueue: Permission Denial: receiving Intent { act=android.bluetooth.device.action.ACL_CONNECTED flg=0x5000010 (has extras) } to ProcessRecord{8278327 4896:com.samsung.android.providers.context/u0a11} (pid=4896, uid=10011) requires android.permission.BLUETOOTH_ADMIN due to sender com.android.bluetooth (uid 1002)
    2020-12-18 17:25:56.504 13230-13230/? D/BeaconManager[8.0.28.0]: AppControlManager.onReceive - ($)
    2020-12-18 17:25:56.508 21409-21433/? D/BluetoothUtils: getBtEnabledContainers(): btContainers = []
    2020-12-18 17:25:56.509 21409-21433/? E/bt_btif: btif_dm_upstreams_evt: ev: BTA_DM_BUSY_LEVEL_EVT
    2020-12-18 17:25:56.509 21409-21433/? W/bt_btif: BTA_DM_BUSY_LEVEL_EVT :: p_data->busy_level.level_flags : 0x0
    2020-12-18 17:25:56.512 24509-24527/com.microline.ble D/BluetoothManager: getConnectedDevices
    2020-12-18 17:25:56.512 3486-3501/? D/ApplicationPolicy: isStatusBarNotificationAllowedAsUser: packageName = com.microline.ble,userId = 0
    2020-12-18 17:25:56.513 3486-3501/? D/API test: getContainerInfo: value is 
    2020-12-18 17:25:56.524 4315-4315/? I/TrustAgent: TAG: TrustAgent.Tracker. [BluetoothConnectionTracker] Bluetooth connect broadast for ZONT_App F6:F0:90:BB:E4:9F [CONTEXT service_id=84 ]
    2020-12-18 17:25:56.525 25213-25353/? D/RunestoneLogGenerator: generate Connection
    2020-12-18 17:25:56.525 24509-24527/com.microline.ble E/Background: [C2:C0:CB:12:41:BA, F6:F0:90:BB:E4:9F]
    2020-12-18 17:25:56.526 24509-1348/com.microline.ble D/BluetoothGattServer: onMtuChanged() - device=F6:F0:90:BB:E4:9F, mtu=100
    2020-12-18 17:25:56.555 21409-21450/? E/bt_btm: btm_ble_read_remote_features_complete: failed for handle: 0x1857, status 0x1a
    2020-12-18 17:25:56.556 21409-21448/? W/bt_hci: filter_incoming_event command complete event with no matching command (opcode: 0x2022).
    2020-12-18 17:25:56.570 14747-14774/? I/BistoWorker: bluetoothConnectionStateChanged. Action: android.bluetooth.device.action.ACL_CONNECTED
    2020-12-18 17:25:56.570 3486-4255/? D/SamsungAlarmManager: setInexact Intent (T:3/F:0/AC:false) 20301216T172556 - CU:10028/CP:28418
    2020-12-18 17:25:56.585 3486-8876/? D/SamsungAlarmManager: setInexact Intent (T:3/F:0/AC:false) 20301216T172556 - CU:10028/CP:4315
    2020-12-18 17:25:56.590 14747-14774/? I/DeviceDetector: shouldReduceSdpRequests; does not have bistoUuid
    2020-12-18 17:25:56.590 14747-14774/? I/WorkerManager: Releasing worker: [bisto]/[45]/[com.google.android.apps.gsa.staticplugins.bisto.ad.s]
    2020-12-18 17:25:56.591 14747-14774/? I/WorkerManager: Releasing worker: [bisto]/[45]/[com.google.android.apps.gsa.staticplugins.bisto.ad.s]
    2020-12-18 17:25:56.595 4315-4315/? I/NearbyDiscovery: onAclChange: state=CONNECTED, device=F6:F0:90:BB:E4:9F [CONTEXT service_id=49 ]
    2020-12-18 17:25:56.600 4315-28872/? I/NearbyDiscovery: FastPairBattery: No associated accountKey is found when query battery info, address:F6:F0:90:BB:E4:9F [CONTEXT service_id=49 ]
    2020-12-18 17:25:56.609 3486-8876/? W/BroadcastQueue: Permission Denial: receiving Intent { act=android.bluetooth.device.action.ACL_CONNECTED flg=0x5000010 (has extras) } to com.fbreader/org.fbreader.tts.BluetoothConnectReceiver requires android.permission.BLUETOOTH_ADMIN due to sender com.android.bluetooth (uid 1002)
    2020-12-18 17:25:56.643 24509-24509/com.microline.ble D/SystemWebChromeClient: file:///android_asset/www/webpack/main.js: Line 109271 : EntryPoint connectionResolver {"address":"F6:F0:90:BB:E4:9F","name":"ZONT_App","status":"connected"}
    2020-12-18 17:25:56.643 24509-24509/com.microline.ble I/chromium: [INFO:CONSOLE(109271)] "EntryPoint connectionResolver {"address":"F6:F0:90:BB:E4:9F","name":"ZONT_App","status":"connected"}", source: file:///android_asset/www/webpack/main.js (109271)
    2020-12-18 17:25:56.644 24509-24509/com.microline.ble D/SystemWebChromeClient: file:///android_asset/www/webpack/main.js: Line 110204 : EntryPoint Время:  Fri Dec 18 2020 17:25:56 GMT+0300 (Москва, стандартное время) 
        state:  [object Object]
    2020-12-18 17:25:56.645 24509-24509/com.microline.ble I/chromium: [INFO:CONSOLE(110204)] "EntryPoint Время:  Fri Dec 18 2020 17:25:56 GMT+0300 (Москва, стандартное время) 
        state:  [object Object]", source: file:///android_asset/www/webpack/main.js (110204)
    2020-12-18 17:25:56.645 21409-21448/? W/bt_hci: filter_incoming_event command status event with no matching command. opcode: 0x0000
    2020-12-18 17:25:56.675 21409-21450/? E/bt_btm: key size = 0
    2020-12-18 17:25:56.691 3486-3501/? D/ApplicationPolicy: isStatusBarNotificationAllowedAsUser: packageName = com.microline.ble,userId = 0
    2020-12-18 17:25:56.691 3486-3501/? D/API test: getContainerInfo: value is 
    2020-12-18 17:25:56.779 3486-9467/? D/Notification: allPendingIntents
    2020-12-18 17:25:56.780 3486-9467/? D/Notification: allPendingIntents
    2020-12-18 17:25:56.780 3486-3497/? D/Notification: allPendingIntents
    2020-12-18 17:25:56.780 3486-8876/? D/Notification: allPendingIntents
    2020-12-18 17:25:56.825 3926-3926/? D/KeyguardUpdateMonitor: handleStatusBarState( false )
    2020-12-18 17:25:56.832 3486-3561/? D/SensorService: [SO] -1.259 9.704 0.249
    2020-12-18 17:25:56.847 3486-3497/? D/AODManagerService: updateNotificationKeysInternal() return : same [6] 
    2020-12-18 17:25:56.856 21409-21433/? W/bt_btif: btif_dm_generic_evt: event=33037
    2020-12-18 17:25:56.856 21409-21450/? W/bt_btif: bta_gattc_conn_cback() - cif=3 connected=0 conn_id=259 reason=0x0013
    2020-12-18 17:25:56.856 21409-21450/? W/bt_btif: bta_gattc_conn_cback() - cif=4 connected=0 conn_id=260 reason=0x0013
    2020-12-18 17:25:56.856 21409-21450/? W/bt_btif: bta_gattc_conn_cback() - cif=5 connected=0 conn_id=261 reason=0x0013
    2020-12-18 17:25:56.856 21409-21450/? W/bt_btif: bta_gattc_conn_cback() - cif=6 connected=0 conn_id=262 reason=0x0013
    2020-12-18 17:25:56.856 21409-21450/? W/bt_btif: bta_gattc_conn_cback() - cif=8 connected=0 conn_id=264 reason=0x0013
    2020-12-18 17:25:56.856 21409-21450/? W/bt_btif: bta_gattc_conn_cback() - cif=10 connected=0 conn_id=266 reason=0x0013
    2020-12-18 17:25:56.857 21409-21450/? W/bt_l2cap: L2CA_RemoveFixedChnl()  CID: 0x0006  BDA: f6f090bbe49f not connected
    2020-12-18 17:25:56.857 21409-21450/? W/bt_btif: btif_gatt_set_encryption_cb() - Encryption failed (1)
    2020-12-18 17:25:56.857 21409-21450/? E/bt_btm: btm_acl_removed:1:
    2020-12-18 17:25:56.857 21409-21450/? E/bt_btm: No such connected client, bd_addr:f6-f0-90-bb-e4-9f
    2020-12-18 17:25:56.857 21409-21450/? W/bt_btm: btm_sec_disconnected
    2020-12-18 17:25:56.857 21409-21450/? E/bt_btif: Ignore unknown conn ID: 259
    2020-12-18 17:25:56.857 21409-21450/? E/bt_btif: Ignore unknown conn ID: 260
    2020-12-18 17:25:56.857 21409-21450/? E/bt_btif: Ignore unknown conn ID: 261
    2020-12-18 17:25:56.857 21409-21450/? E/bt_btif: Ignore unknown conn ID: 262
    2020-12-18 17:25:56.857 21409-21450/? E/bt_btif: Ignore unknown conn ID: 264
    2020-12-18 17:25:56.857 21409-21450/? E/bt_btif: Ignore unknown conn ID: 266
    2020-12-18 17:25:56.857 21409-21450/? W/bt_btm: BTM_SecDeleteDevice :: pending_delete : 0
    2020-12-18 17:25:56.857 21409-21450/? W/bt_btm: btm_ble_disable_resolving_list() rl_state = 0x1a, rl_mask = 0x1a, to_resume = 0
    2020-12-18 17:25:56.857 21409-21450/? W/bt_stack: [WARNING:btm_ble_multi_adv.cc(985)] Suspend() Suspend inst_id = 1
    2020-12-18 17:25:56.858 21409-21450/? W/bt_stack: [WARNING:ble_advertiser_hci_interface.cc(233)] [HCI] multi adv enable cmd : enable = 0, handle = 1
    2020-12-18 17:25:56.858 21409-21450/? W/bt_btm: btm_ble_exe_disable_resolving_list() cmd send complete
    2020-12-18 17:25:56.858 21409-21450/? W/bt_btm: btm_ble_enable_resolving_list() rl_state = 0x0, rl_mask = 0x1a
    2020-12-18 17:25:56.858 21409-21450/? W/bt_btm: btm_ble_exe_enable_resolving_list() cmd send complete
    2020-12-18 17:25:56.858 21409-21450/? W/bt_stack: [WARNING:btm_ble_multi_adv.cc(1010)] Resume() Resume inst_id = 1
    2020-12-18 17:25:56.858 21409-21450/? W/bt_stack: [WARNING:ble_advertiser_hci_interface.cc(233)] [HCI] multi adv enable cmd : enable = 1, handle = 1
    2020-12-18 17:25:56.858 21409-21450/? E/bt_btif: bta_gattc_mark_bg_conn unable to find the bg connection mask for: f6:f0:90:bb:e4:9f
    2020-12-18 17:25:56.859 21409-21433/? E/bt_btif: btif_dm_upstreams_evt: ev: BTA_DM_BLE_AUTH_CMPL_EVT
    2020-12-18 17:25:56.859 3926-3926/? D/KeyguardUpdateMonitor: handleStatusBarState( false )
    2020-12-18 17:25:56.859 24509-1348/com.microline.ble D/BluetoothGattServer: onServerConnectionState() - status=0 serverIf=7 device=F6:F0:90:BB:E4:9F
    2020-12-18 17:25:56.859 21409-21433/? E/bt_btif: [bond_state_changed]addr=f6f090, state=0, prev_state=0, sdp_attempts=0, remove_cb : 1
    2020-12-18 17:25:56.860 21409-21433/? E/bt_btif: btif_transfer_context() Caller thread is BTIF thread. Don't try context switch.
    2020-12-18 17:25:56.860 21409-21433/? W/bt_btif: btif_dm_generic_evt: event=33037
    2020-12-18 17:25:56.862 21409-21433/? I/BluetoothBondStateMachine: bondStateChangeCallback: Status: 9 Address: F6F090 newState: 0 reason: 102
    2020-12-18 17:25:56.862 21409-21433/? I/BluetoothBondStateMachine: bondStateChangeCallback Debugd mOutgoing:false oldState:10
    2020-12-18 17:25:56.862 21409-21433/? W/bt_btif: btif_dm_generic_evt: event=33037
    2020-12-18 17:25:56.863 24509-1348/com.microline.ble E/BIBA: createNotification Устройство отключилось
    2020-12-18 17:25:56.863 21409-21433/? W/bt_btif: btif_dm_generic_evt: event=33037
    2020-12-18 17:25:56.865 21409-21450/? W/bt_btm: btm_ble_disable_resolving_list() rl_state = 0x1b, rl_mask = 0x1, to_resume = 1
    2020-12-18 17:25:56.865 21409-21450/? W/bt_btm: btm_ble_disable_resolving_list() rl_state = 0x1a, rl_mask = 0x1, to_resume = 1
    2020-12-18 17:25:56.866 21409-21433/? W/bt_btif: btif_dm_generic_evt: event=33037
    2020-12-18 17:25:56.869 24509-1348/com.microline.ble E/BIBA: updateNotification
    2020-12-18 17:25:56.869 21409-21433/? W/bt_btif: btif_dm_generic_evt: event=33037
    2020-12-18 17:25:56.871 21409-21433/? W/bt_btif: btif_dm_generic_evt: event=33037
    2020-12-18 17:25:56.871 24509-1348/com.microline.ble D/Notification: allPendingIntents
    2020-12-18 17:25:56.873 21409-21433/? E/bt_btif: btif_dm_upstreams_evt: ev: BTA_DM_LINK_DOWN_EVT
    2020-12-18 17:25:56.873 21409-21433/? D/btif_av: btif_av_move_idle(L3293), cannot find av control block!
    2020-12-18 17:25:56.873 21409-21433/? W/bt_btif: BTA_DM_LINK_DOWN_EVT. Sending BT_ACL_STATE_DISCONNECTED
    2020-12-18 17:25:56.873 3926-3926/? D/swipe: !isFreemformEnabled
    2020-12-18 17:25:56.873 21409-21433/? E/BluetoothRemoteDevices: aclStateChangeCallback: State:DisConnected to Device:F6F090

    It seems that something went wrong here:

    2020-12-18 17:25:56.857 21409-21450/? W/bt_l2cap: L2CA_RemoveFixedChnl() CID: 0x0006 BDA: f6f090bbe49f not connected
    2020-12-18 17:25:56.857 21409-21450/? W/bt_btif: btif_gatt_set_encryption_cb() - Encryption failed (1)
    2020-12-18 17:25:56.857 21409-21450/? E/bt_btm: btm_acl_removed:1:

    device side:

    <info> peer_manager_handler: Connection security failed: role: Central, conn_handle: 0x0, procedure: Encryption, error: 4102
    
    <warning> peer_manager_handler: Disconnecting conn_handle 0.
    
    <info> app: BLE_GAP_EVT_RSSI_CHANGED: 0 rssi=--75dBm ch_index=0x28
    
    <error> nrf_ble_gq: SD GATT procedure (3) failed on connection handle 0 with error: 0x00000008.
    
    <info> app: Start_connection for Bonded peer
    
    <info> app: scan_evt_handler id = 6
    
    <info> app: Connecting to target 0x4393ECC4D4E1
    
    <info> peer_manager_handler: Peer data updated in flash: peer_id: 0, data_id: Peer rank, action: Update, no chanIED: peer_id=0x0
    
    <info> app: BLE_GAP_EVT_CONNECTED: 0 peer_id=0x0
    
    <info> app: 1<<bit_Connected
    
    <info> app: 1<<bit_Signed
    
    <info> app: BLE_GAP_EVT_RSSI_CHANGED: 0 rssi=--82dBm ch_index=0x7
    
    <info> app: NRF_BLE_GATT_EVT_ATT_MTU_UPDATED: 0 att_mtu_effectiv = 100.
    
    <info> app: BLE_GATTC_EVT_EXCHANGE_MTU_RSP: 0
    
    <info> appREQUEST: 0
    
    <info> app: NRF_BLE_GATT_ET_DATA_LENGTH_UPDATED: 0 data_length = 27.
    
    <info> app: BLE_GAP_EVT_DATA_LENGTH_UPDATE: 0
    
    <info> app: BLE_GAP_EVT_RSSI_CHANGED: 0 rssi=--75dBm ch_index=0x16
    
    <info> app: <info> peer_manager_handler: Connection security failed: role: Central, conn_handle: 0x0, procedure: Encryption, error: 4102
    
    <warning> peer_manager_handler: Disconnecting conn_handle 0.
    
    <info> app: BLE_GAP_EVT_RSSI_CHANGED: 0 rssi=--89dBm ch_index=0x2
    
    <error> nrf_ble_gq: SD GATT procedure (3) failed on connection handle 0 with error: 0x00000008.
    
    <info> app: BLE_DB_DISCOVERY_ERROR: 0
    
    <info> app: BLE_DB_DISCOVERY_AVAILABLE: 0
    
    <info> app: BLE_GAP_EVT_ADV_REPORT peer_id=0x0
    
    <info> app: Start_connection for Bonded peer
    
    <info> app: scan_evt_handler id = 6
    
    <info> app: Connecting to target 0x4BF7BD35EE1B
    
    <info> peer_manager_handler: Peer data updated in flash: peer_id: 0, data_id: Peer rank, action: Update, no chaneer_id=0x0
    
    <info> app: BLE_GAP_EVT_CONNECTED: 0 peer_id=0x0
    
    <info> app: 1<<bit_Connected
    
    <info> app: 1<<bit_Signed
    
    <info> app: Scanning start
    
    <info> app: BLE_GAP_EVT_DISCONNECTED: 0 , reason=0x3E
    
    <info> app: Scanning start
    
    <info> app: BLE_GAP_EVT_ADV_REPORT peer_id=0x0
    
    <info> app: Start_connection for Bonded peer
    
    <info> app: scan_evt_handler id = 6
    
    <info> app: Connecting to target 0x4BF7BD35EE1B
    

    Errors can be different sometimes.
    In this log are two cases of errors.

    In additional:
    When issue is there, if I connect another peripheral chip as another central, it works correctly in the same time with the same phone.

Reply
  • Hi.

    Issue is actual still.

    I try to understand it.


    It has following view:
    Device as central works with phone as peripheral. (Details about sdk and family of chip are in previous post)
    Working is stable. It can be many hours so.
    Disconnections and reconnections are working fine.
    But if I use system in the car, Issue is showed in few minutes.

    Connection is dismounting.
    Central make new attempt to connect at once. (I tried to pause there. It doesn't help.)
    But connections are failed every time.

    Restarting of central device doesn't help.
    Restarting of phone application doesn't help too.

    New good connection is available after re switching Bluetooth on phone only.


    Logs on device side and phone side:

    phone side:

    2020-12-18 17:25:56.476 24509-24527/com.microline.ble D/BluetoothGattServer: onServerConnectionState() - status=0 serverIf=7 device=F6:F0:90:BB:E4:9F
    2020-12-18 17:25:56.479 21409-21450/? D/IOP_DB_BT: db_query_execute: result 1
    2020-12-18 17:25:56.479 21409-21450/? D/IOP_DB_BT: db_query_create: id Downloadable_BleSCBlackList :: key KEY_BDADDR
    2020-12-18 17:25:56.479 21409-21450/? D/IOP_DB_BT: db_query_add_key: key KEY_NAME
    2020-12-18 17:25:56.480 21409-21433/? E/bt_btif: btif_dm_upstreams_evt: ev: BTA_DM_LINK_UP_EVT
    2020-12-18 17:25:56.480 21409-21433/? W/bt_btif: BTA_DM_LINK_UP_EVT. Sending BT_ACL_STATE_CONNECTED
    2020-12-18 17:25:56.482 21409-21450/? D/IOP_DB_BT: db_query_execute: result 1
    2020-12-18 17:25:56.482 21409-21450/? D/IOP_DB_BT: db_query_create: id Downloadable_BleSCBlackList :: key KEY_BDADDR
    2020-12-18 17:25:56.482 21409-21450/? D/IOP_DB_BT: db_query_add_key: key KEY_NAME
    2020-12-18 17:25:56.482 21409-21433/? E/BluetoothRemoteDevices: aclStateChangeCallback: State:Connected to Device:F6F090, linktype is 2
    2020-12-18 17:25:56.485 21409-21450/? D/IOP_DB_BT: db_query_execute: result 1
    2020-12-18 17:25:56.485 21409-21450/? W/bt_smp: lmp_version_below LMP version 10 < 8
    2020-12-18 17:25:56.485 21409-21450/? W/bt_smp: set auth_req: 0x2d, local_i_key: 0x0f, local_r_key: 0x0f
    2020-12-18 17:25:56.486 21409-21450/? D/IOP_DB_BT: db_query_create: id Downloadable_BleCIBlackList :: key KEY_BDADDR
    2020-12-18 17:25:56.486 21409-21450/? D/IOP_DB_BT: db_query_add_key: key KEY_NAME
    2020-12-18 17:25:56.488 24509-24527/com.microline.ble E/BIBA: createNotification Устройство подключилось
    2020-12-18 17:25:56.489 21409-21450/? D/IOP_DB_BT: db_query_execute: result 1
    2020-12-18 17:25:56.489 21409-21450/? D/IOP_DB_BT: db_query_create: id Downloadable_BleCIBlackList :: key KEY_BDADDR
    2020-12-18 17:25:56.489 21409-21450/? D/IOP_DB_BT: db_query_add_key: key KEY_NAME
    2020-12-18 17:25:56.492 21409-21450/? D/IOP_DB_BT: db_query_execute: result 1
    2020-12-18 17:25:56.493 21409-21450/? D/IOP_DB_BT: db_query_create: id Downloadable_BleCIBlackList :: key KEY_BDADDR
    2020-12-18 17:25:56.493 21409-21450/? D/IOP_DB_BT: db_query_add_key: key KEY_NAME
    2020-12-18 17:25:56.494 21409-21450/? D/IOP_DB_BT: db_query_execute: result 1
    2020-12-18 17:25:56.497 24509-24527/com.microline.ble E/BIBA: updateNotification
    2020-12-18 17:25:56.500 24509-24527/com.microline.ble D/Notification: allPendingIntents
    2020-12-18 17:25:56.501 3486-3501/? W/BroadcastQueue: Permission Denial: receiving Intent { act=android.bluetooth.device.action.ACL_CONNECTED flg=0x5000010 (has extras) } to ProcessRecord{8278327 4896:com.samsung.android.providers.context/u0a11} (pid=4896, uid=10011) requires android.permission.BLUETOOTH_ADMIN due to sender com.android.bluetooth (uid 1002)
    2020-12-18 17:25:56.504 13230-13230/? D/BeaconManager[8.0.28.0]: AppControlManager.onReceive - ($)
    2020-12-18 17:25:56.508 21409-21433/? D/BluetoothUtils: getBtEnabledContainers(): btContainers = []
    2020-12-18 17:25:56.509 21409-21433/? E/bt_btif: btif_dm_upstreams_evt: ev: BTA_DM_BUSY_LEVEL_EVT
    2020-12-18 17:25:56.509 21409-21433/? W/bt_btif: BTA_DM_BUSY_LEVEL_EVT :: p_data->busy_level.level_flags : 0x0
    2020-12-18 17:25:56.512 24509-24527/com.microline.ble D/BluetoothManager: getConnectedDevices
    2020-12-18 17:25:56.512 3486-3501/? D/ApplicationPolicy: isStatusBarNotificationAllowedAsUser: packageName = com.microline.ble,userId = 0
    2020-12-18 17:25:56.513 3486-3501/? D/API test: getContainerInfo: value is 
    2020-12-18 17:25:56.524 4315-4315/? I/TrustAgent: TAG: TrustAgent.Tracker. [BluetoothConnectionTracker] Bluetooth connect broadast for ZONT_App F6:F0:90:BB:E4:9F [CONTEXT service_id=84 ]
    2020-12-18 17:25:56.525 25213-25353/? D/RunestoneLogGenerator: generate Connection
    2020-12-18 17:25:56.525 24509-24527/com.microline.ble E/Background: [C2:C0:CB:12:41:BA, F6:F0:90:BB:E4:9F]
    2020-12-18 17:25:56.526 24509-1348/com.microline.ble D/BluetoothGattServer: onMtuChanged() - device=F6:F0:90:BB:E4:9F, mtu=100
    2020-12-18 17:25:56.555 21409-21450/? E/bt_btm: btm_ble_read_remote_features_complete: failed for handle: 0x1857, status 0x1a
    2020-12-18 17:25:56.556 21409-21448/? W/bt_hci: filter_incoming_event command complete event with no matching command (opcode: 0x2022).
    2020-12-18 17:25:56.570 14747-14774/? I/BistoWorker: bluetoothConnectionStateChanged. Action: android.bluetooth.device.action.ACL_CONNECTED
    2020-12-18 17:25:56.570 3486-4255/? D/SamsungAlarmManager: setInexact Intent (T:3/F:0/AC:false) 20301216T172556 - CU:10028/CP:28418
    2020-12-18 17:25:56.585 3486-8876/? D/SamsungAlarmManager: setInexact Intent (T:3/F:0/AC:false) 20301216T172556 - CU:10028/CP:4315
    2020-12-18 17:25:56.590 14747-14774/? I/DeviceDetector: shouldReduceSdpRequests; does not have bistoUuid
    2020-12-18 17:25:56.590 14747-14774/? I/WorkerManager: Releasing worker: [bisto]/[45]/[com.google.android.apps.gsa.staticplugins.bisto.ad.s]
    2020-12-18 17:25:56.591 14747-14774/? I/WorkerManager: Releasing worker: [bisto]/[45]/[com.google.android.apps.gsa.staticplugins.bisto.ad.s]
    2020-12-18 17:25:56.595 4315-4315/? I/NearbyDiscovery: onAclChange: state=CONNECTED, device=F6:F0:90:BB:E4:9F [CONTEXT service_id=49 ]
    2020-12-18 17:25:56.600 4315-28872/? I/NearbyDiscovery: FastPairBattery: No associated accountKey is found when query battery info, address:F6:F0:90:BB:E4:9F [CONTEXT service_id=49 ]
    2020-12-18 17:25:56.609 3486-8876/? W/BroadcastQueue: Permission Denial: receiving Intent { act=android.bluetooth.device.action.ACL_CONNECTED flg=0x5000010 (has extras) } to com.fbreader/org.fbreader.tts.BluetoothConnectReceiver requires android.permission.BLUETOOTH_ADMIN due to sender com.android.bluetooth (uid 1002)
    2020-12-18 17:25:56.643 24509-24509/com.microline.ble D/SystemWebChromeClient: file:///android_asset/www/webpack/main.js: Line 109271 : EntryPoint connectionResolver {"address":"F6:F0:90:BB:E4:9F","name":"ZONT_App","status":"connected"}
    2020-12-18 17:25:56.643 24509-24509/com.microline.ble I/chromium: [INFO:CONSOLE(109271)] "EntryPoint connectionResolver {"address":"F6:F0:90:BB:E4:9F","name":"ZONT_App","status":"connected"}", source: file:///android_asset/www/webpack/main.js (109271)
    2020-12-18 17:25:56.644 24509-24509/com.microline.ble D/SystemWebChromeClient: file:///android_asset/www/webpack/main.js: Line 110204 : EntryPoint Время:  Fri Dec 18 2020 17:25:56 GMT+0300 (Москва, стандартное время) 
        state:  [object Object]
    2020-12-18 17:25:56.645 24509-24509/com.microline.ble I/chromium: [INFO:CONSOLE(110204)] "EntryPoint Время:  Fri Dec 18 2020 17:25:56 GMT+0300 (Москва, стандартное время) 
        state:  [object Object]", source: file:///android_asset/www/webpack/main.js (110204)
    2020-12-18 17:25:56.645 21409-21448/? W/bt_hci: filter_incoming_event command status event with no matching command. opcode: 0x0000
    2020-12-18 17:25:56.675 21409-21450/? E/bt_btm: key size = 0
    2020-12-18 17:25:56.691 3486-3501/? D/ApplicationPolicy: isStatusBarNotificationAllowedAsUser: packageName = com.microline.ble,userId = 0
    2020-12-18 17:25:56.691 3486-3501/? D/API test: getContainerInfo: value is 
    2020-12-18 17:25:56.779 3486-9467/? D/Notification: allPendingIntents
    2020-12-18 17:25:56.780 3486-9467/? D/Notification: allPendingIntents
    2020-12-18 17:25:56.780 3486-3497/? D/Notification: allPendingIntents
    2020-12-18 17:25:56.780 3486-8876/? D/Notification: allPendingIntents
    2020-12-18 17:25:56.825 3926-3926/? D/KeyguardUpdateMonitor: handleStatusBarState( false )
    2020-12-18 17:25:56.832 3486-3561/? D/SensorService: [SO] -1.259 9.704 0.249
    2020-12-18 17:25:56.847 3486-3497/? D/AODManagerService: updateNotificationKeysInternal() return : same [6] 
    2020-12-18 17:25:56.856 21409-21433/? W/bt_btif: btif_dm_generic_evt: event=33037
    2020-12-18 17:25:56.856 21409-21450/? W/bt_btif: bta_gattc_conn_cback() - cif=3 connected=0 conn_id=259 reason=0x0013
    2020-12-18 17:25:56.856 21409-21450/? W/bt_btif: bta_gattc_conn_cback() - cif=4 connected=0 conn_id=260 reason=0x0013
    2020-12-18 17:25:56.856 21409-21450/? W/bt_btif: bta_gattc_conn_cback() - cif=5 connected=0 conn_id=261 reason=0x0013
    2020-12-18 17:25:56.856 21409-21450/? W/bt_btif: bta_gattc_conn_cback() - cif=6 connected=0 conn_id=262 reason=0x0013
    2020-12-18 17:25:56.856 21409-21450/? W/bt_btif: bta_gattc_conn_cback() - cif=8 connected=0 conn_id=264 reason=0x0013
    2020-12-18 17:25:56.856 21409-21450/? W/bt_btif: bta_gattc_conn_cback() - cif=10 connected=0 conn_id=266 reason=0x0013
    2020-12-18 17:25:56.857 21409-21450/? W/bt_l2cap: L2CA_RemoveFixedChnl()  CID: 0x0006  BDA: f6f090bbe49f not connected
    2020-12-18 17:25:56.857 21409-21450/? W/bt_btif: btif_gatt_set_encryption_cb() - Encryption failed (1)
    2020-12-18 17:25:56.857 21409-21450/? E/bt_btm: btm_acl_removed:1:
    2020-12-18 17:25:56.857 21409-21450/? E/bt_btm: No such connected client, bd_addr:f6-f0-90-bb-e4-9f
    2020-12-18 17:25:56.857 21409-21450/? W/bt_btm: btm_sec_disconnected
    2020-12-18 17:25:56.857 21409-21450/? E/bt_btif: Ignore unknown conn ID: 259
    2020-12-18 17:25:56.857 21409-21450/? E/bt_btif: Ignore unknown conn ID: 260
    2020-12-18 17:25:56.857 21409-21450/? E/bt_btif: Ignore unknown conn ID: 261
    2020-12-18 17:25:56.857 21409-21450/? E/bt_btif: Ignore unknown conn ID: 262
    2020-12-18 17:25:56.857 21409-21450/? E/bt_btif: Ignore unknown conn ID: 264
    2020-12-18 17:25:56.857 21409-21450/? E/bt_btif: Ignore unknown conn ID: 266
    2020-12-18 17:25:56.857 21409-21450/? W/bt_btm: BTM_SecDeleteDevice :: pending_delete : 0
    2020-12-18 17:25:56.857 21409-21450/? W/bt_btm: btm_ble_disable_resolving_list() rl_state = 0x1a, rl_mask = 0x1a, to_resume = 0
    2020-12-18 17:25:56.857 21409-21450/? W/bt_stack: [WARNING:btm_ble_multi_adv.cc(985)] Suspend() Suspend inst_id = 1
    2020-12-18 17:25:56.858 21409-21450/? W/bt_stack: [WARNING:ble_advertiser_hci_interface.cc(233)] [HCI] multi adv enable cmd : enable = 0, handle = 1
    2020-12-18 17:25:56.858 21409-21450/? W/bt_btm: btm_ble_exe_disable_resolving_list() cmd send complete
    2020-12-18 17:25:56.858 21409-21450/? W/bt_btm: btm_ble_enable_resolving_list() rl_state = 0x0, rl_mask = 0x1a
    2020-12-18 17:25:56.858 21409-21450/? W/bt_btm: btm_ble_exe_enable_resolving_list() cmd send complete
    2020-12-18 17:25:56.858 21409-21450/? W/bt_stack: [WARNING:btm_ble_multi_adv.cc(1010)] Resume() Resume inst_id = 1
    2020-12-18 17:25:56.858 21409-21450/? W/bt_stack: [WARNING:ble_advertiser_hci_interface.cc(233)] [HCI] multi adv enable cmd : enable = 1, handle = 1
    2020-12-18 17:25:56.858 21409-21450/? E/bt_btif: bta_gattc_mark_bg_conn unable to find the bg connection mask for: f6:f0:90:bb:e4:9f
    2020-12-18 17:25:56.859 21409-21433/? E/bt_btif: btif_dm_upstreams_evt: ev: BTA_DM_BLE_AUTH_CMPL_EVT
    2020-12-18 17:25:56.859 3926-3926/? D/KeyguardUpdateMonitor: handleStatusBarState( false )
    2020-12-18 17:25:56.859 24509-1348/com.microline.ble D/BluetoothGattServer: onServerConnectionState() - status=0 serverIf=7 device=F6:F0:90:BB:E4:9F
    2020-12-18 17:25:56.859 21409-21433/? E/bt_btif: [bond_state_changed]addr=f6f090, state=0, prev_state=0, sdp_attempts=0, remove_cb : 1
    2020-12-18 17:25:56.860 21409-21433/? E/bt_btif: btif_transfer_context() Caller thread is BTIF thread. Don't try context switch.
    2020-12-18 17:25:56.860 21409-21433/? W/bt_btif: btif_dm_generic_evt: event=33037
    2020-12-18 17:25:56.862 21409-21433/? I/BluetoothBondStateMachine: bondStateChangeCallback: Status: 9 Address: F6F090 newState: 0 reason: 102
    2020-12-18 17:25:56.862 21409-21433/? I/BluetoothBondStateMachine: bondStateChangeCallback Debugd mOutgoing:false oldState:10
    2020-12-18 17:25:56.862 21409-21433/? W/bt_btif: btif_dm_generic_evt: event=33037
    2020-12-18 17:25:56.863 24509-1348/com.microline.ble E/BIBA: createNotification Устройство отключилось
    2020-12-18 17:25:56.863 21409-21433/? W/bt_btif: btif_dm_generic_evt: event=33037
    2020-12-18 17:25:56.865 21409-21450/? W/bt_btm: btm_ble_disable_resolving_list() rl_state = 0x1b, rl_mask = 0x1, to_resume = 1
    2020-12-18 17:25:56.865 21409-21450/? W/bt_btm: btm_ble_disable_resolving_list() rl_state = 0x1a, rl_mask = 0x1, to_resume = 1
    2020-12-18 17:25:56.866 21409-21433/? W/bt_btif: btif_dm_generic_evt: event=33037
    2020-12-18 17:25:56.869 24509-1348/com.microline.ble E/BIBA: updateNotification
    2020-12-18 17:25:56.869 21409-21433/? W/bt_btif: btif_dm_generic_evt: event=33037
    2020-12-18 17:25:56.871 21409-21433/? W/bt_btif: btif_dm_generic_evt: event=33037
    2020-12-18 17:25:56.871 24509-1348/com.microline.ble D/Notification: allPendingIntents
    2020-12-18 17:25:56.873 21409-21433/? E/bt_btif: btif_dm_upstreams_evt: ev: BTA_DM_LINK_DOWN_EVT
    2020-12-18 17:25:56.873 21409-21433/? D/btif_av: btif_av_move_idle(L3293), cannot find av control block!
    2020-12-18 17:25:56.873 21409-21433/? W/bt_btif: BTA_DM_LINK_DOWN_EVT. Sending BT_ACL_STATE_DISCONNECTED
    2020-12-18 17:25:56.873 3926-3926/? D/swipe: !isFreemformEnabled
    2020-12-18 17:25:56.873 21409-21433/? E/BluetoothRemoteDevices: aclStateChangeCallback: State:DisConnected to Device:F6F090

    It seems that something went wrong here:

    2020-12-18 17:25:56.857 21409-21450/? W/bt_l2cap: L2CA_RemoveFixedChnl() CID: 0x0006 BDA: f6f090bbe49f not connected
    2020-12-18 17:25:56.857 21409-21450/? W/bt_btif: btif_gatt_set_encryption_cb() - Encryption failed (1)
    2020-12-18 17:25:56.857 21409-21450/? E/bt_btm: btm_acl_removed:1:

    device side:

    <info> peer_manager_handler: Connection security failed: role: Central, conn_handle: 0x0, procedure: Encryption, error: 4102
    
    <warning> peer_manager_handler: Disconnecting conn_handle 0.
    
    <info> app: BLE_GAP_EVT_RSSI_CHANGED: 0 rssi=--75dBm ch_index=0x28
    
    <error> nrf_ble_gq: SD GATT procedure (3) failed on connection handle 0 with error: 0x00000008.
    
    <info> app: Start_connection for Bonded peer
    
    <info> app: scan_evt_handler id = 6
    
    <info> app: Connecting to target 0x4393ECC4D4E1
    
    <info> peer_manager_handler: Peer data updated in flash: peer_id: 0, data_id: Peer rank, action: Update, no chanIED: peer_id=0x0
    
    <info> app: BLE_GAP_EVT_CONNECTED: 0 peer_id=0x0
    
    <info> app: 1<<bit_Connected
    
    <info> app: 1<<bit_Signed
    
    <info> app: BLE_GAP_EVT_RSSI_CHANGED: 0 rssi=--82dBm ch_index=0x7
    
    <info> app: NRF_BLE_GATT_EVT_ATT_MTU_UPDATED: 0 att_mtu_effectiv = 100.
    
    <info> app: BLE_GATTC_EVT_EXCHANGE_MTU_RSP: 0
    
    <info> appREQUEST: 0
    
    <info> app: NRF_BLE_GATT_ET_DATA_LENGTH_UPDATED: 0 data_length = 27.
    
    <info> app: BLE_GAP_EVT_DATA_LENGTH_UPDATE: 0
    
    <info> app: BLE_GAP_EVT_RSSI_CHANGED: 0 rssi=--75dBm ch_index=0x16
    
    <info> app: <info> peer_manager_handler: Connection security failed: role: Central, conn_handle: 0x0, procedure: Encryption, error: 4102
    
    <warning> peer_manager_handler: Disconnecting conn_handle 0.
    
    <info> app: BLE_GAP_EVT_RSSI_CHANGED: 0 rssi=--89dBm ch_index=0x2
    
    <error> nrf_ble_gq: SD GATT procedure (3) failed on connection handle 0 with error: 0x00000008.
    
    <info> app: BLE_DB_DISCOVERY_ERROR: 0
    
    <info> app: BLE_DB_DISCOVERY_AVAILABLE: 0
    
    <info> app: BLE_GAP_EVT_ADV_REPORT peer_id=0x0
    
    <info> app: Start_connection for Bonded peer
    
    <info> app: scan_evt_handler id = 6
    
    <info> app: Connecting to target 0x4BF7BD35EE1B
    
    <info> peer_manager_handler: Peer data updated in flash: peer_id: 0, data_id: Peer rank, action: Update, no chaneer_id=0x0
    
    <info> app: BLE_GAP_EVT_CONNECTED: 0 peer_id=0x0
    
    <info> app: 1<<bit_Connected
    
    <info> app: 1<<bit_Signed
    
    <info> app: Scanning start
    
    <info> app: BLE_GAP_EVT_DISCONNECTED: 0 , reason=0x3E
    
    <info> app: Scanning start
    
    <info> app: BLE_GAP_EVT_ADV_REPORT peer_id=0x0
    
    <info> app: Start_connection for Bonded peer
    
    <info> app: scan_evt_handler id = 6
    
    <info> app: Connecting to target 0x4BF7BD35EE1B
    

    Errors can be different sometimes.
    In this log are two cases of errors.

    In additional:
    When issue is there, if I connect another peripheral chip as another central, it works correctly in the same time with the same phone.

Children
No Data
Related