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

Disconnected: 0 BLEHci.remote_user_terminated_connection [using pc_ble_driver_py]

Hello,

I am using the nordic nRF52840-DK and trying to connect to a nRF52840-Dongle and sending/receiving data to custom services and characteristics using pc_ble_driver_py. I modified the heart rate collector.

But the problem is that when I am connected to the Dongle the connection last 25 to 30 secondes and I receive a message : "Disconnected: 0 BLEHci.remote_user_terminated_connection" and the error message is : "line 477, in write_req attr_handle = self.db_conns[conn_handle].get_char_value_handle(uuid) KeyError: 0". However, when I use the nRF connect mobile/PC version I don't have this problem so I think it is a problem with my code. I check it out if there is some time out equal to like 25_30 secondes but I didn't find any solution.

Could someone help me please to find some solution.

Thanks in advance.

Cordially

Joe

Parents
  • Disconnected: 0 BLEHci.remote_user_terminated_connectio

    This means that  sd_ble_gap_disconnect() was called on the peer, with the reason BLE_HCI_REMOTE_USER_TERMINATED_CONNECTION. If you can debug your peer you should be able to find where this is called.

    Kenneth

  • I searched in debugging mode but I didn't found that the function was called. However, on the peer I receive the messages below :

    ERROR:pc_ble_driver_py.ble_driver:Exception: MTU exchange reply failed. Common causes are: missing att_mtu setting in ble_cfg_set, different config tags used in ble_cfg_set and adv_start.
    ERROR:pc_ble_driver_py.ble_driver:<FrameSummary file C:xxxx\lib\site-packages\pc_ble_driver_py\ble_driver.py, line 2701 in ble_event_handler_sync>
    ERROR:pc_ble_driver_py.ble_driver:<FrameSummary file C:xxxx\lib\site-packages\pc_ble_driver_py\ble_adapter.py, line 772 in on_gatts_evt_exchange_mtu_request>
    ERROR:pc_ble_driver_py.ble_driver:

    Thanks

    Joe

  • It should be possible to search through your project for sd_ble_gap_disconnect(), I don't expect it is used many places.

    Looking at your pc ble driver log it may seem realted to MTU settings, you can for test simply comment out on_connected_evt() that is called in nrf_ble_gatt_on_ble_evt() from nrf_ble_gatt.c. This is far fetched, but could be worth a try.

    Do you by any chance have an on-air sniffer log (e.g. nrf sniffer)?

    Kenneth

  • I will try to find a sniffer and comment the function on_connected_evt() . But could you please try to lunch my code in the attachements to see what will happens.

    Thanks

    Joe

Reply Children
No Data
Related