<?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 update own server</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/67411/fota-update-own-server</link><description>Dear Community; 
 
 We are trying to implement HTTP application update with our own server. We have flashed the &amp;quot;http_application_update&amp;quot; project to an nRF9160. It works fine with AWS, but we get an error with our own server: 
 
 
 
 Any clue about what</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 21 Oct 2020 14:11:54 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/67411/fota-update-own-server" /><item><title>RE: FOTA update own server</title><link>https://devzone.nordicsemi.com/thread/276250?ContentTypeID=1</link><pubDate>Wed, 21 Oct 2020 14:11:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6fb075d0-8bbf-4863-803f-74304f532efa</guid><dc:creator>Didrik Rokhaug</dc:creator><description>&lt;p&gt;Thanks for the log.&lt;/p&gt;
&lt;p&gt;It looks like the device is able to download the first fragment of 4096 bytes, but fails on the second one.&lt;/p&gt;
&lt;p&gt;How does the server send the image to the device? Does it just send the whole image in one go?&lt;/p&gt;
&lt;p&gt;I haven&amp;#39;t looked deep into exactly how the download_client library downloads an image, but my impression was that it asks for only a small part, and then send a new HTTP request for the next part, and so on.&lt;/p&gt;
&lt;p&gt;If it then only receives more of the file, and not a new HTTP response, that might explain this failure.&lt;/p&gt;
&lt;p&gt;And from the logs, it seems it doesn&amp;#39;t find a HTTP header in response to the second request.&lt;/p&gt;
&lt;p&gt;Could you capture a &lt;a href="https://devzone.nordicsemi.com/nordic/cellular-iot-guides/b/getting-started-cellular/posts/how-to-get-modem-trace-using-trace-collector-in-nrf-connect"&gt;modem trace&lt;/a&gt;? Or capture the IP packets sent from the server?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FOTA update own server</title><link>https://devzone.nordicsemi.com/thread/276090?ContentTypeID=1</link><pubDate>Wed, 21 Oct 2020 07:49:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:76b5273d-9a4d-4427-a115-c7d78eb5e23c</guid><dc:creator>isurki</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thank you for your answer.&amp;nbsp;&lt;/p&gt;
[quote userid="81181" url="~/f/nordic-q-a/67411/fota-update-own-server/275917#275917"]&lt;p&gt;Could you try again with added logging in the download_client library?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;[/quote]
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;Press Button 1 to start the FOTA download
[00:00:06.328,125] &amp;lt;inf&amp;gt; download_client: Attempting to connect over IPv4
[00:00:06.677,612] &amp;lt;inf&amp;gt; download_client: Connected to x.x.x.x
[00:00:06.677,612] &amp;lt;inf&amp;gt; download_client: Downloading: app_update.bin [0]
[00:00:06.677,734] &amp;lt;dbg&amp;gt; download_client.get_request_send: Sending HTTP request
[00:00:06.678,344] &amp;lt;dbg&amp;gt; download_client.download_thread: Receiving up to 4096 bytes at 0x20020004...
[00:00:07.021,667] &amp;lt;dbg&amp;gt; download_client.download_thread: Read 227 bytes from socket
[00:00:07.021,697] &amp;lt;dbg&amp;gt; download_client.header_parse: GET header size: 227
[00:00:07.021,728] &amp;lt;dbg&amp;gt; download_client.header_parse: File size = 144540
[00:00:07.021,789] &amp;lt;dbg&amp;gt; download_client.download_thread: Awaiting full fragment (0)
[00:00:07.021,789] &amp;lt;dbg&amp;gt; download_client.download_thread: Receiving up to 4096 bytes at 0x20020004...
[00:00:07.145,996] &amp;lt;dbg&amp;gt; download_client.download_thread: Read 708 bytes from socket
[00:00:07.146,026] &amp;lt;dbg&amp;gt; download_client.download_thread: Awaiting full fragment (708)
[00:00:07.146,057] &amp;lt;dbg&amp;gt; download_client.download_thread: Receiving up to 3388 bytes at 0x200202c8...
[00:00:07.258,178] &amp;lt;dbg&amp;gt; download_client.download_thread: Read 708 bytes from socket
[00:00:07.258,178] &amp;lt;dbg&amp;gt; download_client.download_thread: Awaiting full fragment (1416)
[00:00:07.258,178] &amp;lt;dbg&amp;gt; download_client.download_thread: Receiving up to 2680 bytes at 0x2002058c...
[00:00:08.726,654] &amp;lt;dbg&amp;gt; download_client.download_thread: Read 1024 bytes from socket
[00:00:08.726,684] &amp;lt;dbg&amp;gt; download_client.download_thread: Awaiting full fragment (2440)
[00:00:08.726,684] &amp;lt;dbg&amp;gt; download_client.download_thread: Receiving up to 1656 bytes at 0x2002098c...
[00:00:08.727,294] &amp;lt;dbg&amp;gt; download_client.download_thread: Read 1656 bytes from socket
[00:00:08.727,294] &amp;lt;inf&amp;gt; download_client: Downloaded 4096/144540 bytes (2%)
[00:00:08.727,355] &amp;lt;inf&amp;gt; fota_flash_block: Erasing sector at offset 0x00088000
[00:00:08.858,001] &amp;lt;inf&amp;gt; fota_flash_block: Erasing sector at offset 0x00089000
[00:00:08.949,737] &amp;lt;dbg&amp;gt; download_client.get_request_send: Sending HTTP request
[00:00:08.950,286] &amp;lt;dbg&amp;gt; download_client.download_thread: Receiving up to 4096 bytes at 0x20020004...
[00:00:08.950,531] &amp;lt;dbg&amp;gt; download_client.download_thread: Read 3692 bytes from socket
[00:00:08.950,592] &amp;lt;dbg&amp;gt; download_client.header_parse: Awaiting full header in response
[00:00:08.950,592] &amp;lt;dbg&amp;gt; download_client.download_thread: Receiving up to 404 bytes at 0x20020e70...
ASSERTION FAIL [dl-&amp;gt;offset &amp;lt; sizeof(dl-&amp;gt;buf)] @ /Users/Documents/ncs_last/nrf/subsys/net/lib/do5
        Buffer overflow
