<?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 CoAP blockwise transfer</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/77756/nrf9160-coap-blockwise-transfer</link><description>Hello, 
 we are developing a customer product based on the nRF9160 and Nordic&amp;#39;s NCS v1.4.2 where we need to send battery test data every 30s (~ 1kB, PUT method). The communication is done with CoAP (on top of an UDP socket) and works fine. 
 To improve</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 22 Jul 2021 20:40:53 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/77756/nrf9160-coap-blockwise-transfer" /><item><title>RE: nRF9160 CoAP blockwise transfer</title><link>https://devzone.nordicsemi.com/thread/321440?ContentTypeID=1</link><pubDate>Thu, 22 Jul 2021 20:40:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1b74bf0a-b9de-4cb0-9b37-45a67860b8c4</guid><dc:creator>tkeilbach</dc:creator><description>&lt;p&gt;Hi Didrik,&lt;/p&gt;
&lt;p&gt;thank you for your reply.&lt;/p&gt;
&lt;p&gt;We managed to get the block wise transfer to work.&lt;/p&gt;
&lt;p&gt;The route of the confusion was that we thought the CoAP libraries does the splitting of the CoAP messaged automatically. That would have been very confienient, but in the end we did this manually by our own.&lt;/p&gt;
&lt;p&gt;Thanks again for your help!&lt;/p&gt;
&lt;p&gt;Thomas&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9160 CoAP blockwise transfer</title><link>https://devzone.nordicsemi.com/thread/321404?ContentTypeID=1</link><pubDate>Thu, 22 Jul 2021 15:00:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:efb37e26-a4df-404a-b099-dcdbb91ee94e</guid><dc:creator>Didrik Rokhaug</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;The application have to handle the blockwise transfer itself.&lt;/p&gt;
&lt;p&gt;This means that you have to append the relevant options, and split the body yourself. You can use the coap_block_size_to_bytes() function to help calculate how many bytes to append to the message.&lt;/p&gt;
&lt;p&gt;You also have to manage sending and/or receiving every block yourself. This is generally done by sending/receiving a request for each block.&lt;/p&gt;
&lt;p&gt;You can find the specification for how block transfers are done here: &lt;a href="https://datatracker.ietf.org/doc/html/rfc7959"&gt;CoAP Block Transfers&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;For code samples, you can look at large_get() in zephyr/samples/net/sockets/coap_server/src/coap-server.c, send_large_coap_request in zephyr/sampls/net/sockets/coap_client/src/coap-client.c and the CoAP implementation of the download_client in nrf/subsys/net/lib/download_client/src/coap.c.&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>