<?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>after bonding, when try reconnect,  Failed to authenticate  happen. how can I fix?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/51502/after-bonding-when-try-reconnect-failed-to-authenticate-happen-how-can-i-fix</link><description>I try to bonding. 
 Using SDK 15.3. 0 and S332 Softdevice. 
 I successed bonding procedure used Peer manager. 
 after bonding, If I try to connect one more, nRF Connect app show Failed to authenticate (NRF_ERROR_INVALID_STATE). 
 however connection is</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 21 Apr 2020 09:38:27 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/51502/after-bonding-when-try-reconnect-failed-to-authenticate-happen-how-can-i-fix" /><item><title>RE: after bonding, when try reconnect,  Failed to authenticate  happen. how can I fix?</title><link>https://devzone.nordicsemi.com/thread/245785?ContentTypeID=1</link><pubDate>Tue, 21 Apr 2020 09:38:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c076c9f9-c172-4107-8fa7-540f71c7a3d6</guid><dc:creator>Torsten Robitzki</dc:creator><description>&lt;div class="author"&gt;
&lt;div class="avatar"&gt;&lt;a class="internal-link view-user-profile" href="https://devzone.nordicsemi.com/members/torsten-robitzki"&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div class="content full threaded-reply-content user-defined-markup"&gt;
&lt;div class="content"&gt;
&lt;p&gt;I see the very same effect. I have an application running as peripheral on an nrf52832. Using nRF Connect, I can pair and bond with the peripheral. After disconnecting and reconnecting, I see the peripheral sending a SMP Slave Security Request and in response to that, the nRF Connect starts to encrypt the connection.&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/5460.security_5F00_request.pcapng"&gt;devzone.nordicsemi.com/.../5460.security_5F00_request.pcapng&lt;/a&gt; The connection seems to be usable and encrypted.&lt;/p&gt;
&lt;p&gt;Maybe just an issue in nRF Connect?&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: after bonding, when try reconnect,  Failed to authenticate  happen. how can I fix?</title><link>https://devzone.nordicsemi.com/thread/208906?ContentTypeID=1</link><pubDate>Tue, 10 Sep 2019 11:41:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ec288e0c-ce12-41c2-8276-144b8bc56865</guid><dc:creator>nordzm</dc:creator><description>&lt;p&gt;I have the same problem for the ble_app_multirole_lesc test example.&lt;/p&gt;
&lt;p&gt;Nordic NRF52840 s140&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: after bonding, when try reconnect,  Failed to authenticate  happen. how can I fix?</title><link>https://devzone.nordicsemi.com/thread/208068?ContentTypeID=1</link><pubDate>Thu, 05 Sep 2019 01:14:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5b540afc-343d-439a-9643-ba9fa06e9ebb</guid><dc:creator>BEN_HB</dc:creator><description>&lt;p&gt;Sorry to reply late.&lt;/p&gt;
&lt;p&gt;under below, it is screenshot. I can use characteristisc.&lt;/p&gt;
&lt;p&gt;I think it looks like still pairing. but just try to reconnect, something is problem.&lt;/p&gt;
&lt;p&gt;thank you&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/1460.123.JPG" /&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/2323.JPG" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: after bonding, when try reconnect,  Failed to authenticate  happen. how can I fix?</title><link>https://devzone.nordicsemi.com/thread/206816?ContentTypeID=1</link><pubDate>Thu, 29 Aug 2019 09:31:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6c5dbf54-d74c-43f1-ba98-2c11c2e0c0e4</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Ok. To get the hang of what the issue really is:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user=""]after bonding, If I try to connect one more, nRF Connect app show&amp;nbsp;&lt;span&gt;Failed to authenticate (NRF_ERROR_INVALID_STATE).&lt;/span&gt;[/quote]
&lt;p&gt;&amp;nbsp;Can you send a screenshot of this? It doesn&amp;#39;t disconnect, but it doesn&amp;#39;t get paired? Or what does it look like? Are you not able to use the characteristics that require pairing?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: after bonding, when try reconnect,  Failed to authenticate  happen. how can I fix?</title><link>https://devzone.nordicsemi.com/thread/206811?ContentTypeID=1</link><pubDate>Thu, 29 Aug 2019 09:20:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a5714695-b607-483c-b1fc-336f2d67bb4e</guid><dc:creator>BEN_HB</dc:creator><description>&lt;p&gt;I didn&amp;#39;t allow that. after changed to allow, error is still occurred&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: after bonding, when try reconnect,  Failed to authenticate  happen. how can I fix?</title><link>https://devzone.nordicsemi.com/thread/206788?ContentTypeID=1</link><pubDate>Thu, 29 Aug 2019 08:39:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:63b91e30-b2c2-4caa-9293-af836afb55ba</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;        case PM_EVT_CONN_SEC_CONFIG_REQ:
        {
            pm_conn_sec_config_t conn_sec_config = {.allow_repairing = true};
            pm_conn_sec_config_reply(p_evt-&amp;gt;conn_handle, &amp;amp;conn_sec_config);
        } break;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Does that allow the device to pair again?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;BR,&lt;br /&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: after bonding, when try reconnect,  Failed to authenticate  happen. how can I fix?</title><link>https://devzone.nordicsemi.com/thread/206736?ContentTypeID=1</link><pubDate>Thu, 29 Aug 2019 03:14:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c27dd61f-0003-437c-995e-632c243de8a3</guid><dc:creator>BEN_HB</dc:creator><description>&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/2047.log.pcapng"&gt;devzone.nordicsemi.com/.../2047.log.pcapng&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;using Sniffer , upload file.&lt;/p&gt;
