<?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>Increasing HTTP requests size using nRF7002</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/107429/increasing-http-requests-size-using-nrf7002</link><description>Hello, 
 We are evaluating nRF7002-DK (Wi-fi) using NCS v2.5.1. 
 We are following the lesson https://academy.nordicsemi.com/courses/wi-fi-fundamentals/lessons/lesson-5-wifi-fundamentals/topic/http-protocol/ and also checking the sample projects &amp;#39;download_client</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 24 Jan 2024 14:20:06 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/107429/increasing-http-requests-size-using-nrf7002" /><item><title>RE: Increasing HTTP requests size using nRF7002</title><link>https://devzone.nordicsemi.com/thread/465837?ContentTypeID=1</link><pubDate>Wed, 24 Jan 2024 14:20:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4a5cb2ed-2f9c-4676-a089-a3751adedcd3</guid><dc:creator>Charlie</dc:creator><description>&lt;p&gt;Hi Alink,&lt;/p&gt;
&lt;p&gt;The cause of overflow is due to the following ram size limitation, I&amp;nbsp;did a quick test with 16000 and it handles buffer&lt;span&gt;[8192]. You can try more to optimize this value.&lt;/span&gt;&amp;nbsp;&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;Best regards,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;Charlie&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Increasing HTTP requests size using nRF7002</title><link>https://devzone.nordicsemi.com/thread/465728?ContentTypeID=1</link><pubDate>Wed, 24 Jan 2024 09:12:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:541e66b8-049b-45bb-b43c-b88be5446d1e</guid><dc:creator>alink</dc:creator><description>&lt;p&gt;Hello Charlie,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Yes have been trying various configurations (from usage profiles) but still the limit is 2KB.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;That&amp;#39;s why if you can also update the buffer [4096][8192] on your side.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Reason is if we have larger buffer size, we can reduce the PUT requests.&lt;/p&gt;
&lt;p&gt;Thank you.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Increasing HTTP requests size using nRF7002</title><link>https://devzone.nordicsemi.com/thread/465498?ContentTypeID=1</link><pubDate>Tue, 23 Jan 2024 08:53:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f9597278-2094-4515-bd23-b42a967e3581</guid><dc:creator>Charlie</dc:creator><description>&lt;p&gt;Hi Alink,&lt;/p&gt;
&lt;p&gt;It is no surprise there is a limitation that is&amp;nbsp;decided by firmware setting, RAM limitation or HTTP server settings(which refuse to build HTTP connection with the client) as we discussed before.&lt;/p&gt;
&lt;p&gt;I suggest you check them one by one if you want to extend this limitation for your application, especially the HTTP server side.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Charlie&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Increasing HTTP requests size using nRF7002</title><link>https://devzone.nordicsemi.com/thread/465207?ContentTypeID=1</link><pubDate>Mon, 22 Jan 2024 01:44:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5358d367-993a-4027-9410-60430c036a37</guid><dc:creator>alink</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Yes, the code modification was correct, to 1976 buffer based on exercise. Indeed PUT request is successful for this.&lt;/p&gt;
&lt;p&gt;But if it is greater than 2KB, say buffer is 4096, it will be error 128.&lt;/p&gt;
&lt;p&gt;Please try on your side if buffer is 4KB or 8KB.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thank you.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Increasing HTTP requests size using nRF7002</title><link>https://devzone.nordicsemi.com/thread/465018?ContentTypeID=1</link><pubDate>Fri, 19 Jan 2024 11:46:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dc4d3a98-4cc7-4c2e-ac35-113ece8fb179</guid><dc:creator>Charlie</dc:creator><description>&lt;p&gt;&lt;span&gt;For #2 PUT, I still do not fully understand your attention.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I assume you are trying to fragment the 70KB file manually into 1976B to send through PUT requests. If this is correct, I made the following changes in the original exercise.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;static int client_http_put(void)
{
...
&amp;#160; &amp;#160; char buffer[1976] = {0};
...
&amp;#160; &amp;#160; req.payload_len = sizeof(buffer);
...
LOG_INF(&amp;quot;HTTP PUT request: %s,size:%d&amp;quot;, buffer,req.payload_len);
...
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Push button 1 can continuously send PUT requests to the server without limitation.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;...
[00:00:18.677,001] &amp;lt;inf&amp;gt; Lesson5_Exercise1: Connected to server
[00:00:18.677,124] &amp;lt;inf&amp;gt; Lesson5_Exercise1: HTTP PUT request: 0,size:1976
[00:00:18.959,503] &amp;lt;inf&amp;gt; Lesson5_Exercise1: Response status: Accepted
[00:00:21.923,004] &amp;lt;inf&amp;gt; Lesson5_Exercise1: Connected to server
[00:00:21.923,126] &amp;lt;inf&amp;gt; Lesson5_Exercise1: HTTP PUT request: 1,size:1976
[00:00:22.236,328] &amp;lt;inf&amp;gt; Lesson5_Exercise1: Response status: Accepted
[00:00:24.265,258] &amp;lt;inf&amp;gt; Lesson5_Exercise1: Connected to server
[00:00:24.265,380] &amp;lt;inf&amp;gt; Lesson5_Exercise1: HTTP PUT request: 2,size:1976
[00:00:24.389,160] &amp;lt;inf&amp;gt; Lesson5_Exercise1: Response status: Accepted
[00:00:26.263,488] &amp;lt;inf&amp;gt; Lesson5_Exercise1: Connected to server
[00:00:26.263,610] &amp;lt;inf&amp;gt; Lesson5_Exercise1: HTTP PUT request: 3,size:1976
[00:00:26.379,333] &amp;lt;inf&amp;gt; Lesson5_Exercise1: Response status: Accepted
[00:00:28.804,107] &amp;lt;inf&amp;gt; Lesson5_Exercise1: Connected to server
[00:00:28.804,229] &amp;lt;inf&amp;gt; Lesson5_Exercise1: HTTP PUT request: 4,size:1976
[00:00:28.920,196] &amp;lt;inf&amp;gt; Lesson5_Exercise1: Response status: Accepted
[00:00:30.798,248] &amp;lt;inf&amp;gt; Lesson5_Exercise1: Connected to server
[00:00:30.798,370] &amp;lt;inf&amp;gt; Lesson5_Exercise1: HTTP PUT request: 5,size:1976
[00:00:30.919,982] &amp;lt;inf&amp;gt; Lesson5_Exercise1: Response status: Accepted
[00:00:32.581,878] &amp;lt;inf&amp;gt; Lesson5_Exercise1: Connected to server
[00:00:32.582,000] &amp;lt;inf&amp;gt; Lesson5_Exercise1: HTTP PUT request: 6,size:1976
[00:00:32.888,214] &amp;lt;inf&amp;gt; Lesson5_Exercise1: Response status: Accepted
[00:00:36.195,220] &amp;lt;inf&amp;gt; Lesson5_Exercise1: Connected to server
[00:00:36.195,343] &amp;lt;inf&amp;gt; Lesson5_Exercise1: HTTP PUT request: 7,size:1976
[00:00:36.306,335] &amp;lt;inf&amp;gt; Lesson5_Exercise1: Response status: Accepted
...&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I wonder if there could be something wrong with your modification. Try to use a delayable work to trigger a put request instead of calling the&amp;nbsp;&lt;span&gt;client_http_put() function inside the callback.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Charlie&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Increasing HTTP requests size using nRF7002</title><link>https://devzone.nordicsemi.com/thread/464704?ContentTypeID=1</link><pubDate>Thu, 18 Jan 2024 00:50:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b3608085-99f7-4382-a7eb-f5501288d50e</guid><dc:creator>alink</dc:creator><description>&lt;p&gt;Hello,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thank you for informative reply.&lt;/p&gt;
&lt;p&gt;For #1 GET, this is mainly to test HTTP similar to &amp;#39;download_client&amp;#39;. The limit of 2KB is on the 9160.&lt;/p&gt;
&lt;p&gt;Understood on the limit on 8KB on web services and the &lt;span&gt;socket can fragment the data automatically.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt;For #2 PUT, we use the wififund :&amp;nbsp;&lt;a id="" href="https://github.com/NordicDeveloperAcademy/wifi-fund/blob/main/lesson5/wififund_less5_exer1_solution/src/main.c"&gt;https://github.com/NordicDeveloperAcademy/wifi-fund/blob/main/lesson5/wififund_less5_exer1_solution/src/main.c&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Specifically the client_http_put() we increase the buffer payload to a 2048 character array&amp;nbsp;buffer[1976], then modified response_cb() to &lt;/span&gt;&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&lt;span&gt;close(sock);&lt;/span&gt;&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&lt;span&gt;k_msleep(15);&lt;/span&gt;&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&lt;span&gt;count the request size sent up to 70KB (around 35 times)&lt;/span&gt;&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&lt;span&gt;ifsize &amp;gt; 70kb,&amp;nbsp;&lt;/span&gt;&lt;span&gt;call client_http_put()&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;You can try just by increasing buffer&amp;nbsp;client_http_put() in req.payload&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1705541862038v1.png" alt=" " /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Below is the&amp;nbsp;test on our side:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;This is requested 3 times when request size is reached&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Tried 1976 char array (72 bytes header) and it can send 3x, &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;img style="max-height:240px;max-width:320px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1705541639995v1.png" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;increasing it further and we receive error 128&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;img style="max-height:240px;max-width:320px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1705541301636v1.png" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Thank you.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Increasing HTTP requests size using nRF7002</title><link>https://devzone.nordicsemi.com/thread/464647?ContentTypeID=1</link><pubDate>Wed, 17 Jan 2024 15:07:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d3f4d476-f7f8-4b5f-aaa1-7e04a4426006</guid><dc:creator>Charlie</dc:creator><description>&lt;p&gt;Hi Alink,&lt;/p&gt;
[quote user=""]&lt;p&gt;Our project requires to use the board for HTTP GET and PUT requests that will have size of:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;GET: up to 60MB&lt;/li&gt;
&lt;li&gt;PUT: 3 requests at around 70KB each&lt;/li&gt;&lt;/ul&gt;[/quote]
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;60MB HTTP GET request is not common even in the web browser world.&amp;nbsp;&lt;a href="https://stackoverflow.com/questions/2659952/maximum-length-of-http-get-request"&gt;web services - Maximum length of HTTP GET request - Stack Overflow&lt;/a&gt;. Maybe you should first consider if you use them correctly&amp;nbsp;in your application according to GET and PUT definitions on&amp;nbsp;&lt;a href="https://en.wikipedia.org/wiki/HTTP#Request_methods"&gt;HTTP - Wikipedia&lt;/a&gt;, POST seems to be the correct request type to upload a big file.&lt;/p&gt;
&lt;p&gt;If you do need such kind of usage, I suggest&amp;nbsp;you consider other solutions(PC, Raspberry Pi kind of devices) for your project.&amp;nbsp;Linux host + nRF7002 could&amp;nbsp;be a solution but it is still under development.&lt;/p&gt;
&lt;p&gt;The MCU host+ nRF7002 solutions are targeted for lightweight IoT&amp;nbsp;applications with very limited resources. nRF5340 only has 512KB RAM, which is far less resource than you need to send a GET request. It can provide limited computing power considering your data size.&lt;/p&gt;
[quote user=""]Based on sample and the lesson, seems that there is a limit of 2KB buffer size not only in&amp;nbsp;&amp;#39;&lt;span&gt;download_client&amp;#39; but also when getting receive response buffer in &amp;#39;https_client&amp;#39;&lt;/span&gt;[/quote]
&lt;p&gt;This is a limitation&amp;nbsp;of the nRF9160 modem, its secure socket buffer size is 2kB so the incoming TLS packet is no bigger than 2KB. You can choose Zephyr native TLS socket instead of the one supported by the modem. See the following ticket for reference.&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/73647/mqtt-128kb-packet-size/303844"&gt;(+) MQTT 128kB packet size - Nordic Q&amp;amp;A - Nordic DevZone - Nordic DevZone (nordicsemi.com)&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;nRF7002DK has no such limitation since it uses&amp;nbsp;&lt;/span&gt;Zephyr TLS socket.&lt;/p&gt;
[quote user=""]1) In GET, I think a fixed 2KB buffer and size are passed to http_client_req(). Is there a way to set data larger than 2KB?[/quote]
&lt;p&gt;This is not&amp;nbsp;a limitation for the data sent out, since the socket can fragment the data automatically. If the device receives data from a server with TLS packet size bigger than 2KB, then it has problem.&lt;/p&gt;
[quote user=""]&lt;span&gt;2) One PUT payload also has 2KB limit in HTTP, increasing it returns error -128.&amp;nbsp;&lt;/span&gt;&lt;span&gt;I don&amp;#39;t think it is a size that can be sent by PUT due to the packet length limit.&lt;br /&gt;　Is there a limit that can be specified with HTTP PUT? Or is there a upload counterpart for &amp;#39;download_client&amp;#39;?&lt;/span&gt;[/quote]
&lt;div&gt;
&lt;div&gt;&lt;span&gt;Error -128 means&lt;/span&gt;&lt;span&gt;&amp;nbsp;the socket is not connected according to C:\NCS\toolchains\c57af46cb7\opt\zephyr-sdk\arm-zephyr-eabi\arm-zephyr-eabi\sys-include\sys\errno.h.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;Could you share more details about your HTTP PUT request tests? I can try to repeat the issue to check the reason.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;Best regards,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;Charlie&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>