<?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>openThread and MQTT communication on a nrf52840DK</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/65650/openthread-and-mqtt-communication-on-a-nrf52840dk</link><description>I would like to figure our how i can send MQTT packages over a Thread network using a nrf52840DK. And to begin with only between two nrf52840 devices. 
 I am using the nrf connect sdk and have been looking at the MQTT example for nrf9160 to see how MQTT</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 21 Jun 2021 16:38:54 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/65650/openthread-and-mqtt-communication-on-a-nrf52840dk" /><item><title>RE: openThread and MQTT communication on a nrf52840DK</title><link>https://devzone.nordicsemi.com/thread/316337?ContentTypeID=1</link><pubDate>Mon, 21 Jun 2021 16:38:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8aedda1b-2fd3-4f2a-8fc2-ab5176dfeac2</guid><dc:creator>Unitware</dc:creator><description>&lt;p&gt;I gave up, did some preliminary TCP connections and measured really low bandwith with lots of retransmissions and such. And that was before I even started with TLS. So I&amp;#39;ll stick to UDP on the thread network and a gateway to convert to MQTT later on.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: openThread and MQTT communication on a nrf52840DK</title><link>https://devzone.nordicsemi.com/thread/314455?ContentTypeID=1</link><pubDate>Wed, 09 Jun 2021 12:23:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5be7da0b-13ca-4ed2-aea2-dcd5a2f63e34</guid><dc:creator>Unitware</dc:creator><description>&lt;p&gt;Hi did you find a solution to this? I have been trying for a few days now and still have no success with the TCP communication. &lt;br /&gt;Ping works well in both directions but TCP connect ends up in error -116&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: openThread and MQTT communication on a nrf52840DK</title><link>https://devzone.nordicsemi.com/thread/268368?ContentTypeID=1</link><pubDate>Mon, 07 Sep 2020 15:33:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d0610d16-99e5-4984-b5ae-3eb8b0b73075</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=""]I have not been able to find an example where MQTT is implemented ontop of a openThread network, is there any?[/quote]
&lt;p&gt;&amp;nbsp;Unfortunatly not.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user=""]I thought i could take the MQTT example for nrf9160 and replace the LTE communication with openThread that the coApp example uses.[/quote]
&lt;p&gt;&amp;nbsp;I work mostly with the nRF9160, so I am not very familiar with Thread, but I&amp;#39;ll try to answer this as best I can.&lt;/p&gt;
&lt;p&gt;First, the mqtt_simple sample was built for the nRF9160, so you will find some nRF91-specific code there. But, it should not be a big problem to remove it, and replace it with the corresponding Thread code. In particular, the modem_configure() function must be replaced with the Thread code for setting up a connection.&lt;/p&gt;
&lt;p&gt;As far as I can see, there should not be any huge issues with replacing the LTE stack with the Thread stack. The MQTT library is built on a POSIX socket interface, which the Thread stack also seems to expose.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.3.0/nrf/ug_thread_stack_architecture.html"&gt;https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.3.0/nrf/ug_thread_stack_architecture.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.3.0/nrf/ug_thread_ot_integration.html#overview"&gt;https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.3.0/nrf/ug_thread_ot_integration.html#overview&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.3.0/zephyr/reference/networking/sockets.html#bsd-sockets-interface"&gt;https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.3.0/zephyr/reference/networking/sockets.html#bsd-sockets-interface&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;So, as far as I can tell, except for the code responsible for establishing a connection (LTE or Thread), the sample should otherwise only need changes to prj.conf. A good place to start is probably to look at the coap_client Thread sample, and compare what options are set there versus in the mqtt_simple and coap_client samples for the nRF9160. You can remove the LTE link control, BSD library and AT Host related configuration options, as they are specific to the nRF91. The other big option you need to remove is the CONFIG_NET_SOCKETS_OFFLOAD, and set CONFIG_NET_NATIVE, as you want to use Zephyr&amp;#39;s network stack.&lt;/p&gt;
&lt;p&gt;From there, you can start figuring out what options you need to bring over from the coap_client Thread sample.&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>