&lt;p&gt;after reconnect, it shows Encrypted packet decrypted incorrectly.&lt;/p&gt;
&lt;p&gt;one more question.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;in file log,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;No.4000, Sent Pairing Request part,&lt;/p&gt;
&lt;p&gt;on Initiator key Distribution,&lt;/p&gt;
&lt;p&gt;Why Id Key(IRK) is false?&lt;/p&gt;
&lt;p&gt;I set only bonding, not use LESC , etc..&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;static void peer_manager_init()
{    
    ret_code_t  err_code;

    err_code = pm_init();
    APP_ERROR_CHECK(err_code);
    //memset(&amp;amp;whitelist, PM_PEER_ID_INVALID, sizeof(whitelist));
    memset(&amp;amp;sec_param, 0, sizeof(sec_param));

    // Security parameters to be used for all security procedures.
    sec_param.bond           = SEC_PARAM_BOND;
    sec_param.mitm           = SEC_PARAM_MITM;
    sec_param.lesc           = SEC_PARAM_LESC;
    sec_param.keypress       = SEC_PARAM_KEYPRESS;
    sec_param.io_caps        = SEC_PARAM_IO_CAPABILITIES;
    sec_param.oob            = SEC_PARAM_OOB;
    sec_param.min_key_size   = SEC_PARAM_MIN_KEY_SIZE;
    sec_param.max_key_size   = SEC_PARAM_MAX_KEY_SIZE;
    sec_param.kdist_own.enc  = 1;
    sec_param.kdist_own.id   = 1;
    sec_param.kdist_peer.enc = 1;
    sec_param.kdist_peer.id  = 1;

    err_code = pm_sec_params_set(&amp;amp;sec_param); 
    // Until this function is called, all bonding procedures that are initiated by the peer are rejected.
    APP_ERROR_CHECK(err_code);        

    err_code = pm_register(pm_evt_handler);
    APP_ERROR_CHECK(err_code);

    NRF_LOG_INFO(&amp;quot;PEER MANAGER INIT END\n&amp;quot;);

    err_code = pm_peers_delete();
    APP_ERROR_CHECK(err_code);
    
    NRF_LOG_INFO(&amp;quot;PEER DELETE END\n&amp;quot;);
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I set&amp;nbsp;&lt;/p&gt;
&lt;p&gt;sec_param.kdist_own.id = 1;&lt;br /&gt;sec_param.kdist_peer.id = 1;&lt;/p&gt;
&lt;p&gt;is it not set about irk?&lt;/p&gt;
&lt;p&gt;Thank you&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: after bonding, when try reconnect,  Failed to authenticate  happen. how can I fix?</title><link>https://devzone.nordicsemi.com/thread/206734?ContentTypeID=1</link><pubDate>Thu, 29 Aug 2019 01:37:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5cc501b6-9c11-4f7f-907b-f6b7192967db</guid><dc:creator>BEN_HB</dc:creator><description>&lt;p&gt;if remove,&amp;nbsp;&lt;span&gt;sd_ble_gap_sec_info_reply error log is removed , but nRF Connect still occurred same error&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: after bonding, when try reconnect,  Failed to authenticate  happen. how can I fix?</title><link>https://devzone.nordicsemi.com/thread/206616?ContentTypeID=1</link><pubDate>Wed, 28 Aug 2019 12:10:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6c1dee4f-a8f0-44dc-ad5c-3d548fbd2ad4</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;There are several handlers that handles the different SoftDevice events. One of them is smd_ble_evt_handler() in security_dispatcher.c. This one calls:&lt;/p&gt;
&lt;p&gt;sec_info_request_process() in the&amp;nbsp;BLE_GAP_EVT_SEC_INFO_REQUEST event. This function will also call:&lt;/p&gt;
&lt;p&gt;sd_ble_gap_sec_info_reply(), and print:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;        NRF_LOG_WARNING(&amp;quot;sd_ble_gap_sec_info_reply() returned NRF_EROR_INVALID_STATE, which is an&amp;quot;\
                        &amp;quot;error unless the link is disconnecting.&amp;quot;);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;if it returns NRF_ERROR_INVALID_STATE.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;My guess is that since it is called twice (once where you implemented it, and once in the security_dispatcher.c), one of them will return NRF_ERROR_INVALID_STATE.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;What happens if you remove your call to sd_ble_gap_sec_info_reply()?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>