<?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 pairing pop-up appears twice</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/81227/android-pairing-pop-up-appears-twice</link><description>Hi, 
 I am writing an app for nRF52840 with sdk 17.0.2 and freeRTOS. 
 The device should be a peripheral which a android app should be able to connect to. 
 Everthing works but when I use an android app for connecting like &amp;quot;NRF Connect&amp;quot; the pairing popup</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Sun, 10 Mar 2024 07:49:10 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/81227/android-pairing-pop-up-appears-twice" /><item><title>RE: Android pairing pop-up appears twice</title><link>https://devzone.nordicsemi.com/thread/473057?ContentTypeID=1</link><pubDate>Sun, 10 Mar 2024 07:49:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3cd126d7-6474-49e2-8749-77cf9a098aac</guid><dc:creator>EbonyH</dc:creator><description>&lt;p&gt;Hi Andreas,&lt;/p&gt;
&lt;p&gt;&amp;nbsp; Can you please share the example code to solve the popup twice issue?&lt;/p&gt;
&lt;p&gt;Ebony&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Android pairing pop-up appears twice</title><link>https://devzone.nordicsemi.com/thread/344578?ContentTypeID=1</link><pubDate>Tue, 21 Dec 2021 11:48:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0c9f0451-5918-4e46-97a3-0e62876dc623</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;Thank you for sharing your solution with us. I&amp;#39;ll report your findings internally. Good job! I&amp;#39;m glad you got it working. Just for reference, the security level was set to SEC_MITM previously, correct?&lt;/p&gt;
&lt;p&gt;Best regards and happy Holidays,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Android pairing pop-up appears twice</title><link>https://devzone.nordicsemi.com/thread/344424?ContentTypeID=1</link><pubDate>Mon, 20 Dec 2021 15:56:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:60f88a36-58d4-46e2-8eb6-9fd8292594e5</guid><dc:creator>Andreas48752</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;well I did test with the delay. My phone says all services are discovered before connection is secured but popup still showed twice.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I found a workaround: I set characteristics read and write access to &amp;quot;SEC_JUST_WORKS&amp;quot;. So connection must be secured and mobile will start encryption. Pairing popup only shows once now.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Andreas&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Android pairing pop-up appears twice</title><link>https://devzone.nordicsemi.com/thread/343134?ContentTypeID=1</link><pubDate>Mon, 13 Dec 2021 11:30:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:560d9731-d2da-489c-8ae9-c00632e51fe1</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;The root cause is&amp;nbsp;that the SoftDevice sends a&amp;nbsp;&lt;span&gt;security request before the remote initiates LL encryption, so the o&lt;/span&gt;nly thing I can think of is to add the delay I mentioned earlier, so that the device has a chance to complete service discovery before this event is called.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Android pairing pop-up appears twice</title><link>https://devzone.nordicsemi.com/thread/343042?ContentTypeID=1</link><pubDate>Sun, 12 Dec 2021 22:32:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1375e11c-ed77-4722-90d4-7b9fb3fe8629</guid><dc:creator>Andreas48752</dc:creator><description>&lt;p&gt;Hi!&lt;/p&gt;
&lt;p&gt;Sorry for the late reply!&lt;/p&gt;
&lt;p&gt;Yes, I commented out the pm_handler_on_pm_evt() but then no pairing is done at all.&lt;/p&gt;
&lt;p&gt;Till now I don&amp;#39;t have a solution for this. I still having two popups or no pairing at all...&lt;/p&gt;
&lt;p&gt;Any other toughts on this?&lt;/p&gt;
&lt;p&gt;Thanks und best regards,&lt;/p&gt;
&lt;p&gt;Andreas&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Android pairing pop-up appears twice</title><link>https://devzone.nordicsemi.com/thread/339757?ContentTypeID=1</link><pubDate>Fri, 19 Nov 2021 08:19:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:19222b66-2b94-4333-8601-998dfea9f0d8</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;Have you tried removing (commenting out) a&amp;nbsp;&lt;span&gt;pm_handler_on_pm_evt() call in your application?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Simon&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Android pairing pop-up appears twice</title><link>https://devzone.nordicsemi.com/thread/339686?ContentTypeID=1</link><pubDate>Thu, 18 Nov 2021 14:50:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f2cef741-2068-4796-ae97-fea749d01a40</guid><dc:creator>Andreas48752</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;thank you for looking into that again.&lt;/p&gt;
&lt;p&gt;I changed my code. Now I invoke&amp;nbsp;&lt;span&gt;&amp;quot;smd_link_secure&amp;quot;&amp;nbsp;&lt;/span&gt;a few seconds after mobile gets connected. Now I see &amp;quot;services discovered&amp;quot; on my mobile app before sending &amp;quot;smd_link_secure&amp;quot;. I changed to &amp;quot;smd_link_secure&amp;quot;:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;ble_gap_sec_params_t sec_param;
memset(&amp;amp;sec_param, 0, sizeof(ble_gap_sec_params_t));

