<?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>nRF9160  serial lte modem  use mqtt</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/79885/nrf9160-serial-lte-modem-use-mqtt</link><description>HI 
 I use NRF9160 serial_lte_modem to test NBIOT/MQTT, current SDK is V1.6.0 ,and config mqtt keepalive =1200S. 
 after 9160 connect net, control mqtt connect my mqtt server and publish data. another mqtt client subscribe 9160 publish topic. 
 
 this</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 23 Sep 2021 14:38:58 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/79885/nrf9160-serial-lte-modem-use-mqtt" /><item><title>RE: nRF9160  serial lte modem  use mqtt</title><link>https://devzone.nordicsemi.com/thread/330896?ContentTypeID=1</link><pubDate>Thu, 23 Sep 2021 14:38:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:17933169-6165-44de-a4f9-5806520b7a2b</guid><dc:creator>Didrik Rokhaug</dc:creator><description>&lt;p&gt;Did the other nRF9160 use the same client ID?&lt;/p&gt;
&lt;p&gt;Most MQTT brokers require that the client IDs are unique.&lt;/p&gt;
&lt;p&gt;I am also not able to reproduce your missing #XMQTTEVT events.&lt;/p&gt;
&lt;p&gt;And, if I increase the keepalive setting on the nRF9160 past the keepalive setting of the broker, I get an event saying that I am disconnected the next time the client tries to send a keepalive message.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9160  serial lte modem  use mqtt</title><link>https://devzone.nordicsemi.com/thread/330738?ContentTypeID=1</link><pubDate>Thu, 23 Sep 2021 02:44:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:366b8500-8613-40e7-bd0d-3cf3efc0ae1c</guid><dc:creator>mokoysh</dc:creator><description>&lt;p&gt;HI&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; the 9160 publish topic and another mqtt client subscribe topic&amp;nbsp; is same.&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; MQTT config keepalive=1200S，and have two hours from 11:59 to 14:01. there should be 6 times keepalive and EVENT(&lt;span&gt;#XMQTTEVT:9,0&lt;/span&gt;) return ,but none.&amp;nbsp; SO I thinks mqtt disconnect but&amp;nbsp; no&amp;nbsp; EVENT return&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9160  serial lte modem  use mqtt</title><link>https://devzone.nordicsemi.com/thread/330680?ContentTypeID=1</link><pubDate>Wed, 22 Sep 2021 13:12:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b237b2a8-ff55-4ec4-b127-374e83edbb5a</guid><dc:creator>Didrik Rokhaug</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user=""]In&amp;nbsp;&lt;a href="http://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/applications/serial_lte_modem/doc/MQTT_AT_commands.html"&gt;http://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/applications/serial_lte_modem/doc/MQTT_AT_commands.html&lt;/a&gt;&amp;nbsp; show, all MQTT&amp;nbsp;operate will have EVENT return, but&amp;nbsp; publish data don&amp;#39;t have&amp;nbsp; event return .[/quote]
&lt;p&gt;&amp;nbsp;No, that is not what is shown. #XMQTTPUB does not trigger an event if you send with QoS 0.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user=""]this log show, in 11:59:46 NRF9160 publish data to server,and another mqtt client recv this data .but in 14:01:14&amp;nbsp; nrf9160 publish data,another mqtt client don&amp;#39;t recv data .[/quote]
&lt;p&gt;&amp;nbsp;Are you sure the device was connected and subscribed to the correct topic?&lt;/p&gt;
&lt;p&gt;What QoS level did you use?&lt;/p&gt;
&lt;p&gt;I have not been able to reproduce this.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user=""]by AT log in 14:01:14，9160&amp;nbsp; should&amp;nbsp; be disconnected.&amp;nbsp;Why the link will be disconnected？and this disconnect don&amp;#39;t have event notification。If no notification ，I don&amp;#39;t know when the 9160 is disconnected[/quote]
&lt;p&gt;&amp;nbsp;Why should it be disconnected?&lt;/p&gt;
&lt;p&gt;Depending on the reason for the disconnect, you should get a MQTT event similar to this:&lt;/p&gt;
&lt;p&gt;#XMQTTEVT: 1,-113&lt;/p&gt;
&lt;p&gt;At the latest the next time the device publishes a message or sends a PING.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Didrik&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>