The nRF51822-mKIT is a low cost ARM mbed enabled development board for Bluetooth® Smart designs with the nRF51822 SoC. The kit gives access to all GPIO pins via pin headers …

BLE Nano loses connection

26 Aug 2015

Hey guys!

i am using ble nano as a central device. I can establish a connection and also read the characteristics. I also enabled notifacation for one characteristic. Everything is working fine but after 1 min the connection is lost. The reason i get on the callback for disconnection is BLE_HCI_REMOTE_USER_TERMINATED_CONNECTION.

Does that mean that my ble nano as central device disconnects or is the peripheral disconnecting? What could be a reason for disconnection?

thx

26 Aug 2015

My experience, is that part of the LowPower most peripherals will auto disconnect if no updates have been sent, or no commands issued. Some devices offer a characteristic that is called no sleep...

JPaul Carpenter

26 Aug 2015

thx for you answer. But i dont think its the peripheral, because when i connect with my mobilephone the connection keeps active..

could it be possible that my central device can not answer some requests from the peripheral? and so the connection is lost?

26 Aug 2015

a definite possibility, but the difference is your phone most likely asserts a command or two.. put the nano in sniffer mode and slook at the packets, then create a sercuive about those characteristics like the uart examples and then you should be able to keep connection and hold it for a while.

26 Aug 2015

ok! it seems that the peripheral is requesting an update for the connection parameters and the mobilephone accepts this. i think my ble nano will not accept this and so it disconnects. do you know how i can enable/accept this update on the ble nano?

26 Aug 2015
26 Aug 2015

ok refering to the sequence diagramm.. in my case there is the "peripheral solicited procedure".

so the peripheral is asking for an update including the parameters CP#3. where do i now implement the function Gap::updateConnectionParams() ?

The arguments for the function are "connectionHandle" which i get from connectionCallback and the second argument should be CP#3. But how can i read CP#3 from the request?

26 Aug 2015

The trouble is that we haven't yet provided an API for setting a callback for when a parameters-update request is received. Had there been such a callback, your central could then initiate the conn-params update procedure in response. The BLE stack passes up an event when the request arrives, and it would be very easy to add an API to pass it to the user-app, but I'm not sure if I've got the time for it now.

In the mean while, could you change your central to always initiate the conn-params update procedure upon the establishment of a connection?

26 Aug 2015

you could, if there is enough motivation, submit pull requests to BLE_API and nRF51822 repositories to add the missing functionality needed to support a callback for conn-params update.

that would be very welcome. But failing that, we'll have to work around the situation.

There's also a possibility that the central passes more appropriate connection parameters at the time of setting up a connection.

27 Aug 2015

ok i put the Gap::updateConnectionParams() in my while(true) and connection keeps active. Maybe that is not very efficient, but it is working! thx a lot.

I will try to add a callback in the BLE_API and the nRF61822. Do i have to add another 'case' in the device_mangager_peripheral?

27 Aug 2015

Thanks for considering to help with extending the BLE_API. Being able to set a callback would be enough. :)