<?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>NRF9160 MQTT Transmit Freeze afther 2048x12/14 has been send.</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/68457/nrf9160-mqtt-transmit-freeze-afther-2048x12-14-has-been-send</link><description>I have a program that recieves data from another chip over Serial. It sends 2048 blocks of data which than get transmitted to our C2 over mqtt. Problem is that afther 12/14 of these files the nrf freezes and stops responding/sending MQTT data. The same</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 15 Mar 2021 11:38:18 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/68457/nrf9160-mqtt-transmit-freeze-afther-2048x12-14-has-been-send" /><item><title>RE: NRF9160 MQTT Transmit Freeze afther 2048x12/14 has been send.</title><link>https://devzone.nordicsemi.com/thread/299754?ContentTypeID=1</link><pubDate>Mon, 15 Mar 2021 11:38:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e6aa33b1-760d-477d-89ff-d37b23a76412</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The issue shall be fixed with the release of libmodem v1.0.0 (bsdlib rename).&lt;/p&gt;
&lt;p&gt;Note that you should also add these configs for libmodem:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;CONFIG_NRF_MODEM_LIB_HEAP_SIZE=2048
CONFIG_POSIX_MAX_FDS=8&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Could you try on ncs v1.5.0 and see if the issue is also fixed on your end?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF9160 MQTT Transmit Freeze afther 2048x12/14 has been send.</title><link>https://devzone.nordicsemi.com/thread/299726?ContentTypeID=1</link><pubDate>Mon, 15 Mar 2021 10:38:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a8dade3f-8aca-4f06-ac41-97be53c85051</guid><dc:creator>Jupyter1336</dc:creator><description>&lt;p&gt;Has it been fixed yet?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF9160 MQTT Transmit Freeze afther 2048x12/14 has been send.</title><link>https://devzone.nordicsemi.com/thread/281493?ContentTypeID=1</link><pubDate>Tue, 24 Nov 2020 10:19:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:828eecc9-c494-41cf-9ce1-71c3eafea480</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="Helmmen"]I have found a work around till you fix the problem on your side. Use a post on sub topic as a start of dump function. Make this a single publish then the server should respond on subtopic that it recieved and that it can go ++ and send the next file. This brings the speed down to a staggering 1kb/s because of 2048 size but atleast it doesnt crash.[/quote]
&lt;p&gt;I&amp;#39;m glad you found a workaround for the issue, and my apologies for the inconvenience. We are working on providing a fix for this scenario.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF9160 MQTT Transmit Freeze afther 2048x12/14 has been send.</title><link>https://devzone.nordicsemi.com/thread/281197?ContentTypeID=1</link><pubDate>Sat, 21 Nov 2020 12:21:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8faaf04b-7032-4669-b3ed-20420226b85f</guid><dc:creator>Jupyter1336</dc:creator><description>&lt;p&gt;I have found a work around till you fix the problem on your side. Use a post on sub topic as a start of dump function. Make this a single publish then the server should respond on subtopic that it recieved and that it can go ++ and send the next file. This brings the speed down to a staggering 1kb/s because of 2048 size but atleast it doesnt crash.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF9160 MQTT Transmit Freeze afther 2048x12/14 has been send.</title><link>https://devzone.nordicsemi.com/thread/280909?ContentTypeID=1</link><pubDate>Thu, 19 Nov 2020 13:23:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:112956ac-32ef-4fcb-b106-b2a876304e8e</guid><dc:creator>Jupyter1336</dc:creator><description>&lt;p&gt;It is quite easy to reproduce with the mqtt example even on the new 1.4sdk All you have to do is send a burst of messages on the subtopic and when it wants to send those it freezes in the same manner it does now for me. Is there mabye a way I can avoid this with multithreading?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF9160 MQTT Transmit Freeze afther 2048x12/14 has been send.</title><link>https://devzone.nordicsemi.com/thread/280848?ContentTypeID=1</link><pubDate>Thu, 19 Nov 2020 11:04:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:715ccd79-f2ca-42d1-8224-ea86dfe4f3cb</guid><dc:creator>Jupyter1336</dc:creator><description>&lt;p&gt;I added the sleep time delay this had no effect. I added it in the following manner&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;        printf(&amp;quot;Data Publish&amp;quot;);
        data_publish(&amp;amp;client, MQTT_QOS_1_AT_LEAST_ONCE, keyvmessage_array, sizeof(keyvmessage_array));
        struct device *uart2= device_get_binding(&amp;quot;UART_2&amp;quot;); //these have to be in same reach as the send fucnction
        uart_fifo_fill(uart2, &amp;quot;PUBSUC6&amp;quot; ,sizeof(&amp;quot;PUBSUC6&amp;quot;)); //send function
        k_sleep(K_MSEC(100));
        cleanme();     &lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I also increased&amp;nbsp;&lt;span&gt;CONFIG_MAIN_STACK_SIZE&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;CONFIG_MAIN_STACK_SIZE=8192&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;This had no effect either.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF9160 MQTT Transmit Freeze afther 2048x12/14 has been send.</title><link>https://devzone.nordicsemi.com/thread/280816?ContentTypeID=1</link><pubDate>Thu, 19 Nov 2020 10:05:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3a34e3bf-5936-4680-ab88-e4813deec75c</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Judging by the usage fault register dump, it looks like a stack overflow has occurred:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;[00:02:03.805,297] &amp;lt;err&amp;gt; os: ***** USAGE FAULT *****
