<?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>Android Automatically Unbonding on Reconnection</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/38247/android-automatically-unbonding-on-reconnection</link><description>We seem to be having an issue on several Android devices, where reconnecting sometimes triggers an erroneous GATT_INSUF_AUTHORIZATION. This then causes Android to automatically delete the bond information on the phone, meaning our device needs repairing</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 25 Mar 2020 18:46:21 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/38247/android-automatically-unbonding-on-reconnection" /><item><title>RE: Android Automatically Unbonding on Reconnection</title><link>https://devzone.nordicsemi.com/thread/241675?ContentTypeID=1</link><pubDate>Wed, 25 Mar 2020 18:46:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1fa410e9-eb37-45f2-b803-2922642113e8</guid><dc:creator>mpkasp</dc:creator><description>&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/members/hammerfet"&gt;siliconwitch&lt;/a&gt; were you able to resolve this issue? We are seeing similar behavior.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Android Automatically Unbonding on Reconnection</title><link>https://devzone.nordicsemi.com/thread/149456?ContentTypeID=1</link><pubDate>Wed, 19 Sep 2018 13:09:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1d2ce113-328f-4186-b1a9-8ad0a612b709</guid><dc:creator>Mttrinh</dc:creator><description>&lt;p&gt;Haven&amp;#39;t been able to reproduce this. Need a sniffer trace to look further into this.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Android Automatically Unbonding on Reconnection</title><link>https://devzone.nordicsemi.com/thread/148184?ContentTypeID=1</link><pubDate>Tue, 11 Sep 2018 11:47:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3e0cd3a2-d42d-47c8-9a2e-f680c0410ed1</guid><dc:creator>HenrikGetfantom</dc:creator><description>&lt;p&gt;The fastest way to reproduce it is to try disconnect and connect the nRF52 with the Android phone in a quite short time frame without turning off Blutooth, for example take it out-of-range and in-range.&lt;/p&gt;
&lt;p&gt;What I usually do is to put the nRF52 device at the border of maximum Bluetooth range and leave it there for a while, where it will most likely connect and disconnect frequently. If using nFR Connect you need to connect using Auto Connect flag set to true.&lt;/p&gt;
&lt;p&gt;The phone we have most problems with is Pixel running Android 8.1&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Android Automatically Unbonding on Reconnection</title><link>https://devzone.nordicsemi.com/thread/147907?ContentTypeID=1</link><pubDate>Sun, 09 Sep 2018 23:28:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2424d324-1bb0-42d9-baa2-88a5990fb11a</guid><dc:creator>Austin</dc:creator><description>&lt;p&gt;I&amp;#39;ve also seen this a number of times but cannot reliably reproduce the issue.&lt;/p&gt;
&lt;p&gt;The only way I&amp;#39;ve been able to reproduce on occasion is the following setup:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Bond to a target device (In our case an nRF52840 with S140)&lt;/li&gt;
&lt;li&gt;Use Android nRF Connect and connect with Autoconnect turned on.&lt;/li&gt;
&lt;li&gt;Move Android device and target device apart so that the are at the limit of connection range.&lt;/li&gt;
&lt;li&gt;BLE connection drops out and Android phone attempts to reconnect to target.&lt;/li&gt;
&lt;li&gt;After reconnection, bonding information is sometimes deleted from the phone.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The following Android nRF Connect log shows an example of this occurring on a Samsung S6, Android 70&lt;/p&gt;
&lt;p&gt;As seen from this log, it appears as though the Android phone is attempting to discover services on the target (not really sure why, as the services should already be available for a device which as already been bonded).&lt;/p&gt;
&lt;p&gt;My suspicion is that the Android BLE stack automatically removes bonding information for a device if it cannot successfully discover services after the initial bonding key exchange has been completed.&amp;nbsp; i.e. If the BLE connection is good enough to allow key exchange, but then there are packets lost during BLE service discovery, the Android BLE subsystems sets the device state as unbonded.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;I 11:55:14.038 Notification received from 001c0005-99f7-af8f-6b4e-1e1624b9d72e, value: (0x) 00-00-0F-AD-FF-FF-FF-E9
A 11:55:14.038 &amp;quot;(0x) 00-00-0F-AD-FF-FF-FF-E9&amp;quot; received
I 11:55:59.056 Notification received from 001c0005-99f7-af8f-6b4e-1e1624b9d72e, value: (0x) 00-00-0F-AD-FF-FF-FF-EF
A 11:55:59.056 &amp;quot;(0x) 00-00-0F-AD-FF-FF-FF-EF&amp;quot; received
I 11:55:59.058 Notification received from 001c0005-99f7-af8f-6b4e-1e1624b9d72e, value: (0x) 00-00-0F-AE-00-00-0F-54
A 11:55:59.058 &amp;quot;(0x) 00-00-0F-AE-00-00-0F-54&amp;quot; received
D 11:56:35.047 [Server callback] Connection state changed with status: 0 and new state: DISCONNECTED (0)
I 11:56:35.047 [Server] Device disconnected
D 11:56:35.085 [Callback] Connection state changed with status: 8 and new state: DISCONNECTED (0)
E 11:56:35.086 Error 8 (0x8): GATT CONN TIMEOUT
I 11:56:35.086 Disconnected
D 11:56:35.120 [Broadcast] Action received: android.bluetooth.device.action.ACL_DISCONNECTED
D 11:58:11.392 [Server callback] Connection state changed with status: 0 and new state: CONNECTED (2)
I 11:58:11.392 [Server] Device with address E1:FB:ED:C3:13:E7 connected
V 11:58:11.392 [Server] Creating server connection...
D 11:58:11.392 server.connect(device, autoConnect = true)
V 11:58:11.404 Connecting to E1:FB:ED:C3:13:E7...
D 11:58:11.404 gatt.connect()
D 11:58:11.508 [Broadcast] Action received: android.bluetooth.device.action.ACL_CONNECTED
D 11:58:11.514 [Callback] Connection state changed with status: 0 and new state: CONNECTED (2)
I 11:58:11.514 Connected to E1:FB:ED:C3:13:E7
D 11:58:11.518 wait(1600ms)
D 11:58:11.539 [Callback] Connection state changed with status: 0 and new state: CONNECTED (2)
V 11:58:13.123 Discovering services...
D 11:58:13.123 gatt.discoverServices()
D 11:58:32.061 [Server callback] Connection state changed with status: 0 and new state: DISCONNECTED (0)
I 11:58:32.061 [Server] Device disconnected
D 11:58:32.171 [Broadcast] Action received: android.bluetooth.device.action.BOND_STATE_CHANGED, bond state changed to: BOND_NONE (10)
I 11:58:32.171 Bond information deleted
D 11:58:32.187 [Callback] Connection state changed with status: 8 and new state: DISCONNECTED (0)
E 11:58:32.187 Error 8 (0x8): GATT CONN TIMEOUT
I 11:58:32.187 Disconnected
D 11:58:32.235 [Broadcast] Action received: android.bluetooth.device.action.ACL_DISCONNECTED
D 16:05:34.028 gatt.close()
D 16:05:34.031 wait(200)
V 16:05:34.234 Connecting to E1:FB:ED:C3:13:E7...
D 16:05:34.235 gatt = device.connectGatt(autoConnect = true, TRANSPORT_LE)
D 16:05:46.070 [Server callback] Connection state changed with status: 0 and new state: CONNECTED (2)
I 16:05:46.070 [Server] Device with address E1:FB:ED:C3:13:E7 connected
V 16:05:46.070 [Server] Creating server connection...
D 16:05:46.071 server.connect(device, autoConnect = true)
D 16:05:46.144 [Callback] Connection state changed with status: 0 and new state: CONNECTED (2)
I 16:05:46.144 Connected to E1:FB:ED:C3:13:E7
D 16:05:46.148 [Broadcast] Action received: android.bluetooth.device.action.ACL_CONNECTED
V 16:05:46.161 Discovering services...
D 16:05:46.161 gatt.discoverServices()
D 16:05:46.865 [Broadcast] Action received: android.bluetooth.device.action.BOND_STATE_CHANGED, bond state changed to: BOND_BONDING (11)
D 16:05:46.924 [Server callback] Connection state changed with status: 0 and new state: DISCONNECTED (0)
I 16:05:46.924 [Server] Device disconnected
D 16:05:46.927 [Broadcast] Action received: android.bluetooth.device.action.BOND_STATE_CHANGED, bond state changed to: BOND_NONE (10)
I 16:05:46.930 Bonding failed
D 16:05:46.931 [Callback] Connection state changed with status: 19 and new state: DISCONNECTED (0)
W 16:05:46.931 Connection terminated by peer (status 19)
I 16:05:46.931 Disconnected
D 16:05:47.042 [Broadcast] Action received: android.bluetooth.device.action.ACL_DISCONNECTED&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I have also seen logs similar to your with failure occurring after a&amp;nbsp;GATT INSUF AUTHORIZATION message (See attached log)&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/bonding_2D00_removed_2D00_nrf_2D00_connect_2D00_log.txt"&gt;devzone.nordicsemi.com/.../bonding_2D00_removed_2D00_nrf_2D00_connect_2D00_log.txt&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I haven&amp;#39;t had a chance to test, but you could try using the Android HCI snoop log to get more information about what is happening at the BLE HCI layer when this happens.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.fte.com/WebHelp/BPA600/Content/Documentation/WhitePapers/BPA600/Encryption/GettingAndroidLinkKey/RetrievingHCIlog.htm"&gt;http://www.fte.com/WebHelp/BPA600/Content/Documentation/WhitePapers/BPA600/Encryption/GettingAndroidLinkKey/RetrievingHCIlog.htm&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Android Automatically Unbonding on Reconnection</title><link>https://devzone.nordicsemi.com/thread/147833?ContentTypeID=1</link><pubDate>Fri, 07 Sep 2018 14:26:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f5cf1f66-4c10-46ce-9a8d-30ad7fe56340</guid><dc:creator>Mttrinh</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I didn&amp;#39;t manage to reproduce the issue. Tested with a Nexus 6 and a nRF52-DK(nRF52832) running ANCS example. Can you tell me how to reproduce it? Also, could you send me a sniffer trace?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>