<?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>FOTA download breaking up</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/113704/fota-download-breaking-up</link><description>Product: NRF9160 
 SDK: 2.6.1 
 Modem: 1.3.6 My problem is that FOTA download is breaking up more or less every time our device is doing a SW upgrade. We download SW directly from AWS S3 bucket using download client. But that S3 is a pain to debug so</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 05 Sep 2024 10:17:51 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/113704/fota-download-breaking-up" /><item><title>RE: FOTA download breaking up</title><link>https://devzone.nordicsemi.com/thread/501324?ContentTypeID=1</link><pubDate>Thu, 05 Sep 2024 10:17:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ce7cd2ef-a1e7-4771-803b-a07c41d6531f</guid><dc:creator>Michal</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Please make a new ticket and please also provide us with your Modem FW version and a modem trace.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Michal&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FOTA download breaking up</title><link>https://devzone.nordicsemi.com/thread/501103?ContentTypeID=1</link><pubDate>Wed, 04 Sep 2024 08:48:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5868961b-3a14-4267-b8d6-0bc9283289c0</guid><dc:creator>Rakshita</dc:creator><description>&lt;p&gt;Hey Michal&lt;br /&gt;I am on sdk v2.6.1, after making changes in the download_client library also the downloading stops after every 204800 bytes (my DOWNLOAD_CLIENT_BUF_SIZE=2048), and while trying to reconnect also fails&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;[00:01:43.639,343] &amp;lt;wrn&amp;gt; download_client: Peer closed connection, will re-connect
[00:01:43.639,373] &amp;lt;dbg&amp;gt; download_client: download_thread: Receiving up to 2048 bytes at 0x2000095c...
[00:01:44.354,797] &amp;lt;dbg&amp;gt; download_client: handle_received: Read 2048 bytes from socket
[00:01:44.354,827] &amp;lt;inf&amp;gt; download_client: Downloaded 204800/555880 bytes (36%)

[ 36% ] |================== | (204800/555880 bytes)[00:01:44.355,529] &amp;lt;inf&amp;gt; download_client: Reconnecting...
[00:01:44.370,086] &amp;lt;dbg&amp;gt; download_client: client_connect: Port not specified, using default: 443
[00:01:44.370,208] &amp;lt;dbg&amp;gt; download_client: host_lookup: Failed to resolve hostname s3.amazonaws.com on IPv6
[00:01:44.393,005] &amp;lt;dbg&amp;gt; download_client: client_socket_connect: family: 1, type: 1, proto: 258
11122[00:01:44.393,707] &amp;lt;inf&amp;gt; download_client: Setting up TLS credentials, sec tag count 1
[00:01:44.393,798] &amp;lt;inf&amp;gt; download_client: Connecting to 52.217.125.16
[00:01:44.393,829] &amp;lt;dbg&amp;gt; download_client: client_socket_connect: fd 9, addrlen 8, fam IPv4, port 443
[00:01:44.394,287] &amp;lt;err&amp;gt; download_client: Unable to connect, errno 2
[00:01:44.394,622] &amp;lt;err&amp;gt; fota: Error -2 during download

[00:01:44.399,963] &amp;lt;inf&amp;gt; fota: Network disconnected
[00:01:44.418,762] &amp;lt;dbg&amp;gt; download_client: set_state: state = 0
[00:01:44.418,792] &amp;lt;inf&amp;gt; fota: Socket closed

