<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://test-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>5340, Zephyr failure to connect to Polar Heart rate strap; ble wireshark trace</title><link>https://test-devzone.nordicsemi.com/f/nordic-q-a/88092/5340-zephyr-failure-to-connect-to-polar-heart-rate-strap-ble-wireshark-trace</link><description>Hi , 
 
 I have compiled in Heart rat relay into my app; can scan and connect to simulator and garmin HR straps; but fail to connect to polar. My debug log shows... 
 
 
 So security is encryption, no auth and I get an &amp;quot;unspecified&amp;quot; error. I have done</description><dc:language>en-US</dc:language><generator>Telligent Community 13 Non-Production</generator><lastBuildDate>Mon, 23 May 2022 12:39:15 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://test-devzone.nordicsemi.com/f/nordic-q-a/88092/5340-zephyr-failure-to-connect-to-polar-heart-rate-strap-ble-wireshark-trace" /><item><title>RE: 5340, Zephyr failure to connect to Polar Heart rate strap; ble wireshark trace</title><link>https://test-devzone.nordicsemi.com/thread/369023?ContentTypeID=1</link><pubDate>Mon, 23 May 2022 12:39:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dd6e593a-0500-44a2-9ab3-b9e92d73cb1b</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hei Owain,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;You are right, the error is from the&amp;nbsp;bt_security_err and it&amp;#39;s&amp;nbsp;BT_SECURITY_ERR_UNSPECIFIED not&amp;nbsp;&lt;span&gt;BT_SMP_ERR_REPEATED_ATTEMPTS.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I&amp;#39;m not so sure why the central didn&amp;#39;t send&amp;nbsp;LL_ENC_REQ (0x03) after receiving pairing Random from the peripheral. It&amp;#39;s most likely the confirm value didn&amp;#39;t match with the random value generated.&amp;nbsp;&lt;br /&gt;You can have a look at this message sequence chart from Bluetooth Spec v5.2 here:&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;img alt=" " src="https://test-devzone.nordicsemi.com/resized-image/__size/892x908/__key/communityserver-discussions-components-files/4/pastedimage1653308943471v1.png" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;My suggestion is to try testing the Polar strap with one of our central HR sample to see if it works. Please try to capture a sniffer trace with that.&lt;br /&gt; Also, I don&amp;#39;t know if removing the battery on the strap would make it clear the bond information or not. But if you can use other device to make a new bond/update bond then it should work with the nRF53.&lt;br /&gt;&lt;br /&gt;I don&amp;#39;t think the order where&amp;nbsp; you do feature/phy request would affect the pairing process. However, you can control when the central starts the pairing process by choosing when to call&amp;nbsp;&lt;/span&gt;bt_conn_set_security()&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: 5340, Zephyr failure to connect to Polar Heart rate strap; ble wireshark trace</title><link>https://test-devzone.nordicsemi.com/thread/368860?ContentTypeID=1</link><pubDate>Fri, 20 May 2022 15:08:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d7ee7f17-394d-4245-a868-00ea93a242ee</guid><dc:creator>user79387</dc:creator><description>&lt;p&gt;static void securityChanged(struct bt_conn *conn, bt_security_t level,&lt;br /&gt; enum bt_security_err err)&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;in my v2.7.99-ncs1-1 zephyr&amp;nbsp; conn.h error 9 says &lt;span&gt;BT_SECURITY_ERR_UNSPECIFIED...&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;enum bt_security_err {&lt;br /&gt; /** Security procedure successful. */&lt;br /&gt; BT_SECURITY_ERR_SUCCESS,&lt;/p&gt;
&lt;p&gt;/** Authentication failed. */&lt;br /&gt; BT_SECURITY_ERR_AUTH_FAIL,&lt;/p&gt;
&lt;p&gt;/** PIN or encryption key is missing. */&lt;br /&gt; BT_SECURITY_ERR_PIN_OR_KEY_MISSING,&lt;/p&gt;
&lt;p&gt;/** OOB data is not available. */&lt;br /&gt; BT_SECURITY_ERR_OOB_NOT_AVAILABLE,&lt;/p&gt;
&lt;p&gt;/** The requested security level could not be reached. */&lt;br /&gt; BT_SECURITY_ERR_AUTH_REQUIREMENT,&lt;/p&gt;
&lt;p&gt;/** Pairing is not supported */&lt;br /&gt; BT_SECURITY_ERR_PAIR_NOT_SUPPORTED,&lt;/p&gt;
&lt;p&gt;/** Pairing is not allowed. */&lt;br /&gt; BT_SECURITY_ERR_PAIR_NOT_ALLOWED,&lt;/p&gt;
&lt;p&gt;/** Invalid parameters. */&lt;br /&gt; BT_SECURITY_ERR_INVALID_PARAM,&lt;/p&gt;
&lt;p&gt;/** Distributed Key Rejected */&lt;br /&gt; BT_SECURITY_ERR_KEY_REJECTED,&lt;/p&gt;
&lt;p&gt;/** Pairing failed but the exact reason could not be specified. */&lt;br /&gt; BT_SECURITY_ERR_UNSPECIFIED,&lt;br /&gt;};&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;You can see in the central I deleted bonds before attempting to connect to the Polar *the bond deleted was for the garmin); I have also removed the coin cell from the polar to ensure it has deleted any bonds.&lt;br /&gt;.&amp;nbsp;&lt;br /&gt;I have made a wireshark trace to Android Nrf toolbox bonding/connecting to the polar; and it is quite different. After connect all feature/phy negotiation occurs before the master proceeds to send pairing information.&lt;br /&gt;&lt;br /&gt;Where as in my trace for nrf5340 and zephyr we just see it immediately start to pair after the connect. This does not seem right. What do you think.&lt;br /&gt;&lt;br /&gt;&lt;a href="https://test-devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/polarConnectFromNrfToolbox.pcapng"&gt;test-devzone.nordicsemi.com/.../polarConnectFromNrfToolbox.pcapng&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: 5340, Zephyr failure to connect to Polar Heart rate strap; ble wireshark trace</title><link>https://test-devzone.nordicsemi.com/thread/368753?ContentTypeID=1</link><pubDate>Fri, 20 May 2022 08:54:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8ef2b785-85ed-4a0a-9d31-736be379c9ad</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Owain,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Error 9 means&amp;nbsp;BT_SMP_ERR_REPEATED_ATTEMPTS. It could suggest that the peer rejected a new bonding. Have you made sure you have remove bonding information on both sides ?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;In the sniffer trace what I can see is that the central didn&amp;#39;t continue to do pairing (sending encryption request) after the Pairing Random is sent.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Could you check on the connection with&amp;nbsp;&lt;span&gt;garmin HR&amp;nbsp;, did the nRF53 bond to that device ?&amp;nbsp;&lt;br /&gt;&lt;/span&gt;And please also check if the phone can bond to the Polar strap.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>