<?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>LTE connection timeout &amp;amp; retry policy</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/95169/lte-connection-timeout-retry-policy</link><description>Hello, 
 in our application, we use nb-iot and PSM with wake-up period of 60 minutes. 
 CONFIG_LTE_NETWORK_TIMEOUT is set to default value (600 seconds). 
 In case bad link quality is present, or no network at all, what behavior should we expect? 
 Let</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 19 Sep 2023 13:49:34 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/95169/lte-connection-timeout-retry-policy" /><item><title>RE: LTE connection timeout &amp; retry policy</title><link>https://devzone.nordicsemi.com/thread/446687?ContentTypeID=1</link><pubDate>Tue, 19 Sep 2023 13:49:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ec1d2ad1-0ff4-40fa-a000-6a143fd7542b</guid><dc:creator>Achim Kraus</dc:creator><description>&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/members/barbiz"&gt;barbiz&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Though this is now some time ago, what is your experience in the meantime with power saving and the network search, maybe with XDATAPRFL or PERIODICSEARCHCONF?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: LTE connection timeout &amp; retry policy</title><link>https://devzone.nordicsemi.com/thread/403678?ContentTypeID=1</link><pubDate>Sat, 07 Jan 2023 11:41:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bebd2f19-c47e-405d-a878-379094b381fe</guid><dc:creator>barbiz</dc:creator><description>&lt;p&gt;Thanks Oyvind,&lt;/p&gt;
