<?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 concurrent mode on Thingy:91</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/56641/mqtt-and-gps-concurrent-mode-on-thingy-91</link><description>Hi, 
 I know that this topic has been raised here many times, and I did read all of those threads, however none of them seem to solve my problem. As many others, what I am trying to do is to combine mqtt_simple and gps samples in order to send GPS data</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 28 Feb 2020 10:13:35 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/56641/mqtt-and-gps-concurrent-mode-on-thingy-91" /><item><title>RE: MQTT and GPS concurrent mode on Thingy:91</title><link>https://devzone.nordicsemi.com/thread/237088?ContentTypeID=1</link><pubDate>Fri, 28 Feb 2020 10:13:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:91d13b1e-55e2-4d27-864c-55a5f489d876</guid><dc:creator>Martin Lesund</dc:creator><description>&lt;p&gt;Hi Maciek,&lt;br /&gt;I am very sorry for the delay.&lt;br /&gt;&lt;span style="text-decoration:underline;"&gt;First, I recommend upgrading to: &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;NCS v1.2.0 and MFW v1.1.1.&lt;/p&gt;
&lt;p&gt;I recommend that you do &lt;strong&gt;not&lt;/strong&gt; have everything in your main function.&lt;/p&gt;
&lt;p&gt;You should have separate threads for the MQTT and GPS in your application, and both sockets should be read/polled all the time to avoid any conflicts.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;I would recommend that you get the GPS fix&amp;nbsp;&lt;strong&gt;before&lt;/strong&gt; turning ON the LTE modem.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;note: You can wake-up from PSM mode whenever you want, (and you do not need to disable PSM mode after a fix).&amp;nbsp;&lt;br /&gt;- GPS can also be running in eDRX intervals when the modem is in RRC IDLE mode.&lt;br /&gt;&lt;br /&gt;It will be released an updated sample in NCS that shows this much better, so if you can wait a bit I would recommend looking out for that sample.&lt;br /&gt;&lt;br /&gt;You can also utilize A-GPS now which will give you a much better TTFF on a cold start of the GPS. (this is &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/samples/nrf9160/gps/README.html" rel="noopener noreferrer" target="_blank"&gt;showcased in GPS sample&lt;/a&gt;)&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>