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

nrf52840 Dongle and ble_serial.py

I am trying to run ble_serial.py in the ble_app_cli SDK example using the nrf52840 dongle. To do so, I tried flashing the connectivity firmware automatically via the nrfConnect Desktop Bluetooth Low Energy application. When I run the python script, I can connect and everything runs OK for 30 seconds although there is one exception: 

Exception: 'BLE_Serial' object has no attribute 'on_gattc_evt_exchange_mtu_rsp'

After 30 seconds, it loses connection and constantly tries to reconnect with no success. I have also tried flashing connectivity_1.2.3_usb_dfu_pkg.zip from the pc-ble-driver repo checking to see if it could be a version issue but the problem exists there as well. 

Any idea what could be going wrong?

Parents
  • Hi,

    What example from what SDK and version are you using? Experimental: Console over Bluetooth Application from nRF5 SDK v15.2.0?

    Did you follow the "Testing" section for that example?

    Also, what is the full command that you use for ble_serial.py?

    It sounds like a timeout of an MTU update request leading to disconnection. What information do you have for the disconnect, do you have the log from either of the devices or a sniffer trace?

    Regards,
    Terje

  • I am using SDK 15.2.0 and the  Experimental: Console over Bluetooth Application example python script with my custom application. 

    My custom peripheral application implements pairing/bonding. I found out that the source of the timeout is not the ATT MTU exchange but an authentication timeout; I need to implement authentication in the ble_serial.py script. I have had limited luck with that. I have tried calling: self.adapter.authenticate(self.conn_handle, bond=True, lesc=False) after a successful connection. This works if the peripheral isn't bonded yet, i.e first time bond. What is the correct way to re-establish a connection with a bonded device using pc-ble-driver-py? Is there any example of a pc-ble-driver-py implementing bonding/pairing?

Reply
  • I am using SDK 15.2.0 and the  Experimental: Console over Bluetooth Application example python script with my custom application. 

    My custom peripheral application implements pairing/bonding. I found out that the source of the timeout is not the ATT MTU exchange but an authentication timeout; I need to implement authentication in the ble_serial.py script. I have had limited luck with that. I have tried calling: self.adapter.authenticate(self.conn_handle, bond=True, lesc=False) after a successful connection. This works if the peripheral isn't bonded yet, i.e first time bond. What is the correct way to re-establish a connection with a bonded device using pc-ble-driver-py? Is there any example of a pc-ble-driver-py implementing bonding/pairing?

Children
Related