<?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>MQTT and GPS</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/73476/mqtt-and-gps</link><description>I have an application where i have to regularly send gps data to an mqtt broker. I started with the mqtt sample which works fine, and i also tried the gps example with assited fix over supl which also works fine. When it comes to combinig the two examples</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 07 Apr 2021 09:21:46 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/73476/mqtt-and-gps" /><item><title>RE: MQTT and GPS</title><link>https://devzone.nordicsemi.com/thread/303413?ContentTypeID=1</link><pubDate>Wed, 07 Apr 2021 09:21:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:31653e72-28ec-4b56-9de9-4ca734024edf</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The path of least resistance is normally looking at two (or more) samples that match your requirement, and then combining these into one project.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;the&amp;nbsp;&amp;quot;gps&amp;quot; application turns on/off the LTE link, while&amp;nbsp;a more wide-spread approach is to&amp;nbsp;enter eDRX/PSM, then start the GPS.&lt;/p&gt;
&lt;p&gt;First, I would recommend that you enable both GPS and your LTE PHY (NB1 or LTE-M1), by setting:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;# M1 + GPS
CONFIG_LTE_NETWORK_MODE_LTE_M_GPS=y

OR:

# NB1 + GPS
CONFIG_LTE_NETWORK_MODE_NBIOT_GPS=y&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Then use the &lt;a href="https://infocenter.nordicsemi.com/topic/ref_at_commands/REF/at_commands/packet_domain/cscon.html?cp=2_1_6_16"&gt;CSCON notification&lt;/a&gt; to ensure that the link is inactive, so you can start the GPS, and then stop it when your application criterias are met.&lt;/p&gt;
&lt;p&gt;The initialization and gps-handling can be taken from the &amp;quot;gps&amp;quot; sample.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Let me know if you run into any issues!&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>