<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://test-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>nrf9160: LTE + GPS + MQTT - GPS Blocked</title><link>https://test-devzone.nordicsemi.com/f/nordic-q-a/88863/nrf9160-lte-gps-mqtt---gps-blocked</link><description>Hi, 
 I am trying to understand either the timing or feature I am missing with respect to LTE, GPS and MQTT. I have read a number of posts and questions on a similar topic, but didnt find what I was doing wrong. 
 I have a 9160DK which connects fine to</description><dc:language>en-US</dc:language><generator>Telligent Community 13 Non-Production</generator><lastBuildDate>Tue, 14 Jun 2022 12:43:18 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://test-devzone.nordicsemi.com/f/nordic-q-a/88863/nrf9160-lte-gps-mqtt---gps-blocked" /><item><title>RE: nrf9160: LTE + GPS + MQTT - GPS Blocked</title><link>https://test-devzone.nordicsemi.com/thread/372388?ContentTypeID=1</link><pubDate>Tue, 14 Jun 2022 12:43:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4c880abe-14b0-4cb6-ac0e-abee5e6c8303</guid><dc:creator>user2115</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="Brett"]If I want to change the TAU and RAT values I was looking to use:&lt;br /&gt;&lt;strong&gt;lte_lc_psm_param_set( )&lt;/strong&gt;, or &lt;br /&gt;&lt;br /&gt;should I use &lt;strong&gt;at_cmd_write()&lt;/strong&gt;[/quote]
