<?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 subscription failure</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/89417/mqtt-subscription-failure</link><description>Hi, 
 I&amp;#39;m working on the Thingy91 &amp;#39;asset tracker v2&amp;#39; project. I see the data on the nRF cloud. Now, I want to subscribe for incoming data over my Android or Windows app. The connection breaks when I try to subscribe to the MQTT endpoint. 
 The thing I</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 04 Jul 2022 10:12:27 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/89417/mqtt-subscription-failure" /><item><title>RE: MQTT subscription failure</title><link>https://devzone.nordicsemi.com/thread/375283?ContentTypeID=1</link><pubDate>Mon, 04 Jul 2022 10:12:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:551c8b86-941b-4a22-8e96-63a264c53d4d</guid><dc:creator>m.saadat</dc:creator><description>&lt;p&gt;Thanks. I followed the link and now I&amp;#39;m able to connect.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MQTT subscription failure</title><link>https://devzone.nordicsemi.com/thread/375082?ContentTypeID=1</link><pubDate>Fri, 01 Jul 2022 12:02:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0e59208e-3bf1-452e-b322-633386916cd3</guid><dc:creator>Didrik Rokhaug</dc:creator><description>&lt;p&gt;That API creates JITP certificates for the client. Part of the provisioning process involeves disconnecting and reconnecting the client.&lt;/p&gt;
&lt;p&gt;I recommend you follow this guide for how to create credentials for your client: &lt;a href="https://docs.nrfcloud.com/Guides/GettingStarted/Devices#generating-credentials-on-a-computer"&gt;https://docs.nrfcloud.com/Guides/GettingStarted/Devices#generating-credentials-on-a-computer&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;(note that step 3, 4 and 5 is not necesary for a desktop client. In step 2, you can use the nrf_cloud_provision.py script if you don&amp;#39;w want to call the REST API manually)&lt;/p&gt;
&lt;p&gt;With credentials created that way, I have been successfully subscribed to prod/&amp;lt;team ID&amp;gt;/m/d/&amp;lt;client id&amp;gt;/c2d and &amp;lt;client id&amp;gt;/shadow/get/accepted. I was also able to receive the shadow on the latter topic by publishing to $aws/things/&amp;lt;client id&amp;gt;/shadow/get&lt;/p&gt;
&lt;p&gt;Finally, you should note that client IDs starting with &amp;quot;nrf-&amp;quot; is reserved for evices created by Nordic Semiconductor (e.g. DKs and Thingys). nRF Cloud therefore treats them slightly differently. You should choose client IDs that do not start with &amp;quot;nrf-&amp;quot;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MQTT subscription failure</title><link>https://devzone.nordicsemi.com/thread/374837?ContentTypeID=1</link><pubDate>Thu, 30 Jun 2022 07:46:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9cd02707-baa8-4eef-8e93-9196828ac7e0</guid><dc:creator>m.saadat</dc:creator><description>&lt;p&gt;That is the case. I use the same clientId and credentials that are received by calling the&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;em&gt;&amp;#39;POST on&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;a href="https://api.nrfcloud.com/v1/devices/nrf-***************/certificates&amp;#39;"&gt;api.nrfcloud.com/.../certificates&amp;#39;&lt;/a&gt;&lt;/em&gt;. If I use a different clientId (added &amp;#39;-2&amp;#39; at the end), it does not connect (connection breaks before the connection is complete):&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;Client nrf-**************-2 sending CONNECT
Error: The connection was lost.&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;When the Thingy91 is disconnected, the same thing happens, and the connection breaks (even when using the same clientId as Thingy91).&lt;/p&gt;
&lt;p&gt;Where can I get the new clientId for new connections? Do I need a different certificate to be able to connect to the MQTT broker?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MQTT subscription failure</title><link>https://devzone.nordicsemi.com/thread/374726?ContentTypeID=1</link><pubDate>Wed, 29 Jun 2022 11:54:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0094e8a6-cdce-4eba-bb04-229c91f2ed7d</guid><dc:creator>Didrik Rokhaug</dc:creator><description>[quote user="m.saadat"]I can connect, but as soon as Thingy91 publishes something to it, the connection breaks.[/quote]
&lt;p&gt;Are the Thingy and the mosquitto client using the same ID and credentials?&lt;/p&gt;
&lt;p&gt;If that is the case, being disconnected is expected. Client IDs must be unique, i.e. cannot be used by two different clients at the same time.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MQTT subscription failure</title><link>https://devzone.nordicsemi.com/thread/374716?ContentTypeID=1</link><pubDate>Wed, 29 Jun 2022 11:26:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:14041b7d-02ce-424b-bc3e-6d5cc60e964d</guid><dc:creator>m.saadat</dc:creator><description>&lt;p&gt;Hi. I should have added that. I tried all the topics. I just added that one as a sample. The same result is happening even when I tried, for example, this one:&lt;/p&gt;
&lt;p&gt;&lt;em&gt;m/d/${deviceId}/c2d&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Or any other topic in that table (I even tested the ones that are only for publishing). And for the topic&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;${device_id}/shadow/get/accepted&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I can connect, but as soon as Thingy91 publishes something to it, the connection breaks.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MQTT subscription failure</title><link>https://devzone.nordicsemi.com/thread/374714?ContentTypeID=1</link><pubDate>Wed, 29 Jun 2022 11:16:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1b85de39-710d-42b7-a217-10ecb7ea162e</guid><dc:creator>Didrik Rokhaug</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Could you try to subscribe to the specific topics you want to subscribe to, instead of using wildcards?&lt;/p&gt;
&lt;p&gt;You might not be allowed to subscribe to all subtopics of prod/${tenantId}/m, which is probably why you get kicked out.&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>