// Security parameters to be used for all security procedures.
sec_param.bond = SEC_PARAM_BOND; // =1
sec_param.mitm = SEC_PARAM_MITM; // =0
sec_param.lesc = SEC_PARAM_LESC;// =1

sec_param.keypress = SEC_PARAM_KEYPRESS; // =0
sec_param.io_caps = SEC_PARAM_IO_CAPABILITIES; // =3
sec_param.oob = SEC_PARAM_OOB; // =0
sec_param.min_key_size = SEC_PARAM_MIN_KEY_SIZE; // = 7
sec_param.max_key_size = SEC_PARAM_MAX_KEY_SIZE; // = 16
sec_param.kdist_own.enc = 1;
sec_param.kdist_own.id = 1;
sec_param.kdist_peer.enc = 1;
sec_param.kdist_peer.id = 1;

smd_link_secure(handle, &amp;amp;sec_param, true);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;But I still get &amp;quot;PM_EVT_CONN_SEC_PARAMS_REQ&amp;quot; in&amp;nbsp;pm_evt_handler twice after&amp;nbsp;that.&lt;/p&gt;
&lt;p&gt;I see pairing popup on mobile&amp;nbsp;after&amp;nbsp;invoking &amp;quot;&lt;span&gt;smd_link_secure&amp;quot; but when I accept that I get the second &amp;quot;PM_EVT_CONN_SEC_PARAMS_REQ&amp;nbsp;&amp;quot; request and after I&amp;nbsp;see this&amp;nbsp;a second pairing popup on the mobile.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;It looks like the mobile tries to pair again or use other settings? This is a breakpoint at second &amp;quot;PM_EVT_CONN_SEC_PARAMS_REQ&amp;quot;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1637246937485v1.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;I found some who has the same problem, but he also got no answer:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;a href="https://stackoverflow.com/questions/67701354/why-do-i-receive-a-message-twice-asking-me-if-i-want-to-pair-with-lesc-just-work"&gt;https://stackoverflow.com/questions/67701354/why-do-i-receive-a-message-twice-asking-me-if-i-want-to-pair-with-lesc-just-work&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Many thanks on your effort! Maybe you can help further?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Andreas&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Android pairing pop-up appears twice</title><link>https://devzone.nordicsemi.com/thread/339552?ContentTypeID=1</link><pubDate>Thu, 18 Nov 2021 07:21:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f7ab865f-a552-4a1f-9a68-fafcf27e5514</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;We have&amp;nbsp;taken another look at your sniffer trace, and it seems like the peripheral is issuing a security request on connection before the client has a chance to perform service discovery. Are you calling pm_handler_on_pm_evt() from your PM callback? If so, you can try adding a delay using pm_handler_sec_delay_ms or comment out pm_handler_on_pm_evt() entirely.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Android pairing pop-up appears twice</title><link>https://devzone.nordicsemi.com/thread/337514?ContentTypeID=1</link><pubDate>Thu, 04 Nov 2021 14:13:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3ee20913-1240-4eb7-9461-b282740abc36</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;The second&amp;nbsp;&lt;/span&gt;&lt;span&gt;pairing messages window is used to send pairing DHKey Check or not from the mobile. See the&amp;nbsp;&lt;a title="Pairing: Just Works" href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s140.api.v7.2.0/group___b_l_e___g_a_p___p_e_r_i_p_h___l_e_s_c___p_a_i_r_i_n_g___j_w___m_s_c.html?cp=4_7_4_1_2_1_5_10_6_4"&gt;Pairing: Just Works&lt;/a&gt;&amp;nbsp;procedure.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/63200.PNG" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Our Android expert has no idea about why Android reacts that. You might seek help from other forums as you did.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;-Amanda&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Android pairing pop-up appears twice</title><link>https://devzone.nordicsemi.com/thread/337400?ContentTypeID=1</link><pubDate>Thu, 04 Nov 2021 08:00:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4ac5e728-31e9-44ba-baef-31622f8e29ea</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Sorry. It&amp;#39;s my tool&amp;#39;s issue. After updating the version, I can see the content. I am looking into the log now.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;-Amanda&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Android pairing pop-up appears twice</title><link>https://devzone.nordicsemi.com/thread/337301?ContentTypeID=1</link><pubDate>Wed, 03 Nov 2021 14:17:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:737102b7-69ef-433a-b705-e75b06b500ba</guid><dc:creator>Andreas48752</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;sorry, but the provided log already starts before making the connection. At first you only see advertising packets and around second 9.5 a connection is established.&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t think another log would be different?&lt;/p&gt;
&lt;p&gt;Andreas&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Android pairing pop-up appears twice</title><link>https://devzone.nordicsemi.com/thread/337288?ContentTypeID=1</link><pubDate>Wed, 03 Nov 2021 13:49:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:62c5b03a-0047-4cb2-999a-11285646a5b2</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Please capture the log before starting the connection and upload it again. Thanks.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;-Amanda&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Android pairing pop-up appears twice</title><link>https://devzone.nordicsemi.com/thread/337076?ContentTypeID=1</link><pubDate>Tue, 02 Nov 2021 12:11:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3682918a-360b-4d9c-8127-c7ac2f320a9d</guid><dc:creator>Andreas48752</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;attached you will find the wireshark trace.&lt;/p&gt;
&lt;p&gt;The MAC of the peripheral is C0.E3.F7.8A.4F.76&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/2604.Trace.pcapng"&gt;devzone.nordicsemi.com/.../2604.Trace.pcapng&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Android pairing pop-up appears twice</title><link>https://devzone.nordicsemi.com/thread/337069?ContentTypeID=1</link><pubDate>Tue, 02 Nov 2021 11:58:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c4196ce8-dfbf-471d-ae42-a8d4c83c7008</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I have updated the link.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Here is the link&amp;nbsp;&lt;a href="https://www.nordicsemi.com/Products/Development-tools/nrf-sniffer-for-bluetooth-le"&gt;https://www.nordicsemi.com/Products/Development-tools/nrf-sniffer-for-bluetooth-le&lt;/a&gt;&amp;nbsp;again and the documentation&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/topic/ug_sniffer_ble/UG/sniffer_ble/intro.html"&gt;https://infocenter.nordicsemi.com/topic/ug_sniffer_ble/UG/sniffer_ble/intro.html&lt;/a&gt;.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;-Amanda&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Android pairing pop-up appears twice</title><link>https://devzone.nordicsemi.com/thread/337024?ContentTypeID=1</link><pubDate>Tue, 02 Nov 2021 09:54:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f6bf07f0-12ef-4d8e-8810-84f13348ad8c</guid><dc:creator>Andreas48752</dc:creator><description>&lt;p&gt;Hi Amanda,&lt;/p&gt;
&lt;p&gt;thank you for your reply.&lt;/p&gt;
&lt;p&gt;Well unfortunately your provided link is broken. I managed to install the sniffer for wireshark but there I only can see advertising packets?&lt;/p&gt;
&lt;p&gt;Maybe you can give me more detailed instructions on how to capture that log?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I provided the log of nRF Connect above? Can&amp;#39;t you see anything there?&lt;/p&gt;
&lt;p&gt;Thanks, Andreas&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Android pairing pop-up appears twice</title><link>https://devzone.nordicsemi.com/thread/336893?ContentTypeID=1</link><pubDate>Mon, 01 Nov 2021 13:53:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1e10d29d-db8f-4b93-ad79-d25bdc68aec9</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Please kindly provide the&amp;nbsp;&lt;a href="https://www.nordicsemi.com/Products/Development-tools/nrf-sniffer-for-bluetooth-le"&gt;sniffer log&lt;/a&gt; to help know what happened in the air.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Amanda&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>