<?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 goes into cpu idle after sending data</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/85980/nrf9160-goes-into-cpu-idle-after-sending-data</link><description>Hello nordic. I&amp;#39;m using your FTP client. The client can only send 4 kB of data at once so I send data numerous times and append to a file. The first send I do is 160kB which requires 40 packets to be sent. If I then send another file it halts after sending</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 23 Mar 2022 14:00:22 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/85980/nrf9160-goes-into-cpu-idle-after-sending-data" /><item><title>RE: nRF9160 goes into cpu idle after sending data</title><link>https://devzone.nordicsemi.com/thread/359629?ContentTypeID=1</link><pubDate>Wed, 23 Mar 2022 14:00:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:61b704eb-7dfa-44ed-b740-60bbdf522999</guid><dc:creator>nWre</dc:creator><description>&lt;p&gt;Well Einarh, you are a certified genius. It works very well. I tip my hat and thank you for the help.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9160 goes into cpu idle after sending data</title><link>https://devzone.nordicsemi.com/thread/359616?ContentTypeID=1</link><pubDate>Wed, 23 Mar 2022 13:21:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:700c8932-8b32-4802-b18b-bdbb865c3ce2</guid><dc:creator>Einarh</dc:creator><description>&lt;p&gt;Ok I have a suggestion.&lt;/p&gt;
&lt;p&gt;I assume it&amp;#39;s the main &amp;quot;send&amp;quot; function that prevents you from sending more than 4kB at a time.&lt;/p&gt;
&lt;p&gt;If you find &amp;quot;do_ftp_send_data&amp;quot; in ftp_client.c, and you modify the code to always limit the input to &amp;quot;send&amp;quot; to 4kB, would that work?&lt;/p&gt;
&lt;p&gt;Something like&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;[...]
while(offset &amp;lt; length) {
    if ((length - offset) &amp;gt; {4kB} { 
        sendlen = {4kB}
    } else { 
        sendlen = (length - offset)
    }
    ret = send(client.data_sock, message + offset, sendlen, 0);
[...]&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9160 goes into cpu idle after sending data</title><link>https://devzone.nordicsemi.com/thread/359605?ContentTypeID=1</link><pubDate>Wed, 23 Mar 2022 12:45:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:924499cb-3c70-48fa-9499-b42ebc08c69d</guid><dc:creator>nWre</dc:creator><description>&lt;p&gt;Correct! And not just a connection timed out but the cpu idles so it doesn&amp;#39;t continue executing. I&amp;#39;ve had timed out before where it just kept executing from where it was.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9160 goes into cpu idle after sending data</title><link>https://devzone.nordicsemi.com/thread/359604?ContentTypeID=1</link><pubDate>Wed, 23 Mar 2022 12:44:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b9cd0fd5-cb0c-4118-bece-1f6e4ee42395</guid><dc:creator>Einarh</dc:creator><description>&lt;p&gt;hm yes it does look like this is what you&amp;#39;re doing in your example.&lt;/p&gt;
&lt;p&gt;So after you run ftp_put 109 times in this example you get the connection timed out error?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9160 goes into cpu idle after sending data</title><link>https://devzone.nordicsemi.com/thread/359563?ContentTypeID=1</link><pubDate>Wed, 23 Mar 2022 10:31:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:29768587-e196-4709-a204-d7081edf347a</guid><dc:creator>nWre</dc:creator><description>&lt;p&gt;I see, that&amp;#39;s what I&amp;#39;m already doing in the example code, no?&lt;br /&gt;&lt;br /&gt;Regards&lt;/p&gt;
&lt;p&gt;nWre&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9160 goes into cpu idle after sending data</title><link>https://devzone.nordicsemi.com/thread/359557?ContentTypeID=1</link><pubDate>Wed, 23 Mar 2022 10:13:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8c63b052-d3e4-4d29-b496-09e262e9215b</guid><dc:creator>Einarh</dc:creator><description>&lt;p&gt;I don&amp;#39;t think you should run the k_work functions manually, if you use ftp_put then the FTP client will make sure the sequencing is done properly.&lt;/p&gt;
&lt;p&gt;What I mean is you should try running ftp_put for each 4kB segment without running uninit etc in between.&lt;/p&gt;
&lt;p&gt;-Einar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9160 goes into cpu idle after sending data</title><link>https://devzone.nordicsemi.com/thread/359542?ContentTypeID=1</link><pubDate>Wed, 23 Mar 2022 09:37:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bf575d59-fa61-423a-9c9c-0c2141cf5334</guid><dc:creator>nWre</dc:creator><description>&lt;p&gt;Hi again!&lt;br /&gt;&lt;br /&gt;Yes, I&amp;#39;ve tried that but unless it follows the flow described in ftp_put it doesn&amp;#39;t work. You either get an error saying bad sequence of commands or nothing at all happens.&lt;br /&gt;&lt;br /&gt;as described, the flow is:&lt;br /&gt;&lt;br /&gt;/** Typical sequence:&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; * FTP&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;51&amp;nbsp;&amp;nbsp; &amp;nbsp;Request: PASV&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; * FTP&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;96&amp;nbsp;&amp;nbsp; &amp;nbsp;Response: 227 Entering Passive Mode (90,130,70,73,105,177).&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; * FTP&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;63&amp;nbsp;&amp;nbsp; &amp;nbsp;Request: STOR upload2.txt&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; * FTP-DATA&amp;nbsp;&amp;nbsp; &amp;nbsp;53&amp;nbsp;&amp;nbsp; &amp;nbsp;FTP Data: 8 bytes (PASV) (STOR upload2.txt)&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; * FTP&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;67&amp;nbsp;&amp;nbsp; &amp;nbsp;Response: 150 Ok to send data.&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; * FTP&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;69&amp;nbsp;&amp;nbsp; &amp;nbsp;Response: 226 Transfer complete.&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; */&lt;br /&gt;&lt;br /&gt;but if I do:&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for (int i = 0; i &amp;lt; 10; i++) {&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;k_work_submit_to_queue(&amp;amp;ftp_work_q, &amp;amp;data_task_param.work);&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;ret = poll_data_task_done();&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;br /&gt;&lt;br /&gt;or even&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for (int i = 0; i &amp;lt; 10; i++) {&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;k_work_submit_to_queue(&amp;amp;ftp_work_q, &amp;amp;data_task_param.work);&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt;it doesn&amp;#39;t work.&lt;br /&gt;&lt;br /&gt;In another ftp thread a user said he managed to avoid socked disconnecting on each put and that he transferred a 10mb file so this should be possible, I just can&amp;#39;t get it to work.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9160 goes into cpu idle after sending data</title><link>https://devzone.nordicsemi.com/thread/359539?ContentTypeID=1</link><pubDate>Wed, 23 Mar 2022 09:30:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:64c0f1ca-6ad5-47de-9d5e-f009132c90dc</guid><dc:creator>Einarh</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;Yes it&amp;#39;s correct that the modem can&amp;#39;t send more than 4kB at a time, I thought the &amp;quot;send&amp;quot; function might be able to figure that out but I guess not.&lt;/p&gt;
&lt;p&gt;It does seem like the FTP put function automatically closes the data connection when the transfer is completed though, so it might be the case that you&amp;#39;re not supposed to uninit and open between each consecutive transfer.&lt;/p&gt;
&lt;p&gt;It could be that you&amp;#39;re clogging the available connections with control message connections since you&amp;#39;re opening many connections quickly?&lt;/p&gt;
&lt;p&gt;Remember that when you issue a put command, the transfer is placed in a queue, and isn&amp;#39;t executed immediately.&lt;/p&gt;
&lt;p&gt;I would try just queueing your transfers without disconnecting between each one if you haven&amp;#39;t already.&lt;/p&gt;
&lt;p&gt;-Einar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9160 goes into cpu idle after sending data</title><link>https://devzone.nordicsemi.com/thread/359418?ContentTypeID=1</link><pubDate>Tue, 22 Mar 2022 15:04:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:13332fdc-d8e3-43be-a1da-60c102203cf8</guid><dc:creator>nWre</dc:creator><description>&lt;p&gt;If I try to send a buffer larger than 4kB I get &amp;quot;E: send data failed: -122&amp;quot; and 122 error code is &amp;quot;Message too long&amp;quot;.&lt;br /&gt;&lt;br /&gt;Edit: And yes, I slice it myself. I read 4kB from my file into a buffer, send via ftp, read next 4kB, send via ftp etc.&lt;br /&gt;&lt;br /&gt;Edit2: I should mention that a previous thread about FTP on this forum said that 4kB was a restriction without a workaround, something with the modem firmware.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9160 goes into cpu idle after sending data</title><link>https://devzone.nordicsemi.com/thread/359417?ContentTypeID=1</link><pubDate>Tue, 22 Mar 2022 14:57:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d538ab05-b828-4f3d-b517-648322afb941</guid><dc:creator>Einarh</dc:creator><description>&lt;p&gt;Are you slicing the file into 4kB parts yourself before sending?&lt;/p&gt;
&lt;p&gt;Because it looks like the ftp code will do this for you, have you tried just sending the whole file?&lt;/p&gt;
&lt;p&gt;And when you send the &amp;quot;PASV&amp;quot; command I believe you are telling the server to enter passive mode to prepare to receive data. &amp;quot;Pass&amp;quot; is related to sending password credentials.&lt;/p&gt;
&lt;p&gt;You can read more about how FTP works &lt;a href="https://datatracker.ietf.org/doc/html/rfc959"&gt;here.&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;-Einar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9160 goes into cpu idle after sending data</title><link>https://devzone.nordicsemi.com/thread/359415?ContentTypeID=1</link><pubDate>Tue, 22 Mar 2022 14:54:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:82bf6131-28ee-4cdd-8bf4-5e3f7aa98e53</guid><dc:creator>nWre</dc:creator><description>&lt;p&gt;Here is a screenshot of the output where it fails:&lt;br /&gt;&lt;br /&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1647960792915v2.png" alt=" " /&gt;&lt;br /&gt;&lt;br /&gt;so it fails after 109 sends, as you can see, the port number is incremented each segment and I think this might be the cause of the problem.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9160 goes into cpu idle after sending data</title><link>https://devzone.nordicsemi.com/thread/359403?ContentTypeID=1</link><pubDate>Tue, 22 Mar 2022 14:06:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9306a713-d2c9-46b6-a73a-45a72e44baef</guid><dc:creator>nWre</dc:creator><description>&lt;p&gt;Hi!&lt;br /&gt;&lt;br /&gt;No it doesn&amp;#39;t matter. If I send a &amp;quot;file&amp;quot; large enough it will halt. What I&amp;#39;m doing is reading from a bin-file that I have stored on a micro-sd card and then sending 4kB at a time from that with the append command. &lt;br /&gt;&lt;br /&gt;Each time the &amp;quot;PASV&amp;quot; command is sent, a new port on the server is opened and my thinking was that maybe this is a limitation, that if you open enough ports, eventually the server will &amp;quot;lock&amp;quot;. &lt;br /&gt;&lt;br /&gt;If there is a way to use the same port, maybe by sending &amp;quot;PASS&amp;quot; instead of &amp;quot;PASV&amp;quot; or manually saving the port that was previously used this wouldn&amp;#39;t happen. I&amp;#39;ve tried doing this but I get error bad sequence of commands. &lt;br /&gt;&lt;br /&gt;After each segment sent, poll_task_done(); is called and I imagine the thread is deconstructed. &lt;br /&gt;&lt;br /&gt;The error occurs after about 100 segments, I will check the exact amount. It is not based on time but in segments and I think opening 100 ports for passive connection might be the problem but I see no way around it.&lt;br /&gt;&lt;br /&gt;Regards&lt;br /&gt;nWre&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9160 goes into cpu idle after sending data</title><link>https://devzone.nordicsemi.com/thread/359382?ContentTypeID=1</link><pubDate>Tue, 22 Mar 2022 13:18:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0fb2def3-b8bf-4fc7-bc31-ebb5c9bb0007</guid><dc:creator>Einarh</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;I&amp;#39;m looking through the program flow in ftp_client.c, and it looks like the file you send gets added to a workqueue as a single workitem.&lt;/p&gt;
&lt;p&gt;I could imagine that the work thread might starve the other threads, including the heartbeat timer, if the workitem is sufficiently large, causing your issue.&lt;/p&gt;
&lt;p&gt;Do you see the same behavior if you send the 70 packets right away without sending the 40 packets first?&lt;/p&gt;
&lt;p&gt;How long does it take before you get the error when you start sending your big file? Is it a matter of seconds?&lt;/p&gt;
&lt;p&gt;Also, from what I understand FTP keeps two separate connections for control messages and data transfer, which is why the connection would still be up after a timeout in the data connection.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Einar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9160 goes into cpu idle after sending data</title><link>https://devzone.nordicsemi.com/thread/359168?ContentTypeID=1</link><pubDate>Mon, 21 Mar 2022 14:03:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:044cf6ef-5b58-4808-a9d8-6e1e7d661032</guid><dc:creator>nWre</dc:creator><description>&lt;p&gt;Hi! Here is a test version:&lt;br /&gt;&lt;br /&gt;Main file&lt;br /&gt;&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;#include &amp;quot;ftptest.c&amp;quot;

void main(void)
{
    tfirstinit();
	tftpinit();
	for (int i = 0;i&amp;lt;120;i++){
		tftptest();
	}
}&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;ftptest.c&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;#include &amp;lt;zephyr.h&amp;gt;
#include &amp;lt;net/socket.h&amp;gt;
#include &amp;lt;stdio.h&amp;gt;
#include &amp;lt;drivers/uart.h&amp;gt;
#include &amp;lt;string.h&amp;gt;
#include &amp;lt;logging/log.h&amp;gt;
#include &amp;lt;ctype.h&amp;gt;
#include &amp;lt;net/tls_credentials.h&amp;gt;
#include &amp;lt;net/ftp_client.h&amp;gt;
#include &amp;lt;fs/fs.h&amp;gt;
#include &amp;lt;ff.h&amp;gt;
#include &amp;lt;device.h&amp;gt;
#include &amp;lt;drivers/spi.h&amp;gt;
#include &amp;lt;sys/printk.h&amp;gt;
#include &amp;lt;disk/disk_access.h&amp;gt;
#include &amp;lt;logging/log.h&amp;gt;

int treturnValue;

K_SEM_DEFINE(tmy_sem, 0, 1);
uint64_t testData[500] = {0};

void tftp_ctrl_callback(const uint8_t *msg, uint16_t len)
{
    printk(&amp;quot;%s&amp;quot;, msg);
    /* Release semaphore when receiving answer from server */
    k_sem_give(&amp;amp;my_sem);
}

void tftp_data_callback(const uint8_t *msg, uint16_t len)
{
    printk(&amp;quot;%s&amp;quot;, msg);
}

int tfirstinit(void){
    treturnValue = ftp_init(tftp_ctrl_callback, tftp_data_callback);
    return treturnValue;
}

int tftpinit(void)
{
    treturnValue = ftp_open(&amp;quot;MYSERVER&amp;quot;, 21, -1);
    treturnValue = ftp_login(&amp;quot;ACCNAME&amp;quot;, &amp;quot;ACCPASS&amp;quot;);
    return treturnValue;
}

int tftptest()
{
    for (int i = 0;i&amp;lt;500;i++){
        testData[i] = 0;
    } 
    int retVal = 0;
    retVal = ftp_put(&amp;quot;test.bin&amp;quot;, testData, sizeof(testData), FTP_PUT_APPEND);
    printk(&amp;quot;put procedure says: %i \n&amp;quot;, retVal);
    return retVal;
}

int tftpuninit(void){
    treturnValue = ftp_uninit();
    return treturnValue;
}&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;and prjconf&lt;br /&gt;&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;CONFIG_SPI=y                            # SPI hardware bus
CONFIG_SPI_SLAVE=y                      # SPI slave support [EXP]

CONFIG_LTE_AUTO_INIT_AND_CONNECT=y
CONFIG_NCS_SAMPLES_DEFAULTS=y
# LTE link control
CONFIG_LTE_LINK_CONTROL=y
# Modem library
CONFIG_NRF_MODEM_LIB=y
# Modem library
CONFIG_NRF_MODEM_LIB_SYS_INIT=y
# FTP Client
CONFIG_FTP_CLIENT=y

CONFIG_DISK_DRIVER_SDMMC=y
CONFIG_MAIN_STACK_SIZE=4096
CONFIG_SPI_NRFX_RAM_BUFFER_SIZE=8
CONFIG_FILE_SYSTEM=y
CONFIG_FAT_FILESYSTEM_ELM=y

# General config
CONFIG_NEWLIB_LIBC=y
CONFIG_NEWLIB_LIBC_FLOAT_PRINTF=y

# Network
CONFIG_PRINTK=y
CONFIG_NETWORKING=y
CONFIG_NET_NATIVE=n
CONFIG_NET_SOCKETS=y
CONFIG_NET_SOCKETS_OFFLOAD=y

CONFIG_HEAP_MEM_POOL_SIZE=4096
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048
CONFIG_PRINTK=y
CONFIG_ASSERT=y
CONFIG_STDOUT_CONSOLE=y
CONFIG_UART_INTERRUPT_DRIVEN=n
CONFIG_NET_SOCKETS_POSIX_NAMES=y
CONFIG_NET_BUF_USER_DATA_SIZE=1000
CONFIG_LOG=y
CONFIG_SDMMC_LOG_LEVEL_DBG=n&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;As each 4kB segment sent increments the portnumber(?) as shown by the output, I&amp;#39;m thinking I might reach a maximum amounts of connections to the server. I&amp;#39;m not that familiar with the FTP protocol but it feels like I shouldn&amp;#39;t be entering passive mode for each segment but only once and then just send data.&lt;br /&gt;&lt;br /&gt;Thanks again!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9160 goes into cpu idle after sending data</title><link>https://devzone.nordicsemi.com/thread/359049?ContentTypeID=1</link><pubDate>Mon, 21 Mar 2022 09:35:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dd70df13-2324-4c46-b85e-5c5e420a621a</guid><dc:creator>Einarh</dc:creator><description>&lt;p&gt;Hello again!&lt;/p&gt;
&lt;p&gt;Could you please share the most basic setup that causes the issue, so I can try to replicate?&lt;/p&gt;
&lt;p&gt;Also, have you looked into whether the issue could be server side, since your error message is connection related?&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Einar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>