<?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 publish</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/79560/mqtt-publish</link><description>Dear Sir. 
 
 Using the mqtt_simple project , I inserted a 1 sec timer. 
 Within the timer I want to use the publish routine like this 
 data_publish(&amp;amp;client,MQTT_QOS_1_AT_LEAST_ONCE,&amp;amp;json_text[0],_PUBLISH_SRC.json_reisha_size); 
 
 Is it OK ? , or the</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 14 Sep 2021 07:48:09 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/79560/mqtt-publish" /><item><title>RE: mqtt publish</title><link>https://devzone.nordicsemi.com/thread/329330?ContentTypeID=1</link><pubDate>Tue, 14 Sep 2021 07:48:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:44770689-431c-461e-8c8a-9645f74c94e9</guid><dc:creator>&amp;#216;yvind</dc:creator><description>&lt;p&gt;Hello,&amp;nbsp;&lt;br /&gt;&lt;br /&gt;What timer are you using? The k_timer is interrupt based, and the data_publish is effectively interrupt based due to the &lt;a href="https://infocenter.nordicsemi.com/topic/ps_nrf9160/ipc.html?resultof=%22%69%70%63%22%20"&gt;Inter Processor Communication between the modem and the application&lt;/a&gt;. This will cause issues as you are effectively getting a&amp;nbsp;nested interrupt, and can cause kernel panics. Please see&amp;nbsp;the &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.6.1/zephyr/reference/kernel/other/interrupts.html#interrupts"&gt;interrupts chapter for more information&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;We &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.6.1/zephyr/reference/kernel/threads/workqueue.html#workqueue-threads"&gt;recommend using the workqueue threads instead&lt;/a&gt;, as &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.6.1/zephyr/reference/kernel/other/interrupts.html#offloading-isr-work"&gt;according to the Offloading ISR work subchapter&lt;/a&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>