[00:00:09.210,021] &amp;lt;dbg&amp;gt; download_client.download_thread: Read 404 bytes from socket
[00:00:09.210,052] &amp;lt;dbg&amp;gt; download_client.header_parse: Awaiting full header in response
[00:00:09.224,609] &amp;lt;err&amp;gt; os: r0/a1:  0x00000004  r1/a2:  0x0000019f  r2/a3:  0x00000001
[00:00:09.224,609] &amp;lt;err&amp;gt; os: r3/a4:  0x0001dc65 r12/ip:  0x00000000 r14/lr:  0x00022583
[00:00:09.224,609] &amp;lt;err&amp;gt; os:  xpsr:  0x61000000
[00:00:09.224,639] &amp;lt;err&amp;gt; os: s[ 0]:  0x00000000  s[ 1]:  0x00000000  s[ 2]:  0x00000000  s[ 3]:  0x00000000
[00:00:09.224,639] &amp;lt;err&amp;gt; os: s[ 4]:  0x00000000  s[ 5]:  0x00000000  s[ 6]:  0x00000000  s[ 7]:  0x00000000
[00:00:09.224,670] &amp;lt;err&amp;gt; os: s[ 8]:  0x00000000  s[ 9]:  0x00000000  s[10]:  0x00000000  s[11]:  0x00000000
[00:00:09.224,670] &amp;lt;err&amp;gt; os: s[12]:  0x00000000  s[13]:  0x00000000  s[14]:  0x00000000  s[15]:  0x00000000
[00:00:09.224,670] &amp;lt;err&amp;gt; os: fpscr:  0x00000000
[00:00:09.224,700] &amp;lt;err&amp;gt; os: Faulting instruction address (r15/pc): 0x0002fdba
[00:00:09.224,731] &amp;lt;err&amp;gt; os: &amp;gt;&amp;gt;&amp;gt; ZEPHYR FATAL ERROR 4: Kernel panic on CPU 0
[00:00:09.224,731] &amp;lt;err&amp;gt; os: Current thread: 0x20021030 (unknown)
[00:00:09.333,007] &amp;lt;err&amp;gt; fatal_error: Resetting system&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote userid="81181" url="~/f/nordic-q-a/67411/fota-update-own-server/275917#275917"]&lt;p&gt;Which SDK version are you using?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;[/quote]
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;We use &amp;quot;&lt;span class="s1"&gt;Zephyr OS build v2.1.99-ncs1-16-ge23d8ac48dd0&lt;/span&gt;&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote userid="81181" url="~/f/nordic-q-a/67411/fota-update-own-server/275917#275917"]&lt;p&gt;Finally, are you using TLS?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;[/quote]
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;We don&amp;#39;t use TLS.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote userid="81181" url="~/f/nordic-q-a/67411/fota-update-own-server/275917#275917"]&lt;p&gt;Also, are you certain that your server did not send a fragment that was too big?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;[/quote]
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Not 100% sure, is there any way to check that?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Regards;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Ander.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FOTA update own server</title><link>https://devzone.nordicsemi.com/thread/275917?ContentTypeID=1</link><pubDate>Tue, 20 Oct 2020 12:35:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:66461a6d-5754-4223-bc7d-b2e52914979e</guid><dc:creator>Didrik Rokhaug</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Which SDK version are you using?&lt;/p&gt;
&lt;p&gt;Could you try again with added logging in the download_client library?&lt;/p&gt;
&lt;p&gt;Add the following lines to your prj.conf file (if you are using SES, you must re-open the project for the changes to take effect):&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;CONFIG_DOWNLOAD_CLIENT_LOG_LEVEL_DBG=y
CONFIG_FOTA_DOWNLOAD_LOG_LEVEL_DBG=y
CONFIG_LOG_MINIMAL=n&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Also, are you certain that your server did not send a fragment that was too big?&lt;/p&gt;
&lt;p&gt;Finally, are you using TLS?&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>