<?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>http request fails if server takes at least 3 seconds to start responding</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/97577/http-request-fails-if-server-takes-at-least-3-seconds-to-start-responding</link><description>I&amp;#39;m attempting to HTTP GET from a google cloud function that does a lost of processing so it takes a long time to start responding. On the latest version of my custom board this has started to consistently fail for several hours at a time but then start</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 24 Apr 2023 16:44:16 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/97577/http-request-fails-if-server-takes-at-least-3-seconds-to-start-responding" /><item><title>RE: http request fails if server takes at least 3 seconds to start responding</title><link>https://devzone.nordicsemi.com/thread/422124?ContentTypeID=1</link><pubDate>Mon, 24 Apr 2023 16:44:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:281ff61f-8b54-49e6-82ac-334dc02ff747</guid><dc:creator>Alex Fickle</dc:creator><description>&lt;p&gt;Thanks, I&amp;#39;ll get a trace next time it starts to fail.&lt;/p&gt;
&lt;p&gt;In the meantime I&amp;#39;ve verified that http timeouts do not work with Zephyr&amp;#39;s HTTP library due to lack of support for zsock_shutdown().&amp;nbsp; This combined with the lack of TCP keepalive support make me think that the connection is getting dropped by the network causing the test application to block forever on what it thinks is a working connection.&lt;/p&gt;
&lt;p&gt;Adding the below snippet prevents this.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;timeval timeoutVal;
timeoutVal.tv_sec = timeoutSeconds;
timeoutVal.tv_usec = 0;
const int ret = zsock_setsockopt(sock, SOL_SOCKET, SO_RCVTIMEO, &amp;amp;timeoutVal, sizeof(timeoutVal));&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: http request fails if server takes at least 3 seconds to start responding</title><link>https://devzone.nordicsemi.com/thread/422020?ContentTypeID=1</link><pubDate>Mon, 24 Apr 2023 11:35:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:88b8dde3-470b-4142-bdd0-20930883ce58</guid><dc:creator>Hakon</dc:creator><description>&lt;p&gt;Modem team;&lt;/p&gt;
&lt;div&gt;
&lt;p&gt;%XMODEMTRACE AT command should be used to set traces:&lt;/p&gt;
&lt;p&gt;AT%XMODEMTRACE=0&lt;br /&gt; AT%XMODEMTRACE=1,2&lt;br /&gt; AT+CFUN=0&lt;/p&gt;
&lt;p&gt;Then we need modem trace file started from socket connection to data transfer failure.&lt;/p&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: http request fails if server takes at least 3 seconds to start responding</title><link>https://devzone.nordicsemi.com/thread/420224?ContentTypeID=1</link><pubDate>Thu, 13 Apr 2023 11:46:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9eae0956-9c80-4c1c-a647-5e6ea7d4f542</guid><dc:creator>Hakon</dc:creator><description>&lt;p&gt;I will ask the modem team if there is anything that can be done to achieve this.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: http request fails if server takes at least 3 seconds to start responding</title><link>https://devzone.nordicsemi.com/thread/419817?ContentTypeID=1</link><pubDate>Tue, 11 Apr 2023 18:53:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cfb507aa-37e8-42d8-862b-57e1cd471345</guid><dc:creator>Alex Fickle</dc:creator><description>&lt;p&gt;I&amp;#39;ve attached a trace file from a successful run with a 5 second delay.&amp;nbsp; The modem is currently in a run of operating as expected after not working for three days.&amp;nbsp; Let me know if I should change any build options to enable more trace output, I did not see any options from this besides CONFIG_NRF_MODEM_LIB_TRACE_LEVEL_FULL which seems to be defaulting as enabled.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/trace_2D00_2023_2D00_04_2D00_11T18_2D00_44_2D00_00.399Z.bin"&gt;devzone.nordicsemi.com/.../trace_2D00_2023_2D00_04_2D00_11T18_2D00_44_2D00_00.399Z.bin&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: http request fails if server takes at least 3 seconds to start responding</title><link>https://devzone.nordicsemi.com/thread/419746?ContentTypeID=1</link><pubDate>Tue, 11 Apr 2023 13:48:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4beb7b34-6c89-4490-8922-4b2075e32353</guid><dc:creator>Hakon</dc:creator><description>&lt;p&gt;Here is the response from the modem team;&lt;/p&gt;
&lt;div&gt;
&lt;p&gt;I don&amp;#39;t see any problem with modem&amp;#39;s operation in attached modem trace file. Maybe more trace groups should be activated and then take new log with socket open and connect and then data transfer.&lt;/p&gt;
&lt;p&gt;From attached modem trace file I can find only two TCP ACK DL packets form server to UE, no other data transmissions.&lt;/p&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: http request fails if server takes at least 3 seconds to start responding</title><link>https://devzone.nordicsemi.com/thread/419250?ContentTypeID=1</link><pubDate>Wed, 05 Apr 2023 11:48:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8b44dfac-de7b-4142-a59f-d3a530cc4119</guid><dc:creator>Hakon</dc:creator><description>&lt;p&gt;Thanks. I have notified the modem team.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: http request fails if server takes at least 3 seconds to start responding</title><link>https://devzone.nordicsemi.com/thread/418909?ContentTypeID=1</link><pubDate>Mon, 03 Apr 2023 21:38:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c288a714-f234-4f62-8b44-44d350a5ef73</guid><dc:creator>Alex Fickle</dc:creator><description>&lt;p&gt;It just started failing again, I am attaching a trace.&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/trace_2D00_2023_2D00_04_2D00_03T21_2D00_35_2D00_52.556Z.bin"&gt;devzone.nordicsemi.com/.../trace_2D00_2023_2D00_04_2D00_03T21_2D00_35_2D00_52.556Z.bin&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: http request fails if server takes at least 3 seconds to start responding</title><link>https://devzone.nordicsemi.com/thread/416657?ContentTypeID=1</link><pubDate>Tue, 21 Mar 2023 20:59:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d1734bfa-5ef2-4a36-81a6-eca1626eabb8</guid><dc:creator>Alex Fickle</dc:creator><description>&lt;p&gt;It might be a day or so before I am able to replicate again, but I&amp;#39;ll get another trace when I can. The device has started to go on a run of working well which it does occasionally. No idea what causes this. It started working when I let it sit in a failure loop overnight when there was no one near it. Since then it has been working all day even when I reprogram it.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: http request fails if server takes at least 3 seconds to start responding</title><link>https://devzone.nordicsemi.com/thread/416625?ContentTypeID=1</link><pubDate>Tue, 21 Mar 2023 16:00:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:afd11002-da18-4e9c-b195-61d1d0a85264</guid><dc:creator>Hakon</dc:creator><description>&lt;p&gt;I tried to decode the trace, and it&amp;#39;s almost empty. Could you try to do another trace?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: http request fails if server takes at least 3 seconds to start responding</title><link>https://devzone.nordicsemi.com/thread/416604?ContentTypeID=1</link><pubDate>Tue, 21 Mar 2023 14:55:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a3c5dc1b-a61b-4a2a-a627-6457aaf1ceaa</guid><dc:creator>Alex Fickle</dc:creator><description>&lt;p&gt;Here is a trace with it failing.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/3465.failure_2D00_trace.bin"&gt;devzone.nordicsemi.com/.../3465.failure_2D00_trace.bin&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: http request fails if server takes at least 3 seconds to start responding</title><link>https://devzone.nordicsemi.com/thread/416483?ContentTypeID=1</link><pubDate>Tue, 21 Mar 2023 10:06:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5f2b5f2b-e37c-448e-8196-f9d23f2c8131</guid><dc:creator>Hakon</dc:creator><description>&lt;p&gt;I tried with HTTP_DELAY 3, and I still get a successful HTTP GET. Can you try to do a modem trace when it is not working?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: http request fails if server takes at least 3 seconds to start responding</title><link>https://devzone.nordicsemi.com/thread/416326?ContentTypeID=1</link><pubDate>Mon, 20 Mar 2023 14:52:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:24a5b15b-76ae-4652-8289-f0a779693039</guid><dc:creator>Hakon</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;I&amp;#39;m taking over for Jonathan. I will try to reproduce this.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: http request fails if server takes at least 3 seconds to start responding</title><link>https://devzone.nordicsemi.com/thread/415540?ContentTypeID=1</link><pubDate>Wed, 15 Mar 2023 15:41:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f71e7a44-c752-4af1-9957-d07f799b00a7</guid><dc:creator>Alex Fickle</dc:creator><description>&lt;p&gt;Minor update, there was a bug in the output of the cell signal strength in the above logs.&amp;nbsp; The real signal strength was -77 dBm for the failure case and -74 dBm for the success case.&amp;nbsp; Should not change much as these are both&amp;nbsp;excellent values.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: http request fails if server takes at least 3 seconds to start responding</title><link>https://devzone.nordicsemi.com/thread/414995?ContentTypeID=1</link><pubDate>Mon, 13 Mar 2023 16:43:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:21d76438-840a-4e11-a01f-a61614014a36</guid><dc:creator>JONATHAN LL</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Will look in to this and get back to you.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Note: If you put all the files in a compressed folder like zip file then it will be accepted.&lt;br /&gt;&lt;br /&gt;Regards,&lt;br /&gt;Jonathan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: http request fails if server takes at least 3 seconds to start responding</title><link>https://devzone.nordicsemi.com/thread/414753?ContentTypeID=1</link><pubDate>Sat, 11 Mar 2023 05:41:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a9ef1f27-aebb-43f2-abaa-42db8eadcd4e</guid><dc:creator>Alex Fickle</dc:creator><description>&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/failure_2D00_trace.bin"&gt;devzone.nordicsemi.com/.../failure_2D00_trace.bin&lt;/a&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/failure_2D00_log.txt"&gt;devzone.nordicsemi.com/.../failure_2D00_log.txt&lt;/a&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/success_2D00_trace.bin"&gt;devzone.nordicsemi.com/.../success_2D00_trace.bin&lt;/a&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/success_2D00_log.txt"&gt;devzone.nordicsemi.com/.../success_2D00_log.txt&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: http request fails if server takes at least 3 seconds to start responding</title><link>https://devzone.nordicsemi.com/thread/414752?ContentTypeID=1</link><pubDate>Sat, 11 Mar 2023 05:40:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cb753153-0441-4d23-8d88-e14332a85dfa</guid><dc:creator>Alex Fickle</dc:creator><description>&lt;p&gt;Looks like attaching the prg.conf is what caused creating the post to fail, inserting the as code snippets instead.&lt;/p&gt;
&lt;p&gt;prj.conf:&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;# bootloader
CONFIG_BOOTLOADER_MCUBOOT=y

