<?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>LwM2M Client Sample on nRF9151 DK not connecting to public Leshan server</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/125448/lwm2m-client-sample-on-nrf9151-dk-not-connecting-to-public-leshan-server</link><description>We&amp;#39;ve a nRF9151 DK for which we built the Nordic Semiconductor LwM2M Client sample using SDK 3.0.2 (modem firmware 2.0.2). 
 We followed all steps listed in https://docs.nordicsemi.com/bundle/ncs-3.0.2/page/nrf/samples/cellular/lwm2m_client/sample_description</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 27 Nov 2025 08:42:33 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/125448/lwm2m-client-sample-on-nrf9151-dk-not-connecting-to-public-leshan-server" /><item><title>RE: LwM2M Client Sample on nRF9151 DK not connecting to public Leshan server</title><link>https://devzone.nordicsemi.com/thread/555576?ContentTypeID=1</link><pubDate>Thu, 27 Nov 2025 08:42:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2369f63b-809a-4dcf-9a0f-7b26303ce332</guid><dc:creator>JOEBRE</dc:creator><description>&lt;p&gt;Hello&amp;nbsp; ... &amp;Oslash;yvind, many thanks for the input..&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Your input solved the LTE network connection issue.&lt;/p&gt;
&lt;p&gt;The nRF9151 LwM2M is now connecting both to the public Leshan and to our custom server ...&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Many thanks for the support!&lt;/p&gt;
&lt;p&gt;Cheers, Joel&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: LwM2M Client Sample on nRF9151 DK not connecting to public Leshan server</title><link>https://devzone.nordicsemi.com/thread/555524?ContentTypeID=1</link><pubDate>Wed, 26 Nov 2025 14:03:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a16e48cb-cd3f-4073-9f63-f641262951b9</guid><dc:creator>&amp;#216;yvind</dc:creator><description>&lt;p&gt;Hello again Joel, I have finally got a suggestion/solution to your issue.&lt;/p&gt;
&lt;p&gt;The problem is that network reconnection fails after updating the credentials, because the SIM requires a PIN code to reconnect. By default, the modem mode change callback does not handle PIN entry. To resolve this, the customer should implement a custom callback for handling modem mode that can manage entering the SIM PIN when required.&lt;/p&gt;
&lt;p&gt;The default callback implementation can be found from here &lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;a href="https://github.com/nrfconnect/sdk-nrf/blob/0ffb46b8b9ae31bfd313a49789844406f4fb1fdb/subsys/net/lib/lwm2m_client_utils/lwm2m/lwm2m_security.c#L48"&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;sdk-nrf/subsys/net/lib/lwm2m_client_utils/lwm2m/lwm2m_security.c at 0ffb46b8b9ae31bfd313a49789844406f4fb1fdb · nrfconnect/sdk-nrf&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;You can set your own callback function using &lt;code&gt;lwm2m_init_security()&lt;/code&gt; &lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;a href="https://github.com/nrfconnect/sdk-nrf/blob/0ffb46b8b9ae31bfd313a49789844406f4fb1fdb/samples/cellular/lwm2m_client/src/main.c#L272"&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;sdk-nrf/samples/cellular/lwm2m_client/src/main.c at 0ffb46b8b9ae31bfd313a49789844406f4fb1fdb · nrfconnect/sdk-nrf&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Below is an example of the required changes to the sample. Please note, we&amp;#39;re not able to test the PIN registration but based on the log from customer check_and_unlock_sim() works and the device can connect to the network.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;diff --git a/samples/cellular/lwm2m_client/src/main.c b/samples/cellular/lwm2m_client/src/main.c
index da7d863049..b2e51301f0 100644
--- a/samples/cellular/lwm2m_client/src/main.c
+++ b/samples/cellular/lwm2m_client/src/main.c
@@ -261,15 +261,53 @@ static int lwm2m_firmware_event_cb(struct lwm2m_fota_event *event)
 }
 #endif
 
