<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>I am having a problem on the second connect after bonding to a bluez 5.43 central</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/27321/i-am-having-a-problem-on-the-second-connect-after-bonding-to-a-bluez-5-43-central</link><description>I can connect/pair/bond to the nrfConnect app and disconnect then reconnect just fine. When I try to do the same to a central running on arm bluez 5.43, the second and subsequent connections timeout after about 30 seconds and the peripheral gets a BLE_GATTC_EVT_TIMEOUT</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 28 Feb 2018 16:53:31 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/27321/i-am-having-a-problem-on-the-second-connect-after-bonding-to-a-bluez-5-43-central" /><item><title>RE: I am having a problem on the second connect after bonding to a bluez 5.43 central</title><link>https://devzone.nordicsemi.com/thread/122350?ContentTypeID=1</link><pubDate>Wed, 28 Feb 2018 16:53:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:729c94f0-e634-4ded-b732-278ca64033f3</guid><dc:creator>jlarsen</dc:creator><description>&lt;p&gt;Thank you Hung Bui,&amp;nbsp; I was able to modify nrf_ble_gatt.c to not send an MTU request.&amp;nbsp; I believe Bluez (5.48) has a bug where it does not respond to MTU change requests after connecting to a bonded peer. It is true that the MTU should already be established and stored but the central should always respond to requests per the spec.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I am having a problem on the second connect after bonding to a bluez 5.43 central</title><link>https://devzone.nordicsemi.com/thread/107932?ContentTypeID=1</link><pubDate>Tue, 28 Nov 2017 14:30:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1b173ef1-1f7c-484e-bb38-eb05c1111faa</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;You may need to modify the nrf_ble_gatt.c. Maybe extern a flag to the file and check if the flag is set before you call sd_ble_gattc_exchange_mtu_request(). Then you can set that flag inside main.c after you receive PM_EVT_BONDED_PEER_CONNECTED event.&lt;/p&gt;
&lt;p&gt;Of you can remove the call sd_ble_gattc_exchange_mtu_request() inside nrf_ble_gatt.c and then call that function on your own in main.c&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I am having a problem on the second connect after bonding to a bluez 5.43 central</title><link>https://devzone.nordicsemi.com/thread/107931?ContentTypeID=1</link><pubDate>Mon, 27 Nov 2017 23:06:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4b3a8ea9-ac48-43f2-865e-9eed5e44902b</guid><dc:creator>jlarsen</dc:creator><description>&lt;p&gt;I do get a PM_EVT_BONDED_PEER_CONNECTED event before on_connected_evt() is called where sd_ble_gattc_exchange_mtu_request is called but I see no way of knowing in the nrf_ble_gatt.c on_connected_evt event that PM_EVT_BONDED_PEER_CONNECTED was called previous or any way to know that the connection is bonded.  Is there any way of knowing this and conditionally calling the mtu request?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I am having a problem on the second connect after bonding to a bluez 5.43 central</title><link>https://devzone.nordicsemi.com/thread/107930?ContentTypeID=1</link><pubDate>Thu, 23 Nov 2017 12:51:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f39e20a7-e31a-4d59-8eea-0676634b00f2</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Larsen,&lt;/p&gt;
&lt;p&gt;MTU request is sent by the peripheral by the call sd_ble_gattc_exchange_mtu_request() to the softdevice.&lt;/p&gt;
&lt;p&gt;Most of the time this is called inside on_connected_evt() in nrf_ble_gatt.c&lt;/p&gt;
&lt;p&gt;You can modify the code so that it won&amp;#39;t call if the link is encrypted. (You will receive PM_EVT_BONDED_PEER_CONNECTED event from peer manager if it&amp;#39;s a previously bonded peer )&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I am having a problem on the second connect after bonding to a bluez 5.43 central</title><link>https://devzone.nordicsemi.com/thread/107929?ContentTypeID=1</link><pubDate>Wed, 22 Nov 2017 18:48:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6749cfab-57c9-4490-ac15-8390cd3012c2</guid><dc:creator>jlarsen</dc:creator><description>&lt;p&gt;It will take some time for us to be able to sniff the ble traffic to a level that will help.  In the meantime I think I have found what is going on and have some further questions.
On every connection, if our MTU is not default 23,  we send an MTU exchange request.  On the first connection the bluez based central sends a MTU exchange response and everyhing is fine.  On the second connection we never receive an MTU echange response and 30 seconds later we timeout and disconnect.  I do think that bluez is in error here although they wonder why the peripheral is sending an MTU request when we are already bonded/paired. My question is, is there a way to have the software on the peripheral only send an MTU exchange request on the first connection to a central and not again on the subsequent connections to a bonded/paired central?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I am having a problem on the second connect after bonding to a bluez 5.43 central</title><link>https://devzone.nordicsemi.com/thread/107928?ContentTypeID=1</link><pubDate>Mon, 20 Nov 2017 14:11:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6fb9c21c-5774-4c06-8f93-b75b878e855e</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Our current sniffer doesn&amp;#39;t really support BLE 4.2 features, so it may be difficult to sniff the connection. I would suggest to use more advanced sniffer, Ellysis or Frontline sniffer should do the work.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I am having a problem on the second connect after bonding to a bluez 5.43 central</title><link>https://devzone.nordicsemi.com/thread/107927?ContentTypeID=1</link><pubDate>Fri, 17 Nov 2017 20:30:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cb3c7afb-5280-478f-b237-4782571677c6</guid><dc:creator>jlarsen</dc:creator><description>&lt;p&gt;softdevice = s132
chip = nRF52&lt;/p&gt;
&lt;p&gt;ble_app_proximity does the same thing in that it disconnects after 30 seconds.  The connection parameters seem to work better in the proximity app.  I actually see them set on the central side.&lt;/p&gt;
&lt;p&gt;I have been using the nRF52 board to sniff.  Theres are some issues doing this.  I will post the sniffer results once I get a board that that the sniffer code works on.&lt;/p&gt;
&lt;p&gt;I am not sure if we do write requests but we do attempt to change the MTU&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I am having a problem on the second connect after bonding to a bluez 5.43 central</title><link>https://devzone.nordicsemi.com/thread/107926?ContentTypeID=1</link><pubDate>Fri, 17 Nov 2017 16:07:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:44ad7587-2ed5-4537-a3f2-65a97746550b</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Larsen,&lt;/p&gt;
&lt;p&gt;It&amp;#39;s not clear in mycentral2.pcapng what exactly cause the disconnection. The connection timeout was set to 52.5 seconds, but the connection was terminated much earlier than that.&lt;/p&gt;
&lt;p&gt;A BLE_GATTC_EVT_TIMEOUT meaning there was a write request sent but never get a response. Do you do any write request from the nRF5 side ?&lt;/p&gt;
&lt;p&gt;Since the sniffer file the encrypted packets was not decrypted correctly I can&amp;#39;t tell what could be wrong here.  I suspect the LTK keys was not stored correctly.&lt;/p&gt;
&lt;p&gt;You may want try sniffing again and try to sniff with one take that cover both the first connection (when they bond) and the second connection, all in one sniffer trace.&lt;/p&gt;
&lt;p&gt;If you test with something like the ble_app_proximity and test bonding and reconnect, do you have the same problem ?&lt;/p&gt;
&lt;p&gt;Which chip and softdevice were you using ? nRF51 and S132 don&amp;#39;t go together.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>