[00:01:44.418,792] &amp;lt;err&amp;gt; fota: Error -117 during download&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FOTA download breaking up</title><link>https://devzone.nordicsemi.com/thread/497980?ContentTypeID=1</link><pubDate>Tue, 13 Aug 2024 09:03:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8bfbbf3c-72b1-4feb-95cb-9ce636b00104</guid><dc:creator>Achim Kraus</dc:creator><description>&lt;p&gt;Just in the case:&lt;/p&gt;
&lt;p&gt;Do you use a SIM card with &amp;quot;rate limit&amp;quot;?&lt;/p&gt;
&lt;p&gt;See&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/103520/cgev-apnratectrl-stat---not-reported-with-pdn_event_handler_t"&gt;NCS 2.4.1- cgev apnratectrl stat - not reported with pdn_event_handler_t&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FOTA download breaking up</title><link>https://devzone.nordicsemi.com/thread/497898?ContentTypeID=1</link><pubDate>Mon, 12 Aug 2024 23:36:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5eb7ff5c-c36e-412a-89ef-b08b159c3630</guid><dc:creator>Michal</dc:creator><description>[quote user="fastfox"]This turned out to be a wild goose chase. Why I see this breaking up is most probably because of a bug in download client here:&amp;nbsp;&lt;a href="https://github.com/nrfconnect/sdk-nrf/blob/main/subsys/net/lib/download_client/src/http.c#L223"&gt;https://github.com/nrfconnect/sdk-nrf/blob/main/subsys/net/lib/download_client/src/http.c#L223&lt;/a&gt;[/quote]
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thank you very much for the information, I will report that and hopefully it will get fixed in the next release.&lt;/p&gt;
[quote user="fastfox"]But the goose chase was because while debugging this I might have bumped into the real problem that I was hunting at. It looks like sometimes the lower layers just die and nothing goes through anymore. Signal quality is fine so this will be a bit trickier to hunt down. I don&amp;#39;t think I can even get the modem traces out from that custom HW. But this is another story[/quote]
&lt;p&gt;That does sound like something that may be hard for us to debug without a modem trace unfortunately...&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Michal&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FOTA download breaking up</title><link>https://devzone.nordicsemi.com/thread/497613?ContentTypeID=1</link><pubDate>Fri, 09 Aug 2024 11:45:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:20e48500-6e95-48fa-bbdc-451309d78e9b</guid><dc:creator>fastfox</dc:creator><description>&lt;p&gt;This turned out to be a wild goose chase. Why I see this breaking up is most probably because of a bug in download client here:&amp;nbsp;&lt;a href="https://github.com/nrfconnect/sdk-nrf/blob/main/subsys/net/lib/download_client/src/http.c#L223"&gt;https://github.com/nrfconnect/sdk-nrf/blob/main/subsys/net/lib/download_client/src/http.c#L223&lt;/a&gt;&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;p = strnstr(client-&amp;gt;buf, &amp;quot;\r\nconnection: close&amp;quot;, sizeof(client-&amp;gt;buf));&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;should probably say&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;p = strnstr(client-&amp;gt;buf, &amp;quot;\r\nconnection: close&amp;quot;, *hdr_len);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Now it examines if garbage or binary content happens to have&amp;nbsp;that text there and it usually does if you use un-encrypted binary that has exactly that code line in it somewhere. Feel free to create a bug &lt;a href="https://devzone.nordicsemi.com/members/michal_5f00_r"&gt;Michal&lt;/a&gt;&amp;nbsp;&lt;br /&gt;&lt;br /&gt;But the goose chase was because while debugging this I might have bumped into the real problem that I was hunting at. It looks like sometimes the lower layers just die and nothing goes through anymore. Signal quality is fine so this will be a bit trickier to hunt down. I don&amp;#39;t think I can even get the modem traces out from that custom HW. But this is another story&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FOTA download breaking up</title><link>https://devzone.nordicsemi.com/thread/497589?ContentTypeID=1</link><pubDate>Fri, 09 Aug 2024 09:06:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:94227ee8-47b8-48f0-b072-e374037ce479</guid><dc:creator>fastfox</dc:creator><description>&lt;p&gt;One funny observation from this is that the download seems to break at the same binary offset. Like below with 200 and 300kB files:&lt;br /&gt;&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;[00:00:56.926,757] &amp;lt;inf&amp;gt; download_client: Downloaded 101376/227227 bytes (44%)
[00:00:57.152,160] &amp;lt;wrn&amp;gt; download_client: Peer closed connection, will re-connect
[00:00:57.152,252] &amp;lt;inf&amp;gt; download_client: Downloaded 102400/227227 bytes (45%)
[00:00:57.163,726] &amp;lt;inf&amp;gt; download_client: Reconnecting...

...

[00:01:45.487,915] &amp;lt;inf&amp;gt; download_client: Downloaded 203776/227227 bytes (89%)
[00:01:45.727,203] &amp;lt;wrn&amp;gt; download_client: Peer closed connection, will re-connect
[00:01:45.727,416] &amp;lt;inf&amp;gt; download_client: Downloaded 204800/227227 bytes (90%)
[00:01:45.738,800] &amp;lt;inf&amp;gt; download_client: Reconnecting...&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;[00:01:00.961,517] &amp;lt;inf&amp;gt; download_client: Downloaded 101376/310339 bytes (32%)
[00:01:01.291,076] &amp;lt;wrn&amp;gt; download_client: Peer closed connection, will re-connect
[00:01:01.291,168] &amp;lt;inf&amp;gt; download_client: Downloaded 102400/310339 bytes (32%)
[00:01:01.302,551] &amp;lt;inf&amp;gt; download_client: Reconnecting...

...