[00:02:03.811,096] &amp;lt;err&amp;gt; os:   Illegal load of EXC_RETURN into PC
[00:02:03.818,023] &amp;lt;err&amp;gt; os: r0/a1:  0x6d746120  r1/a2:  0x33616765  r2/a3:  0x72610a32
[00:02:03.826,904] &amp;lt;err&amp;gt; os: r3/a4:  0x6f697564 r12/ip:  0x4341423c r14/lr:  0x4150534b
[00:02:03.835,754] &amp;lt;err&amp;gt; os:  xpsr:  0x656c2000
[00:02:03.841,094] &amp;lt;err&amp;gt; os: s[ 0]:  0xffffffff  s[ 1]:  0xffffffff  s[ 2]:  0xffffffff  s[ 3]:  0xffffffff
[00:02:03.851,806] &amp;lt;err&amp;gt; os: s[ 4]:  0x0000000c  s[ 5]:  0xffffffff  s[ 6]:  0x00000000  s[ 7]:  0x000000c1
[00:02:03.862,487] &amp;lt;err&amp;gt; os: s[ 8]:  0x0000000d  s[ 9]:  0x00000000  s[10]:  0x00c34142  s[11]:  0x000000c1
[00:02:03.873,199] &amp;lt;err&amp;gt; os: s[12]:  0xffffffff  s[13]:  0x00000000  s[14]:  0x00000000  s[15]:  0x00c34142
[00:02:03.883,880] &amp;lt;err&amp;gt; os: fpscr:  0x43415053
[00:02:03.889,251] &amp;lt;err&amp;gt; os: Faulting instruction address (r15/pc): 0x6e3e4543
[00:02:03.897,338] &amp;lt;err&amp;gt; os: &amp;gt;&amp;gt;&amp;gt; ZEPHYR FATAL ERROR 0: CPU exception on CPU 0
[00:02:03.905,334] &amp;lt;err&amp;gt; os: Current thread: 0x20020ff8 (unknown)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;There&amp;#39;s nothing here that points to valid memory addresses.&lt;/p&gt;
&lt;p&gt;If I understand correctly, this is a side effect of trying to work around the original issue. You can try to adjust the CONFIG_MAIN_STACK_SIZE (or the size of the thread that is located on address space&amp;nbsp;0x20020ff8) if you see this issue again.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user=""]I have boiled it down even more now it doesnt matter the size of the message. Its afther 12 publishes on QOS_0 and 6 on QOS_1[/quote]
&lt;p&gt;Based on your description, I think you are running into a issue we recently found in bsdlib, where it locks up if you queue too many packets within a short period of time (we&amp;#39;re currently looking into this issue).&lt;/p&gt;
&lt;p&gt;For debugging purposes, could you try to add a delay of 100 ms (k_sleep(K_MSEC(100)) in your&amp;nbsp;mqtt_keypub function, and report back if this improves the scenario?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>