&lt;p&gt;we will try that soon and let you know!&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Marco&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: LTE connection timeout &amp; retry policy</title><link>https://devzone.nordicsemi.com/thread/403444?ContentTypeID=1</link><pubDate>Thu, 05 Jan 2023 14:42:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4fcadfa8-69b1-48ca-b85a-0802544b4fcc</guid><dc:creator>&amp;#216;yvind</dc:creator><description>&lt;p&gt;No, does not look like it is, only as an AT command.&lt;/p&gt;
&lt;p&gt;-Øyvind&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: LTE connection timeout &amp; retry policy</title><link>https://devzone.nordicsemi.com/thread/403318?ContentTypeID=1</link><pubDate>Thu, 05 Jan 2023 08:46:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0113c4c1-be6c-4c2a-806e-0aa9ea1ebdb2</guid><dc:creator>barbiz</dc:creator><description>&lt;p&gt;Thanks!&lt;/p&gt;
&lt;p&gt;Is that function also available via lte link controller library?&lt;/p&gt;
&lt;p&gt;Marco&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: LTE connection timeout &amp; retry policy</title><link>https://devzone.nordicsemi.com/thread/403300?ContentTypeID=1</link><pubDate>Thu, 05 Jan 2023 07:53:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8ade301b-8c1e-49e1-801d-c1266c2c2c03</guid><dc:creator>&amp;#216;yvind</dc:creator><description>&lt;p&gt;Hi Marco,&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Yes, you can test this to verify your needs. It seems that you can also combine&amp;nbsp;&lt;span&gt;%XDATAPRFL and&amp;nbsp;%PERIODICSEARCHCONF..&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Kind regards,&lt;br /&gt;Øyvind&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: LTE connection timeout &amp; retry policy</title><link>https://devzone.nordicsemi.com/thread/403243?ContentTypeID=1</link><pubDate>Wed, 04 Jan 2023 17:24:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4ea39bce-b878-4239-98b3-33ed861c7c42</guid><dc:creator>barbiz</dc:creator><description>&lt;p&gt;Dear Oyvind,&lt;/p&gt;
&lt;p&gt;thanks for your answer!&lt;/p&gt;
&lt;p&gt;I also see that it is possible to change the&amp;nbsp;%XDATAPRFL setting and that has impact in the periodic search conf.&lt;/p&gt;
&lt;p&gt;Would you recommend to try the&amp;nbsp;%XDATAPRFL which seems an easier approach first?&lt;/p&gt;
&lt;p&gt;Marco&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: LTE connection timeout &amp; retry policy</title><link>https://devzone.nordicsemi.com/thread/403095?ContentTypeID=1</link><pubDate>Wed, 04 Jan 2023 07:53:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7b7f4cd0-cefe-41d7-a79e-bacd7c03832d</guid><dc:creator>&amp;#216;yvind</dc:creator><description>&lt;p&gt;Sorry for the slow response to this ticket.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;The solution to this issue could be the use of &lt;a href="https://infocenter.nordicsemi.com/topic/ref_at_commands/REF/at_commands/nw_service/periodicsearchconf.html"&gt;Periodic cell search configuration %PERIODICSEARCHCONF&lt;/a&gt;, this is found in LTE Link Controller library under&amp;nbsp;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/libraries/modem/lte_lc.html#c.lte_lc_periodic_search_set"&gt;lte_lc_periodic_search&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;For your application it may also be good to use &lt;a href="https://infocenter.nordicsemi.com/topic/ref_at_commands/REF/at_commands/mob_termination_ctrl_status/mdmev_set.html"&gt;Modem domain event notification %MDMEV&lt;/a&gt;&amp;nbsp;and Search Status 1 which allows your application &amp;quot;&lt;span&gt;&lt;em&gt;a chance to stop the modem from using more power on searching networks from possibly weaker radio condition&lt;/em&gt;&amp;quot;. The modem team also suggests the following:&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Limit the used bands with band lock as much as possible, i.e. inform modem which bands can be skipped.&lt;/li&gt;
&lt;li&gt;Resolve suitable relation between light searches and full searches for the use case. Let&amp;#39;s say for example that application tries to send data once per hour. The relation of light and full search could be that only light search is done by default (modem deactivated after light search done), but if sending of data has failed 4 times in a row, then full search is allowed for the fifth attempt to send data. This way we make sure that all bands are fully scanned at least at some point (every fifth attempt).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;span&gt;&amp;nbsp;&lt;br /&gt;Let me know how this works for you!&lt;br /&gt;&lt;br /&gt;Kind regards,&lt;br /&gt;Øyvind&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: LTE connection timeout &amp; retry policy</title><link>https://devzone.nordicsemi.com/thread/402430?ContentTypeID=1</link><pubDate>Wed, 28 Dec 2022 11:48:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ef51e159-d1ab-4364-bd82-8bdbc5203e6a</guid><dc:creator>barbiz</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;I can add some information. In the following pic you can see the power consumption profile of the DK with the UDP example, running with 3600s PSM sleep, 60s active time, as well as 3600s data send period.&lt;/p&gt;
&lt;p&gt;In the first pic you can see the power consumption when the DK is powered up &lt;span style="text-decoration:underline;"&gt;inside a shield box&lt;/span&gt; (= no network). You can see there are continuos retries of approximate duration of 10 minutes. How to control the backoff time? We want the retries to be at least one hour away, in order not to waste battery power.&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/35421.Capture.PNG" /&gt;&lt;/p&gt;
&lt;p&gt;In the second pic you can see the DK being powered on with the shield box open (= network) and after the first connection, while in PSM, the shieldbox is closed (= non network). The retry pattern restarts after one our when the software tries to send data. Again: how can we control a timeout and a backoff? And try the next hour just for less minutes?&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/5086.Capture1.PNG" /&gt;&lt;/p&gt;
&lt;p&gt;Thanks in advance! Let me know if anything is unclear.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: LTE connection timeout &amp; retry policy</title><link>https://devzone.nordicsemi.com/thread/402237?ContentTypeID=1</link><pubDate>Tue, 27 Dec 2022 10:04:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:174663ae-3100-46a2-95cd-f54ba3953288</guid><dc:creator>barbiz</dc:creator><description>&lt;p&gt;Hello Oyvind,&lt;/p&gt;
&lt;p&gt;our SDK 2.0.2 is and modem FW is 1.3.3.&lt;/p&gt;
&lt;p&gt;60 minutes is the PSM time given by network.&lt;/p&gt;
&lt;p&gt;We don&amp;#39;t really understand the behavior. From our application, we call lte_lc_connect_async() and then we listen to events. I see that lte_lc_connect_async() then calls connect_lte().&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;analyzing the connect_lte() function - which is called with blocking = false - it seems that it just exits without blocking and it is not influencing the behaviour of the modem, the CONFIG_LTE_NETWORK_TIMEOUT is not even used with blocking=false. Do I miss something?&lt;/li&gt;
&lt;li&gt;also, this function does not explain what happens if modem is connected but THEN the network goes out of reach (let&amp;#39;s say I put it in a shieldbox AFTER it completed the first connection)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Thanks in advance!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: LTE connection timeout &amp; retry policy</title><link>https://devzone.nordicsemi.com/thread/402217?ContentTypeID=1</link><pubDate>Tue, 27 Dec 2022 09:14:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:de50c0e8-525d-4712-9751-f71e16c717d0</guid><dc:creator>&amp;#216;yvind</dc:creator><description>&lt;p&gt;Hello Marco,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Due to Christmas Holidays our team is lower staffed than normal and some delays in our answers must be expected. We apologize for the inconvenience.&lt;/p&gt;
&lt;hr /&gt;
&lt;p&gt;&lt;br /&gt;Can you provide some information on what version of the modem FW and nRF Connect SDK you are running?&amp;nbsp;&lt;/p&gt;
[quote user=""]we use nb-iot and PSM with wake-up period of 60 minutes.[/quote]
&lt;p&gt;Is this the PSM that the network provides you?&lt;/p&gt;
[quote user=""]what behavior should we expect?[/quote]
&lt;p&gt;From&amp;nbsp;&lt;em&gt;nrf\lib\lte_link_control\lte_lc.c&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;static int connect_lte(bool blocking)
{
	int err;
	int tries = (IS_ENABLED(CONFIG_LTE_NETWORK_USE_FALLBACK) ? 2 : 1);
	enum lte_lc_func_mode current_func_mode;
	enum lte_lc_nw_reg_status reg_status;
	static atomic_t in_progress;

	if (!is_initialized) {
		LOG_ERR(&amp;quot;The LTE link controller is not initialized&amp;quot;);
		return -EPERM;
	}

	/* Check if a connection attempt is already in progress */
	if (atomic_set(&amp;amp;in_progress, 1)) {
		return -EINPROGRESS;
	}

	err = lte_lc_nw_reg_status_get(&amp;amp;reg_status);
	if (err) {
		LOG_ERR(&amp;quot;Failed to get current registration status&amp;quot;);
		return -EFAULT;
	}

	/* Do not attempt to register with an LTE network if the device already is registered.
	 * This check is needed for blocking _connect() calls to avoid hanging for
	 * CONFIG_LTE_NETWORK_TIMEOUT seconds waiting for a semaphore that will not be given.
	 */
	if ((reg_status == LTE_LC_NW_REG_REGISTERED_HOME) ||
	    (reg_status == LTE_LC_NW_REG_REGISTERED_ROAMING)) {
		LOG_DBG(&amp;quot;The device is already registered with an LTE network&amp;quot;);

		err = 0;
		goto exit;
	}

	if (blocking) {
		k_sem_init(&amp;amp;link, 0, 1);
	}

	do {
		tries--;

		err = lte_lc_func_mode_get(&amp;amp;current_func_mode);
		if (err) {
			err = -EFAULT;
			goto exit;
		}

		/* Change the modem sys-mode only if it&amp;#39;s not running or is meant to change */
		if (!IS_ENABLED(CONFIG_LTE_NETWORK_DEFAULT) &amp;amp;&amp;amp;
		    ((current_func_mode == LTE_LC_FUNC_MODE_POWER_OFF) ||
		     (current_func_mode == LTE_LC_FUNC_MODE_OFFLINE))) {
			err = lte_lc_system_mode_set(sys_mode_target, mode_pref_current);
			if (err) {
				err = -EFAULT;
				goto exit;
			}
		}

		err = lte_lc_func_mode_set(LTE_LC_FUNC_MODE_NORMAL);
		if (err || !blocking) {
			goto exit;
		}

		err = k_sem_take(&amp;amp;link, K_SECONDS(CONFIG_LTE_NETWORK_TIMEOUT));
		if (err == -EAGAIN) {
			LOG_INF(&amp;quot;Network connection attempt timed out&amp;quot;);

			if (IS_ENABLED(CONFIG_LTE_NETWORK_USE_FALLBACK) &amp;amp;&amp;amp;
			    (tries &amp;gt; 0)) {
				if (sys_mode_target == sys_mode_preferred) {
					sys_mode_target = sys_mode_fallback;
				} else {
					sys_mode_target = sys_mode_preferred;
				}

				err = lte_lc_func_mode_set(LTE_LC_FUNC_MODE_OFFLINE);
				if (err) {
					err = -EFAULT;
					goto exit;
				}

				LOG_INF(&amp;quot;Using fallback network mode&amp;quot;);
			} else {
				err = -ETIMEDOUT;
			}
		} else {
			tries = 0;
		}
	} while (tries &amp;gt; 0);

exit:
	atomic_clear(&amp;amp;in_progress);

	return err;
}&lt;/pre&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></channel></rss>