[00:01:38.770,080] &amp;lt;inf&amp;gt; download_client: Downloaded 203776/310339 bytes (65%)
[00:01:38.996,246] &amp;lt;wrn&amp;gt; download_client: Peer closed connection, will re-connect
[00:01:38.996,368] &amp;lt;inf&amp;gt; download_client: Downloaded 204800/310339 bytes (65%)
[00:01:39.007,781] &amp;lt;inf&amp;gt; download_client: Reconnecting...&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Maybe I&amp;#39;ll try to sniff the flashwriting a bit. Maybe it causes some unwanted side effects somehow&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FOTA download breaking up</title><link>https://devzone.nordicsemi.com/thread/497386?ContentTypeID=1</link><pubDate>Wed, 07 Aug 2024 21:51:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9e732152-efcb-4e7c-98a6-7b6f99215945</guid><dc:creator>Michal</dc:creator><description>&lt;p&gt;Thank you for the clarification. I will check internally about any possible fixes.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Michal&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FOTA download breaking up</title><link>https://devzone.nordicsemi.com/thread/497255?ContentTypeID=1</link><pubDate>Wed, 07 Aug 2024 05:14:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:be2e6c9d-7ed1-4ac0-b0fd-0b91fb8d3cc3</guid><dc:creator>fastfox</dc:creator><description>&lt;p&gt;Should have written NRF9160.&amp;nbsp;Sorry. Fixed to the ticket&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FOTA download breaking up</title><link>https://devzone.nordicsemi.com/thread/497195?ContentTypeID=1</link><pubDate>Tue, 06 Aug 2024 14:53:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:29c1200b-d134-409f-a0bc-e7514970865a</guid><dc:creator>Michal</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
[quote user=""]&lt;p&gt;Product: NRF9161&lt;/p&gt;
&lt;p&gt;SDK: 2.6.1&lt;/p&gt;
&lt;p&gt;Modem: 1.3.6&lt;/p&gt;[/quote]
&lt;p&gt;Are you sure this is correct? nRF9161 should be using 2.x.x MFW version:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://www.nordicsemi.com/Products/nRF9161/Download?lang=en#infotabs"&gt;https://www.nordicsemi.com/Products/nRF9161/Download?lang=en#infotabs&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Michal&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FOTA download breaking up</title><link>https://devzone.nordicsemi.com/thread/497125?ContentTypeID=1</link><pubDate>Tue, 06 Aug 2024 10:37:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:94cbb98a-88bc-4791-8974-4ed383064747</guid><dc:creator>Achim Kraus</dc:creator><description>&lt;p&gt;That depends ...&lt;/p&gt;
&lt;p&gt;If you just want to check, if it really works as I promise, you may just use my &lt;a href="https://github.com/boaks/zephyr-coaps-client"&gt;Zephyr - CoAP/DTLS 1.2 CID demo client&lt;/a&gt; and the &lt;a href="https://github.com/eclipse-californium/californium/tree/main/demo-apps/cf-s3-proxy-server"&gt;Californium - CoAP-S3-proxy&lt;/a&gt; . I&amp;#39;m currently updating the client, hope that&amp;#39;s done until the end of week. For the server you may download it from&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://repo.eclipse.org/content/repositories/californium-releases/org/eclipse/californium/cf-s3-proxy-server/3.12.1/cf-s3-proxy-server-3.12.1.jar"&gt;https://repo.eclipse.org/content/repositories/californium-releases/org/eclipse/californium/cf-s3-proxy-server/3.12.1/cf-s3-proxy-server-3.12.1.jar &lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The first development version with FOTA is now about a year available. As I wrote, the download itself works pretty reliable, only some mistakes from my side caused recently mcuboot issues. &amp;nbsp;&lt;/p&gt;
&lt;p&gt;If you want to use that approach for your app, then I guess it will be more work ... Maybe the open sources of my above demo client helps. Or you consider to test it with your next project or product.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FOTA download breaking up</title><link>https://devzone.nordicsemi.com/thread/497124?ContentTypeID=1</link><pubDate>Tue, 06 Aug 2024 10:27:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4c7a0a0d-af8c-4e2e-96a6-1e55a7437c84</guid><dc:creator>fastfox</dc:creator><description>&lt;p&gt;That might very well be an option. We have californium running there already anyway. At least that would help in the&amp;nbsp;ridiculous header/payload ratio that we now have. Something like 400B/1024B.&lt;br /&gt;&lt;br /&gt;Only thing preventing to do that is me being lazy as I suspect that it would take weeks to get that done and tested properly.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FOTA download breaking up</title><link>https://devzone.nordicsemi.com/thread/497122?ContentTypeID=1</link><pubDate>Tue, 06 Aug 2024 10:22:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:10d6df5d-9d8c-4db8-8c41-47742da95089</guid><dc:creator>Achim Kraus</dc:creator><description>&lt;p&gt;I guess, that&amp;#39;s no option for you, but using CoAP/DTLS 1.2 CID and the Californium CoAP-S3-proxy my FOTA success rate is about 99%&amp;nbsp; (370 kB) :-).&lt;/p&gt;
&lt;p&gt;(At least, if I don&amp;#39;t accidentally change the flash partitions and kill mcuboot. Then only the download works reliable, but the update itself fails ;-) ):&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>