+static int lwm2m_modem_mode_cb(enum lte_lc_func_mode new_mode, void *user_data)
+{
+       enum lte_lc_func_mode fmode;
+       int ret;
+
+       if (lte_lc_func_mode_get(&amp;amp;fmode)) {
+               LOG_ERR(&amp;quot;Failed to read modem functional mode&amp;quot;);
+               ret = -EFAULT;
+               return ret;
+       }
+
+       if (new_mode == LTE_LC_FUNC_MODE_NORMAL) {
+               /* I need to use the blocking call, because in next step
+                * LwM2M engine would create socket and call connect()
+                */
+
+               check_and_unlock_sim();
+               ret = lte_lc_connect();
+
+               if (ret) {
+                       LOG_ERR(&amp;quot;lte_lc_connect() failed %d&amp;quot;, ret);
+               }
+               LOG_INF(&amp;quot;Modem connection restored&amp;quot;);
+       } else {
+               ret = lte_lc_func_mode_set(new_mode);
+               if (ret == 0) {
+                       LOG_DBG(&amp;quot;Modem set to requested state %d&amp;quot;, new_mode);
+               }
+       }
+
+       return ret;
+}
+
 static int lwm2m_setup(void)
 {
+       struct modem_mode_change mmode;
+
+       mmode.cb = lwm2m_modem_mode_cb;
+       mmode.user_data = NULL;
+
        /* Save power by not updating timestamp on device object */
        lwm2m_update_device_service_period(0);
 
        /* Manufacturer dependent */
        /* use IMEI as serial number */
        lwm2m_app_init_device(imei_buf);
-       lwm2m_init_security(&amp;amp;client, endpoint_name, NULL);
+       lwm2m_init_security(&amp;amp;client, endpoint_name, &amp;amp;mmode);
 
        if (sizeof(CONFIG_APP_LWM2M_PSK) &amp;gt; 1) {
                /* Write hard-coded PSK key to engine */

&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Let us know how that works for you!&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;br /&gt;Øyvind&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: LwM2M Client Sample on nRF9151 DK not connecting to public Leshan server</title><link>https://devzone.nordicsemi.com/thread/555071?ContentTypeID=1</link><pubDate>Fri, 21 Nov 2025 14:39:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:159fecf8-0051-4136-b79d-e8c66870244a</guid><dc:creator>&amp;#216;yvind</dc:creator><description>&lt;p&gt;Hey Joel,&amp;nbsp;I forwarded your modem trace to our experts to have a look at this. Hope to have an answer by end of Tuesday.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Kind regards,&lt;br /&gt;Øyvind&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: LwM2M Client Sample on nRF9151 DK not connecting to public Leshan server</title><link>https://devzone.nordicsemi.com/thread/554825?ContentTypeID=1</link><pubDate>Wed, 19 Nov 2025 15:36:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:602c8e12-0e85-4ba1-966b-b7926a56da83</guid><dc:creator>JOEBRE</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&amp;Oslash;yvind. The Cellular modem tells me that itinitialli connects to LETE and goes into IP mode (received it&amp;#39;s IP).. but then when the modem is switched into CFUN 4 for provisioning and set bach into CFUN 1 after it it hangs somewhere and the console simply reports:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;*** Booting nRF Connect SDK v3.1.0-6c6e5b32496e ***
*** Using Zephyr OS v4.1.99-1612683d4010 ***
[00:00:01.140,625] &amp;lt;inf&amp;gt; app_lwm2m_client: Run LWM2M client
[00:00:01.409,606] &amp;lt;inf&amp;gt; nrf_modem_lib_trace: Trace thread ready
[00:00:01.417,724] &amp;lt;inf&amp;gt; nrf_modem_lib_trace: Trace level override: 2
[00:00:01.479,187] &amp;lt;inf&amp;gt; app_lwm2m_client: endpoint: urn:imei:359404230143209
[00:00:01.914,886] &amp;lt;inf&amp;gt; lwm2m_lte_notification: Registering ncell notification handler
[00:00:01.914,978] &amp;lt;inf&amp;gt; lwm2m_firmware: Image is confirmed OK
[00:00:01.914,978] &amp;lt;inf&amp;gt; app_lwm2m_client: Connecting to network.
[00:00:01.915,008] &amp;lt;inf&amp;gt; app_lwm2m_client: This may take several minutes.
[00:00:01.977,935] &amp;lt;inf&amp;gt; app_lwm2m_client: CFUN response: +CFUN: 0
OK

[00:00:01.977,996] &amp;lt;inf&amp;gt; app_lwm2m_client: CFUN is 0, setting to 1...
[00:00:04.024,780] &amp;lt;inf&amp;gt; app_lwm2m_client: Response: +CPIN: SIM PIN
OK

[00:00:04.024,841] &amp;lt;inf&amp;gt; app_lwm2m_client: SIM requires PIN, entering...
[00:00:07.058,715] &amp;lt;inf&amp;gt; app_lwm2m_client: Connected to LTE network
[00:00:07.058,746] &amp;lt;inf&amp;gt; app_lwm2m_client: Client connect to server
[00:00:07.058,807] &amp;lt;inf&amp;gt; net_lwm2m_rd_client: Start LWM2M Client: urn:imei:359404230143209
[00:00:07.059,234] &amp;lt;inf&amp;gt; net_lwm2m_rd_client: RD Client started with endpoint &amp;#39;urn:imei:359404230143209&amp;#39; with client lifetime 43200 using server object 0
[00:00:07.059,478] &amp;lt;inf&amp;gt; app_lwm2m_client: LwM2M is connecting to server
[00:00:07.203,918] &amp;lt;inf&amp;gt; lwm2m_security: Need to write credentials, requesting LTE and GNSS offline...
[00:00:07.881,805] &amp;lt;inf&amp;gt; lwm2m_security: Requesting LTE and GNSS online
[00:10:07.923,217] &amp;lt;inf&amp;gt; lte_lc: Network connection attempt timed out
[00:10:07.927,368] &amp;lt;err&amp;gt; lwm2m_security: lte_lc_connect() failed -116
[00:10:07.927,398] &amp;lt;inf&amp;gt; lwm2m_security: Modem connection restored
[00:10:07.927,429] &amp;lt;err&amp;gt; net_lwm2m_rd_client: Cannot init LWM2M engine (-116)
[00:10:07.927,612] &amp;lt;err&amp;gt; net_lwm2m_rd_client: sm_do_network_error, retries 0
[00:10:07.927,764] &amp;lt;inf&amp;gt; net_lwm2m_rd_client: RD Client started with endpoint &amp;#39;urn:imei:359404230143209&amp;#39; with client lifetime 43200 using server object 0
[00:10:07.934,570] &amp;lt;err&amp;gt; net_lwm2m_message_handling: Unable to resolve address
[00:10:07.934,600] &amp;lt;err&amp;gt; net_lwm2m_rd_client: Cannot init LWM2M engine (-2)
[00:10:07.934,783] &amp;lt;err&amp;gt; net_lwm2m_rd_client: sm_do_network_error, retries 1
[00:10:08.935,150] &amp;lt;err&amp;gt; net_lwm2m_rd_client: sm_do_network_error, retries 1
[00:10:08.935,272] &amp;lt;inf&amp;gt; net_lwm2m_rd_client: RD Client started with endpoint &amp;#39;urn:imei:359404230143209&amp;#39; with client lifetime 43200 using server object 0
[00:10:08.944,396] &amp;lt;err&amp;gt; net_lwm2m_message_handling: Unable to resolve address
[00:10:08.944,396] &amp;lt;err&amp;gt; net_lwm2m_rd_client: Cannot init LWM2M engine (-2)
[00:10:08.944,610] &amp;lt;err&amp;gt; net_lwm2m_rd_client: sm_do_network_error, retries 2
[00:10:10.944,946] &amp;lt;err&amp;gt; net_lwm2m_rd_client: sm_do_network_error, retries 2
[00:10:10.945,190] &amp;lt;inf&amp;gt; net_lwm2m_rd_client: RD Client started with endpoint &amp;#39;urn:imei:359404230143209&amp;#39; with client lifetime 43200 using server object 0
[00:10:10.954,254] &amp;lt;err&amp;gt; net_lwm2m_message_handling: Unable to resolve address
[00:10:10.954,284] &amp;lt;err&amp;gt; net_lwm2m_rd_client: Cannot init LWM2M engine (-2)
[00:10:10.954,467] &amp;lt;err&amp;gt; net_lwm2m_rd_client: sm_do_network_error, retries 3
[00:10:14.954,833] &amp;lt;err&amp;gt; net_lwm2m_rd_client: sm_do_network_error, retries 3&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/trace_2D00_2025_2D00_11_2D00_19T15_2D00_24_2D00_37.925Z.mtrace"&gt;devzone.nordicsemi.com/.../trace_2D00_2025_2D00_11_2D00_19T15_2D00_24_2D00_37.925Z.mtrace&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/Wireshark_5F00_capture.pcapng"&gt;devzone.nordicsemi.com/.../Wireshark_5F00_capture.pcapng&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The client code is the original one as provided in SDK 3.1.0 with exception of the SIM PIN stuff (required fro the SIM I&amp;#39;m using).&lt;/p&gt;
&lt;p&gt;After 10 minutes ow waiting to get online a timeout is triggered.&lt;/p&gt;
&lt;p&gt;Joel&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: LwM2M Client Sample on nRF9151 DK not connecting to public Leshan server</title><link>https://devzone.nordicsemi.com/thread/554775?ContentTypeID=1</link><pubDate>Wed, 19 Nov 2025 11:36:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7f6502f7-f4a7-4549-a9dd-87bc17a1c621</guid><dc:creator>&amp;#216;yvind</dc:creator><description>&lt;p&gt;Hi Joel, sorry my answer did not get sent to you.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Your connection is timing out i.e.&lt;code&gt;&amp;nbsp;#define NRF_ETIMEDOUT 116 &amp;nbsp; &amp;nbsp; &amp;nbsp; /**&amp;lt; Connection timed out */&lt;/code&gt; and&amp;nbsp;&lt;code&gt;&lt;span&gt;#define&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;NRF_ENOENT&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;2&lt;/span&gt;&lt;span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;/**&amp;lt; No such file or directory */&lt;/span&gt;&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Are you able to provide the .mtrace modem trace file as well? How long did you leave the modem trace running? Does your device receive an IP address? Based on the logs, which you probably know already, it looks like there is an issue with &lt;code&gt;lwm2m_modem_mode_cb&lt;/code&gt; in&amp;nbsp;&amp;nbsp;&lt;code&gt;nrf\subsys\net\lib\lwm2m_client_utils\lwm2m\lwm2m_security.c&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;br /&gt;Øyvind&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: LwM2M Client Sample on nRF9151 DK not connecting to public Leshan server</title><link>https://devzone.nordicsemi.com/thread/554647?ContentTypeID=1</link><pubDate>Tue, 18 Nov 2025 08:42:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:14f477ef-38ad-42a8-9b2a-d15a9d04b95f</guid><dc:creator>JOEBRE</dc:creator><description>&lt;p&gt;Can anybody help ?&lt;/p&gt;
&lt;p&gt;Thanks, Joel&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: LwM2M Client Sample on nRF9151 DK not connecting to public Leshan server</title><link>https://devzone.nordicsemi.com/thread/554343?ContentTypeID=1</link><pubDate>Fri, 14 Nov 2025 07:52:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:61e9c12d-ae81-4c2c-9b7f-c373b80f1b96</guid><dc:creator>JOEBRE</dc:creator><description>&lt;p&gt;issue with LwM2M not connecting to public Leshan server is not related to the DTLS issue on my other thread..&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: LwM2M Client Sample on nRF9151 DK not connecting to public Leshan server</title><link>https://devzone.nordicsemi.com/thread/554077?ContentTypeID=1</link><pubDate>Wed, 12 Nov 2025 08:59:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d6c39e41-4b8f-4f98-94ae-63d772230c44</guid><dc:creator>JOEBRE</dc:creator><description>&lt;p&gt;In the meanwhile we switched to SDK 3.1.0. We regenerated the NRF LwM2M Client from original sample. We just added:&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;#define SIM_PIN &amp;quot;8365&amp;quot;
bool check_and_set_cfun()
{
    char response[64];
    int ret = nrf_modem_at_cmd(response, sizeof(response), &amp;quot;AT+CFUN?&amp;quot;);
    if (ret &amp;lt; 0) {
        LOG_ERR(&amp;quot;Failed to send AT+CFUN? (%d)&amp;quot;, ret);
        return false;
    }

    LOG_INF(&amp;quot;CFUN response: %s&amp;quot;, response);

    int cfun = -1;
    if (sscanf(response, &amp;quot;+CFUN: %d&amp;quot;, &amp;amp;cfun) == 1) {
        if (cfun == 1) {
            LOG_INF(&amp;quot;CFUN is %d.&amp;quot;,cfun );
            return true;
        } else {
            LOG_INF(&amp;quot;CFUN is %d, setting to 1...&amp;quot;, cfun);
            ret = nrf_modem_at_printf(&amp;quot;AT+CFUN=1&amp;quot;);
            if (ret &amp;lt; 0) {
                LOG_ERR(&amp;quot;Failed to set CFUN (%d)&amp;quot;, ret);
                return false;
            }
            k_sleep(K_SECONDS(2));
            return true;
        }
    } else {
        LOG_ERR(&amp;quot;Could not parse CFUN response.&amp;quot;);
        return false;
    }
}

bool check_and_unlock_sim()
{
	check_and_set_cfun();
    char response[64];
    int ret = nrf_modem_at_cmd(response, sizeof(response), &amp;quot;AT+CPIN?&amp;quot;);
    if (ret &amp;lt; 0) {
        LOG_ERR(&amp;quot;Failed to send AT+CPIN? (%d)&amp;quot;, ret);
        return false;
    }

    LOG_INF(&amp;quot;Response: %s&amp;quot;, response);

    if (strstr(response, &amp;quot;READY&amp;quot;)) {
        LOG_INF(&amp;quot;SIM is already unlocked.&amp;quot;);
        return true;
    }

    if (strstr(response, &amp;quot;SIM PIN&amp;quot;)) {
        LOG_INF(&amp;quot;SIM requires PIN, entering...&amp;quot;);
        ret = nrf_modem_at_printf(&amp;quot;AT+CPIN=\&amp;quot;%s\&amp;quot;&amp;quot;, SIM_PIN);
        if (ret &amp;lt; 0) {
            LOG_ERR(&amp;quot;Failed to send PIN (%d)&amp;quot;, ret);
            return false;
        }

        // Wait a bit for SIM to unlock
        k_sleep(K_SECONDS(3));

        // Verify again
        ret = nrf_modem_at_cmd(response, sizeof(response), &amp;quot;AT+CPIN?&amp;quot;);
        if (ret &amp;gt;= 0 &amp;amp;&amp;amp; strstr(response, &amp;quot;READY&amp;quot;)) {
            LOG_INF(&amp;quot;SIM unlocked successfully.&amp;quot;);
            return true;
        } else {
            LOG_ERR(&amp;quot;Failed to unlock SIM, response: %s&amp;quot;, response);
            return false;
        }
    }

    LOG_WRN(&amp;quot;Unexpected SIM state: %s&amp;quot;, response);
    return false;
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;To enter the SIM PIN and set CFUN 1 when required.&lt;/p&gt;
&lt;p&gt;check_and_unlock_sim() is called in:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;static void modem_connect(void)
{
	int ret;
	do {
		LOG_INF(&amp;quot;Connecting to network.&amp;quot;);
		LOG_INF(&amp;quot;This may take several minutes.&amp;quot;);
 		check_and_unlock_sim();
		ret = lte_lc_connect();
		if (ret &amp;lt; 0) {
			LOG_WRN(&amp;quot;Failed to establish LTE connection (%d).&amp;quot;, ret);
			LOG_WRN(&amp;quot;Will retry in a minute.&amp;quot;);
			lte_lc_offline();
			k_sleep(K_SECONDS(15));
		} else {&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;We&amp;#39;re seeing now a different problem:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;*** Booting nRF Connect SDK v3.1.0-6c6e5b32496e ***
*** Using Zephyr OS v4.1.99-1612683d4010 ***
[00:00:00.256,744] &amp;lt;inf&amp;gt; app_lwm2m_client: Run LWM2M client
[00:00:00.525,878] &amp;lt;inf&amp;gt; nrf_modem_lib_trace: Trace thread ready
[00:00:00.534,027] &amp;lt;inf&amp;gt; nrf_modem_lib_trace: Trace level override: 2
[00:00:00.595,520] &amp;lt;inf&amp;gt; app_lwm2m_client: endpoint: urn:imei:359404230143217
[00:00:01.030,944] &amp;lt;inf&amp;gt; lwm2m_lte_notification: Registering ncell notification handler
[00:00:01.031,036] &amp;lt;inf&amp;gt; lwm2m_firmware: Image is confirmed OK
[00:00:01.031,066] &amp;lt;inf&amp;gt; app_lwm2m_client: Connecting to network.
[00:00:01.031,097] &amp;lt;inf&amp;gt; app_lwm2m_client: This may take several minutes.
[00:00:01.094,238] &amp;lt;inf&amp;gt; app_lwm2m_client: CFUN response: +CFUN: 0
OK

[00:00:01.094,299] &amp;lt;inf&amp;gt; app_lwm2m_client: CFUN is 0, setting to 1...
[00:00:03.140,533] &amp;lt;inf&amp;gt; app_lwm2m_client: Response: +CPIN: SIM PIN
OK

[00:00:03.140,563] &amp;lt;inf&amp;gt; app_lwm2m_client: SIM requires PIN, entering...
[00:00:06.181,854] &amp;lt;inf&amp;gt; app_lwm2m_client: SIM unlocked successfully.
[00:00:06.195,709] &amp;lt;inf&amp;gt; app_lwm2m_client: Connected to LTE network
[00:00:06.218,414] &amp;lt;inf&amp;gt; app_lwm2m_client: Client connect to server
[00:00:06.218,475] &amp;lt;inf&amp;gt; net_lwm2m_rd_client: Start LWM2M Client: urn:imei:359404230143217
[00:00:06.218,566] &amp;lt;inf&amp;gt; app_lwm2m_client: LwM2M is connecting to server
[00:00:06.218,811] &amp;lt;inf&amp;gt; net_lwm2m_rd_client: RD Client started with endpoint &amp;#39;urn:imei:359404230143217&amp;#39; with client lifetime 43200 using server object 0
[00:00:06.723,358] &amp;lt;inf&amp;gt; lwm2m_security: Need to write credentials, requesting LTE and GNSS offline...
[00:00:08.020,111] &amp;lt;inf&amp;gt; lwm2m_security: Requesting LTE and GNSS online
[00:10:08.061,492] &amp;lt;inf&amp;gt; lte_lc: Network connection attempt timed out
[00:10:08.065,734] &amp;lt;err&amp;gt; lwm2m_security: lte_lc_connect() failed -116
[00:10:08.065,734] &amp;lt;inf&amp;gt; lwm2m_security: Modem connection restored
[00:10:08.065,765] &amp;lt;err&amp;gt; net_lwm2m_rd_client: Cannot init LWM2M engine (-116)
[00:10:08.065,979] &amp;lt;err&amp;gt; net_lwm2m_rd_client: sm_do_network_error, retries 0
[00:10:08.066,162] &amp;lt;inf&amp;gt; net_lwm2m_rd_client: RD Client started with endpoint &amp;#39;urn:imei:359404230143217&amp;#39; with client lifetime 43200 using server object 0
[00:10:08.072,998] &amp;lt;err&amp;gt; net_lwm2m_message_handling: Unable to resolve address
[00:10:08.072,998] &amp;lt;err&amp;gt; net_lwm2m_rd_client: Cannot init LWM2M engine (-2)
[00:10:08.073,181] &amp;lt;err&amp;gt; net_lwm2m_rd_client: sm_do_network_error, retries 1
[00:10:09.073,577] &amp;lt;err&amp;gt; net_lwm2m_rd_client: sm_do_network_error, retries 1
[00:10:09.073,699] &amp;lt;inf&amp;gt; net_lwm2m_rd_client: RD Client started with endpoint &amp;#39;urn:imei:359404230143217&amp;#39; with client lifetime 43200 using server object 0
[00:10:09.082,855] &amp;lt;err&amp;gt; net_lwm2m_message_handling: Unable to resolve address
[00:10:09.082,855] &amp;lt;err&amp;gt; net_lwm2m_rd_client: Cannot init LWM2M engine (-2)
[00:10:09.083,038] &amp;lt;err&amp;gt; net_lwm2m_rd_client: sm_do_network_error, retries 2
[00:10:11.083,374] &amp;lt;err&amp;gt; net_lwm2m_rd_client: sm_do_network_error, retries 2
[00:10:11.083,526] &amp;lt;inf&amp;gt; net_lwm2m_rd_client: RD Client started with endpoint &amp;#39;urn:imei:359404230143217&amp;#39; with client lifetime 43200 using server object 0&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;The client connects to the LTE network successfully but then lwm2m needs to write credential and switches modem into CFUN 4. After this it requests modem to return into CFUN 1 or similar but this never happens or more precisely CFUN 1 is entered but the firmware seems to not catch it (as shown in wireshark_log.pcapng).&lt;/p&gt;
&lt;p&gt;Any suggestion about what is the cause of this behaviour (lwm2m client project is 100% as it can be found in the samples of SDK 3.1.0 with exception of the above mentioned SIM unlock&amp;nbsp; code)?&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/wireshark_5F00_lwm2m_5F00_log.pcapng"&gt;devzone.nordicsemi.com/.../wireshark_5F00_lwm2m_5F00_log.pcapng&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Thanks, Joel&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: LwM2M Client Sample on nRF9151 DK not connecting to public Leshan server</title><link>https://devzone.nordicsemi.com/thread/553528?ContentTypeID=1</link><pubDate>Thu, 06 Nov 2025 09:31:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8580afe3-f9fd-4035-a31d-47311059b4f1</guid><dc:creator>JOEBRE</dc:creator><description>&lt;p&gt;ok understood... I&amp;#39;ll therefore first concentrate on the DTLS handshake issue ...&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: LwM2M Client Sample on nRF9151 DK not connecting to public Leshan server</title><link>https://devzone.nordicsemi.com/thread/553511?ContentTypeID=1</link><pubDate>Thu, 06 Nov 2025 07:24:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2105bde1-e4f6-4fa5-921b-ea75848deb7f</guid><dc:creator>Achim Kraus</dc:creator><description>&lt;p&gt;My bad, I was not that clear.&lt;/p&gt;
&lt;p&gt;I referred to the&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/125433/dtls-psk-handshake-failure-on-nrf9151-dk"&gt;other ticket - DTLS PSK Handshake Failure on nRF9151 DK&lt;/a&gt;&amp;nbsp;and that other ticket refers to an old ticket. I&amp;#39;m not sure, if that is related, but I think, it&amp;#39;s worth to check, if the credentials are provided in the right way. Once the DTLS PSK issue is solved, there maybe some more issues in the lwm2m case.&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: LwM2M Client Sample on nRF9151 DK not connecting to public Leshan server</title><link>https://devzone.nordicsemi.com/thread/553509?ContentTypeID=1</link><pubDate>Thu, 06 Nov 2025 06:46:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:66c07011-7106-4a30-b7aa-698a7242b4c4</guid><dc:creator>JOEBRE</dc:creator><description>&lt;p&gt;Hello, I remember well my ticket of one year ago. This was on an nRF9161 platform and the issue at that time was caused by the usage of the wrong LwM2M Sample (there are two samples: one form Zephyr and one from nrf). At that time the problem was solved by using the right sample (nRF LwM2M Sample). Keeping this in mind, on the nRF9151, I picked up the correct sample (nRF LwM2M Sample) which is now causing me the reported issue. Therefore , the previous ticket do not applies to the issue I&amp;#39;m experiencing.&lt;/p&gt;
&lt;p&gt;Regards, Joel&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: LwM2M Client Sample on nRF9151 DK not connecting to public Leshan server</title><link>https://devzone.nordicsemi.com/thread/553481?ContentTypeID=1</link><pubDate>Wed, 05 Nov 2025 18:25:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6d934ffa-6b64-4886-ae7d-a9ea65bb09cb</guid><dc:creator>Achim Kraus</dc:creator><description>&lt;p&gt;See your other ticket and the link there to an ticket from a year ago.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>