<?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>Multiple MQTT Clients using nrf9160</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/75027/multiple-mqtt-clients-using-nrf9160</link><description>Has anyone done multiple mqtt client connections from an nrf9160? Is it simply a matter of using the mqtt api and defining multiple client structures with unique rx/tx buffers assigned to them? Or are there any limitations imposed by the modem software</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 12 May 2021 07:52:00 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/75027/multiple-mqtt-clients-using-nrf9160" /><item><title>RE: Multiple MQTT Clients using nrf9160</title><link>https://devzone.nordicsemi.com/thread/309388?ContentTypeID=1</link><pubDate>Wed, 12 May 2021 07:52:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:12a7beff-71fe-412c-b9f4-08e6ba868312</guid><dc:creator>&amp;#216;yvind</dc:creator><description>&lt;p&gt;Hello,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user=""]Is it simply a matter of using the mqtt api and defining multiple client structures with unique rx/tx buffers assigned to them?[/quote]
&lt;p&gt;&amp;nbsp;Yes,&amp;nbsp;there should be no issues. You need to have two separate mqtt_client structure instances and handle them separately (i. e. separate init, connect etc.). There&amp;#39;s no fixed configuration like client port in the MQTT library, all the data is kept within the mqtt_client context so you can maintain as many MQTT connections as you want (in the boundaries of the available memory of course)&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;br /&gt;Øyvind&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>