&lt;p&gt;The first is a helper function to set the PSM parameters, while the second is a generic AT command write. Both can be used for setting preferred PSM TAU/ActiveTime.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="Brett"]Is there a reason the following commands all give a different answer, are they all looking at different components of the LTE connection?[/quote]
&lt;p&gt;You have to differentiate between what you request, and what the network applies.&lt;/p&gt;
&lt;p&gt;You can request 10 minute TAU, but the network will most likely change this to its own defined minimum level (could be 30, could be 60 minutes or higher for that matter).&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="Brett"]&lt;p&gt;AT%XMONITOR : %XMONITOR: 1,&amp;quot;Telstra@&amp;quot;,&amp;quot;Telstra@&amp;quot;,&amp;quot;50501&amp;quot;,&amp;quot;3012&amp;quot;,7,28,&amp;quot;0829550D&amp;quot;,66,9410,36,22,&amp;quot;&amp;quot;,&amp;quot;00011110&amp;quot;,&amp;quot;11100000&amp;quot;,&amp;quot;01001110&amp;quot;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;lte_lc_psm_get( &amp;amp;tau, &amp;amp;active_timer );&lt;/p&gt;
&lt;p&gt;returns: TAU: -1 , Active_timer: 60&lt;/p&gt;[/quote]
&lt;p&gt;Try changing the active timer, which is currently set at 1 minute, via the CONFIG_LTE_PSM_REQ_RAT=&amp;quot;00000001&amp;quot;&lt;/p&gt;
&lt;p&gt;This can be 2 seconds (or even disabled, as the network will have a hard-coded timing wise paging before entering PSM)&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf9160: LTE + GPS + MQTT - GPS Blocked</title><link>https://test-devzone.nordicsemi.com/thread/372332?ContentTypeID=1</link><pubDate>Tue, 14 Jun 2022 09:15:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:94845ce0-3b28-494b-ac4d-8078dd096a8b</guid><dc:creator>user101635</dc:creator><description>&lt;p&gt;Hi H&amp;aring;kon,&lt;br /&gt;&lt;br /&gt;Thanks for the reply, a couple of follow up questions:&lt;br /&gt;&lt;br /&gt;Is there a reason the following commands all give a different answer, are they all looking at different components of the LTE connection?&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Query:&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;AT+CPSMS? : +CPSMS: 1,,,&amp;quot;00000011&amp;quot;,&amp;quot;00100001&amp;quot;&lt;/p&gt;
&lt;p&gt;AT%XMONITOR : %XMONITOR: 1,&amp;quot;Telstra@&amp;quot;,&amp;quot;Telstra@&amp;quot;,&amp;quot;50501&amp;quot;,&amp;quot;3012&amp;quot;,7,28,&amp;quot;0829550D&amp;quot;,66,9410,36,22,&amp;quot;&amp;quot;,&amp;quot;00011110&amp;quot;,&amp;quot;11100000&amp;quot;,&amp;quot;01001110&amp;quot;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;lte_lc_psm_get( &amp;amp;tau, &amp;amp;active_timer );&lt;/p&gt;
&lt;p&gt;returns: TAU: -1 , Active_timer: 60&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Set:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;If I want to change the TAU and RAT values I was looking to use:&lt;br /&gt;&lt;strong&gt;lte_lc_psm_param_set( )&lt;/strong&gt;, or &lt;br /&gt;&lt;br /&gt;should I use &lt;strong&gt;at_cmd_write()&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;regards&lt;/p&gt;
&lt;p&gt;-brett&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf9160: LTE + GPS + MQTT - GPS Blocked</title><link>https://test-devzone.nordicsemi.com/thread/372132?ContentTypeID=1</link><pubDate>Mon, 13 Jun 2022 12:07:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:90b036e0-693e-421b-a7a2-33e99c0b4f62</guid><dc:creator>user2115</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user=""]AT+CPSMS? : +CPSMS: 1,,,&amp;quot;00000011&amp;quot;,&amp;quot;00100001&amp;quot;[/quote]
&lt;p&gt;These are your requested TAU and active time, as per the documentation:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://infocenter.nordicsemi.com/topic/ref_at_commands/REF/at_commands/nw_service/cpsms_read.html?cp=2_1_7_2_1"&gt;https://infocenter.nordicsemi.com/topic/ref_at_commands/REF/at_commands/nw_service/cpsms_read.html?cp=2_1_7_2_1&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I see that you request 30 minutes TAU and 1 minute active time(001 = 1 minute, 00001 = times one). I can recommend that you request a lower active time, as this will significantly reduce the time for the GPS to be able to run successfully.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;if you have a mqtt keep alive of 1 minute, you&amp;#39;ll always be blocked by the LTE network with your current timing values.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;PS: to view the PSM/eDRX settings applied to your link, you should issue the XMONITOR AT command:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://infocenter.nordicsemi.com/topic/ref_at_commands/REF/at_commands/nw_service/xmonitor_set.html?cp=2_1_7_11_0"&gt;https://infocenter.nordicsemi.com/topic/ref_at_commands/REF/at_commands/nw_service/xmonitor_set.html?cp=2_1_7_11_0&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user=""]lte_lc_psm_req(true);&lt;br /&gt;lte_lc_edrx_req(true);[/quote]
&lt;p&gt;You should only request either eDRX or PSM.&lt;/p&gt;
[quote user=""]&lt;p&gt;Q: Do I need to set the modem differently ?&lt;/p&gt;
&lt;p&gt;Q: Do I need to disconnect from MQTT for GPS to work and then reconnect when I want to send any data ?&lt;/p&gt;
&lt;p&gt;Q: Am I missing a setting on the MQTT setup/config so it allows the LTE go into PSM mode ?&lt;/p&gt;[/quote]
&lt;p&gt;You should register and await for the CSCON notification to see if the LTE link is idle or not:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://infocenter.nordicsemi.com/topic/ref_at_commands/REF/at_commands/packet_domain/cscon_set.html?cp=2_1_6_16_0"&gt;https://infocenter.nordicsemi.com/topic/ref_at_commands/REF/at_commands/packet_domain/cscon_set.html?cp=2_1_6_16_0&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;This is also available through the lte_lc event handler as this event:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/nrfconnect/sdk-nrf/blob/v1.9.1/samples/nrf9160/udp/src/main.c#L78"&gt;https://github.com/nrfconnect/sdk-nrf/blob/v1.9.1/samples/nrf9160/udp/src/main.c#L78&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Then start the GPS when the lte link is in idle mode.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>