<?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>AssetTracker v2: connection management and sleep state</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/107613/assettracker-v2-connection-management-and-sleep-state</link><description>Hi! 
 
 I can&amp;#39;t find a detailed technical description of the following points of the AssetTracker v2 application. Some description, explanation, details will be appreciated. 
 
 1. Connection management (connection/disconnection behavior). Does the app</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 05 Feb 2024 07:48:38 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/107613/assettracker-v2-connection-management-and-sleep-state" /><item><title>RE: AssetTracker v2: connection management and sleep state</title><link>https://devzone.nordicsemi.com/thread/467507?ContentTypeID=1</link><pubDate>Mon, 05 Feb 2024 07:48:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3332962e-0337-4ed6-83ef-5ccae1c7e3b0</guid><dc:creator>ragruslan</dc:creator><description>&lt;p&gt;Thanks for your answers!&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;span&gt;In PSM the modem is in deep sleep mode and the antenna is turned off.&lt;/span&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Ok. But if a carrier doesn&amp;#39;t support PSM, what will happen? Will the device disconnect and switch off the modem (or go into flight mode)? Or will it just stay online and drain its battery quickly?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;a href="https://github.com/nrfconnect/sdk-nrf/blob/main/applications/asset_tracker_v2/src/modules/modem_module.c#L725"&gt;Here&lt;/a&gt;&lt;span&gt;&amp;nbsp;the event appears, and a few lines below that, the modem is turned off with lte_lc_offline().&lt;/span&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;This is a handler for this event. But I can&amp;#39;t find this event to be emitted at all.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Also, a couple of my previous questions:&lt;/p&gt;