# C++
CONFIG_CPLUSPLUS=y
CONFIG_STD_CPP17=y
CONFIG_LIB_CPLUSPLUS=y

# libc
CONFIG_NEWLIB_LIBC=y
CONFIG_NEWLIB_LIBC_FLOAT_PRINTF=y
CONFIG_NEWLIB_LIBC_NANO=n

# logging
CONFIG_LOG=y
CONFIG_LOG_MODE_DEFERRED=y
CONFIG_LOG_BUFFER_SIZE=16384
CONFIG_NRF_MODEM_LOG=y
CONFIG_NRF_MODEM_LIB_LOG_LEVEL_DBG=y
CONFIG_LTE_LINK_CONTROL_LOG_LEVEL_DBG=y
CONFIG_PDN_LOG_LEVEL_DBG=y
CONFIG_DATE_TIME_LOG_LEVEL_DBG=y
CONFIG_MODEM_KEY_MGMT_LOG_LEVEL_DBG=y
CONFIG_NET_LOG=y
CONFIG_NET_HTTP_LOG_LEVEL_DBG=y

# trace
CONFIG_NRF_MODEM_LIB_TRACE=y
CONFIG_NRF_MODEM_LIB_TRACE_BACKEND_UART_SYNC=y

# networking
CONFIG_NETWORKING=y
CONFIG_NET_SOCKETS=y
CONFIG_NET_SOCKETS_POSIX_NAMES=y
CONFIG_NET_NATIVE=n
CONFIG_MODEM_KEY_MGMT=y
CONFIG_NRF_MODEM_LIB=y
CONFIG_LTE_LINK_CONTROL=y
CONFIG_LTE_NETWORK_MODE_LTE_M=y
CONFIG_LTE_NETWORK_USE_FALLBACK=n
CONFIG_PDN=y
CONFIG_PDN_DEFAULTS_OVERRIDE=y
CONFIG_PDN_DEFAULT_AUTH_CHAP=y
CONFIG_PDN_DEFAULT_APN=&amp;quot;pelion&amp;quot;
CONFIG_PDN_DEFAULT_USERNAME=&amp;quot;default&amp;quot;
CONFIG_PDN_DEFAULT_PASSWORD=&amp;quot;void&amp;quot;

