<?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>Using AT commands to connect to an MQTT broker</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/84877/using-at-commands-to-connect-to-an-mqtt-broker</link><description>I am using P822601 board (with nRF9160 chip). Sample project &amp;quot;Serial lte modem&amp;quot; (SDK 1.8). I&amp;#39;m trying to connect to a test mqtt broker (mosquitto) using AT commands via LTE Link Monitor, but with no success. Using the &amp;quot;MQTT_AT_commands.rst&amp;quot; document,</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 17 Feb 2022 15:11:43 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/84877/using-at-commands-to-connect-to-an-mqtt-broker" /><item><title>RE: Using AT commands to connect to an MQTT broker</title><link>https://devzone.nordicsemi.com/thread/353670?ContentTypeID=1</link><pubDate>Thu, 17 Feb 2022 15:11:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2b0e4dcd-9aaf-4a4a-af4b-34d2906c1891</guid><dc:creator>Albrecht Markus Schellenberger</dc:creator><description>&lt;p lang="en-GB"&gt;Hello Stas,&lt;/p&gt;
[quote user=""]1) Could you please indicate the necessary sequence of commands required for the correct configuration and work with MQTT.[/quote]
&lt;p lang="en-GB"&gt;I have tested this myself with a nRF9160 DK and the Serial LTE modem application in NCS v1.8.0 and it works as expected, see log below:&lt;/p&gt;
&lt;p lang="en-GB"&gt;&lt;pre class="ui-code" data-mode="text"&gt;*** Booting Zephyr OS build v2.7.0-ncs1  ***
Ready
[00:00:00.205,871] &amp;lt;inf&amp;gt; slm: Serial LTE Modem
[00:00:00.234,954] &amp;lt;inf&amp;gt; slm_at_host: at_host init done

AT+CEREG=5
OK

AT+CFUN=1
OK

+CEREG: 2,&amp;quot;76C1&amp;quot;,&amp;quot;03113C00&amp;quot;,7
+CEREG: 1,&amp;quot;76C1&amp;quot;,&amp;quot;03113C00&amp;quot;,7,,,&amp;quot;00001010&amp;quot;,&amp;quot;11000001&amp;quot;

AT#XMQTTCON=1,&amp;quot;MyMQTT-Client-ID&amp;quot;,&amp;quot;&amp;quot;,&amp;quot;&amp;quot;,&amp;quot;test.mosquitto.org&amp;quot;,1883
OK
#XMQTTEVT: 0,0

AT#XMQTTCON=0
#XMQTTEVT: 1,0
OK

[00:01:15.500,396] &amp;lt;err&amp;gt; slm_mqtt: POLLNVAL
[00:01:15.500,427] &amp;lt;inf&amp;gt; slm_mqtt: MQTT thread terminated&lt;/pre&gt;&lt;/p&gt;
&lt;p lang="en-GB"&gt;Port 1883 of test.mosquitto.org is &lt;em&gt;“MQTT, unencrypted, unauthenticated”&lt;/em&gt;, so no username and passwort needed. For more information, see &lt;a href="https://test.mosquitto.org/"&gt;https://test.mosquitto.org/&lt;/a&gt;. I’m not sure if “mqtt.mosquitto.org” is a good idea for a client-id, nor if it is accepted by the server.&lt;/p&gt;
[quote user=""]2)&amp;nbsp;&amp;nbsp;The SIM card (iBASIS eSIM) used can be deactivated for some reason?[/quote]
&lt;p lang="en-GB"&gt;I’m not sure if I understand this question. Can you elaborate?&lt;/p&gt;
&lt;p lang="en-GB"&gt;Regards,&lt;/p&gt;
&lt;p lang="en-GB"&gt;Markus&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>