&lt;p&gt;As far as I understand, nRF9160 has some sleep modes/states of MCU - e.g., deep sleep. Does the AssetTracker app use some features like these?&lt;br /&gt;Does it keep peripherals off (or in some low-power mode) most of the time?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: AssetTracker v2: connection management and sleep state</title><link>https://devzone.nordicsemi.com/thread/467373?ContentTypeID=1</link><pubDate>Fri, 02 Feb 2024 12:59:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d549ebfe-99d9-41da-bf84-72ac520b0332</guid><dc:creator>Hakon</dc:creator><description>[quote user=""]Does the app stay offline most of the time?[/quote]
&lt;p&gt;What do you mean by &amp;quot;offline&amp;quot;? It can go into PSM, but that doesn&amp;#39;t mean it is disconnected from the network.&lt;/p&gt;
[quote user=""]Is the modem switched off during this offline periods?[/quote]
&lt;p&gt;In PSM the modem is in deep sleep mode and the antenna is turned off.&lt;/p&gt;
[quote user=""]What is the algorithm of connection management (including reconnections in case of a network lost)?[/quote]
&lt;p&gt;The reconnection to the network is handled by the modem, but the cloud connection is handled in the &lt;a href="https://github.com/nrfconnect/sdk-nrf/blob/main/applications/asset_tracker_v2/src/modules/cloud_module.c#L906"&gt;cloud module&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote user=""]But I don&amp;#39;t see this event to actually appear (neither in the code, nor in the logs).[/quote]
&lt;p&gt;&lt;a href="https://github.com/nrfconnect/sdk-nrf/blob/main/applications/asset_tracker_v2/src/modules/modem_module.c#L725"&gt;Here&lt;/a&gt; the event appears, and a few lines below that, the modem is turned off with lte_lc_offline().&lt;/p&gt;
&lt;p&gt;Hope this answers your question.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: AssetTracker v2: connection management and sleep state</title><link>https://devzone.nordicsemi.com/thread/466212?ContentTypeID=1</link><pubDate>Fri, 26 Jan 2024 12:40:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:58071472-d718-48c1-8789-e6fa7415746e</guid><dc:creator>ragruslan</dc:creator><description>&lt;p&gt;Hi Jonathan,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks for the reply!&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;span&gt;Do you not feel that this addresses your question?&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Sorry, but I don&amp;#39;t feel so. I&amp;#39;ve seen these docs and they don&amp;#39;t answer my questions.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.5.1/nrf/applications/asset_tracker_v2/doc/modem_module.html#lte-connection-handling"&gt;LTE connection handling&lt;/a&gt;&amp;nbsp;doc:&lt;/p&gt;
&lt;p&gt;-&amp;nbsp;(From my original question) I see &amp;quot;&lt;em&gt;If the modem module receives an APP_EVT_LTE_DISCONNECT event, it instructs the modem to detach from the network, and a subsequent MODEM_EVT_LTE_DISCONNECTED event can be expected after the disconnect.&lt;/em&gt;&amp;quot;. But I can&amp;#39;t find this event neither in the code, nor in the logs (in both active/passive modes). Does this mean that the device stays always connected (especially if my carrier doesn&amp;#39;t support PSM)?&lt;/p&gt;
&lt;p&gt;-&amp;nbsp;What is the reconnection policy? I see &amp;quot;&lt;em&gt;If the network registration is lost at some point, a MODEM_EVT_LTE_DISCONNECTED event is sent.&lt;/em&gt;&amp;quot;. But I see no info about reconnection. Is it handled by the &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.5.1/nrf/libraries/modem/lte_lc.html#lte-link-control"&gt;LTE link control library&lt;/a&gt; without any calls from the application?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.5.1/nrf/applications/asset_tracker_v2/doc/app_behavior.html#application-behavior-and-functionality"&gt;Application behavior and functionality&lt;/a&gt;&amp;nbsp;doc&amp;nbsp;also doesn&amp;#39;t give any details about the connection management. I only see &amp;quot;In connected state?&amp;quot; blocks on the diagrams, nothing more about connectivity.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;a href="https://github.com/nrfconnect/sdk-nrf/blob/69b617e753df68d2be7e54cb4c204732ef137c20/include/modem/lte_lc.h#L299"&gt;https://github.com/nrfconnect/sdk-nrf/blob/69b617e753df68d2be7e54cb4c204732ef137c20/include/modem/lte_lc.h#L299&lt;/a&gt;&lt;span&gt;&amp;nbsp;there is the two handles here:&lt;/span&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Ok, this is modem&amp;#39;s sleep mode. As far as I understand, nRF9160 has some sleep modes/states of MCU - e.g., deep sleep. Does the AssetTracker app use some features like these?&lt;br /&gt;&lt;span&gt;Does&amp;nbsp;it keep peripherals off (or in some low-power mode) most of the time?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Regards,&lt;br /&gt;&lt;/span&gt;&lt;span&gt;Ruslan&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: AssetTracker v2: connection management and sleep state</title><link>https://devzone.nordicsemi.com/thread/465793?ContentTypeID=1</link><pubDate>Wed, 24 Jan 2024 12:49:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fd37cc6b-188b-4a75-affe-1561da75246f</guid><dc:creator>JONATHAN LL</dc:creator><description>&lt;p&gt;Hi,&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
[quote user=""]1. Connection management (connection/disconnection behavior).[/quote]
&lt;p&gt;We have this section on connection in the docs:&amp;nbsp;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.5.1/nrf/applications/asset_tracker_v2/doc/modem_module.html#lte-connection-handling"&gt;https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.5.1/nrf/applications/asset_tracker_v2/doc/modem_module.html#lte-connection-handling&lt;/a&gt;&amp;nbsp;&lt;br /&gt;Do you not feel that this addresses your question?&amp;nbsp;&amp;nbsp;&lt;br /&gt;Then there is also the&amp;nbsp;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.5.1/nrf/applications/asset_tracker_v2/doc/app_behavior.html"&gt;https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.5.1/nrf/applications/asset_tracker_v2/doc/app_behavior.html&lt;/a&gt;&amp;nbsp;behaviour section: there will be differences depending on configuration options.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
[quote user=""]2.&amp;nbsp;&amp;nbsp;Power management, going to sleep.[/quote]
&lt;p&gt;&lt;a href="https://github.com/nrfconnect/sdk-nrf/blob/69b617e753df68d2be7e54cb4c204732ef137c20/include/modem/lte_lc.h#L299"&gt;https://github.com/nrfconnect/sdk-nrf/blob/69b617e753df68d2be7e54cb4c204732ef137c20/include/modem/lte_lc.h#L299&lt;/a&gt;&amp;nbsp;there is the two handles here:&lt;br /&gt;&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;/**
	 * Modem exited from sleep.
	 *
	 * The associated payload is the @c modem_sleep member of type @ref lte_lc_modem_sleep in
	 * the event.
	 */
	LTE_LC_EVT_MODEM_SLEEP_EXIT,

	/**
	 * Modem entered sleep.
	 *
	 * The associated payload is the @c modem_sleep member of type @ref lte_lc_modem_sleep in
	 * the event. The @c time parameter indicates the duration of the sleep.
	 */
	LTE_LC_EVT_MODEM_SLEEP_ENTER,&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;br /&gt;Regards,&lt;br /&gt;Jonathan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>