# network auto connecting
CONFIG_NRF_MODEM_LIB_SYS_INIT=y
# TODO: test if below is needed in latest SDK version, was needed in v2.0.0
CONFIG_PDN_INIT_PRIORITY=89
CONFIG_LTE_AUTO_INIT_AND_CONNECT=n

# date time library
CONFIG_DATE_TIME=y
CONFIG_DATE_TIME_NTP=n
CONFIG_DATE_TIME_MODEM=y
CONFIG_DATE_TIME_AUTO_UPDATE=y

# modem info library
CONFIG_MODEM_INFO=y
CONFIG_MODEM_INFO_ADD_SIM=n
CONFIG_MODEM_INFO_ADD_DEVICE=y
CONFIG_MODEM_INFO_ADD_DATE_TIME=n
CONFIG_MODEM_INFO_ADD_NETWORK=y

# http
CONFIG_HTTP_CLIENT=y

# main thread
CONFIG_MAIN_THREAD_PRIORITY=3
CONFIG_MAIN_STACK_SIZE=4096

# debug options
CONFIG_DEBUG=n
CONFIG_DEBUG_COREDUMP=y
CONFIG_DEBUG_COREDUMP_BACKEND_LOGGING=y
CONFIG_DEBUG_COREDUMP_MEMORY_DUMP_MIN=n

CONFIG_RESET_ON_FATAL_ERROR=n
CONFIG_REBOOT=y
&lt;/pre&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/3463.main.cpp"&gt;devzone.nordicsemi.com/.../3463.main.cpp&lt;/a&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/2476.CMakeLists.txt"&gt;devzone.nordicsemi.com/.../2476.CMakeLists.txt&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>