<?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>Subscribing to different topic while publishing on another topic</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/43294/subscribing-to-different-topic-while-publishing-on-another-topic</link><description>Hi everyone, 
 I am using nRF52 which has 52832 on it. Currently, I am working on 2 nRFs and one RPi with MQTT on the softdevice 132. One nRF is the publisher, another one is a sub and RPi is a router. Publisher senses the temperature and publish this</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 08 Mar 2019 15:55:50 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/43294/subscribing-to-different-topic-while-publishing-on-another-topic" /><item><title>RE: Subscribing to different topic while publishing on another topic</title><link>https://devzone.nordicsemi.com/thread/175106?ContentTypeID=1</link><pubDate>Fri, 08 Mar 2019 15:55:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:208d7a70-051e-4695-9b87-dcd6be7178df</guid><dc:creator>Stian R&amp;#248;ed Hafskjold</dc:creator><description>&lt;p&gt;I started with the mqtt publisher example from SDK 15.2.0 and added the subscriber part to the main.c file. I&amp;#39;m able to both subscribe and publish at the same time.&lt;/p&gt;
&lt;p&gt;Please note that m_connection_state changes from APP_MQTT_STATE_CONNECED to APP_MQTT_STATE_SUBSCRIBED in the subscriber example, so make sure that button 2 is checking for both states when you want to publish while subscribing.&lt;/p&gt;
&lt;p&gt;Attaching the main.c file for the modified mqtt publisher example. This is set up to subscribe to temp/state and publish on led/state. LED4 will toggle when a node publishes on temp/state.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-f8934d0eca95496389e4854af6db40b5/main.c"&gt;devzone.nordicsemi.com/.../main.c&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>