<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>MCUXpresso GeneralのトピックLWIP Can't Connect to Remote Server</title>
    <link>https://community.nxp.com/t5/MCUXpresso-General/LWIP-Can-t-Connect-to-Remote-Server/m-p/1036857#M3274</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi. My code is raw tcp/ip client application. It can connect local server on my computer frequently but it can't connect to remote server "sometimes (about 2/3 ratio) " . Remote server is working properly, I guarantee by connecting my computer with simple socket application. If I try to execute TCP_WRITE function, return error 13 so connection error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think that My device can't get ACK in timeout or I don't know.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can ı solve this ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My device is LPC1769. I use changed LPCopen TCP/IP Server&amp;nbsp;App to client version by myself.&lt;/P&gt;&lt;P&gt;I add some code block related with changed from lpcopen example.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I attach my lwipopt.h, that options can execute webserver application with 70kb webpage very fast.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;void tcp_echoclient_connect(void)&lt;BR /&gt;{&lt;BR /&gt; struct ip_addr DestIPaddr;&lt;/P&gt;&lt;P&gt;if (echo_pcb != NULL)&lt;BR /&gt; {&lt;BR /&gt;IP4_ADDR( &amp;amp;DestIPaddr, 192, 168, 1, 39 );&lt;/P&gt;&lt;P&gt;/* connect to destination address/port */&lt;BR /&gt; tcp_connect(echo_pcb,&amp;amp;DestIPaddr,7,echo_accept);&lt;BR /&gt; }&lt;BR /&gt; else&lt;BR /&gt; {&lt;BR /&gt; /* deallocate the pcb */&lt;BR /&gt; memp_free(MEMP_TCP_PCB, echo_pcb);&lt;BR /&gt; // DEBUGOUT("\n\r can not create tcp pcb");&lt;/P&gt;&lt;P&gt;}&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;void&lt;BR /&gt;echo_init(void)&lt;BR /&gt;{&lt;BR /&gt; echo_pcb = tcp_new();&lt;BR /&gt; if (echo_pcb != NULL)&lt;BR /&gt; {&lt;BR /&gt; err_t err;&lt;/P&gt;&lt;P&gt;err = tcp_bind(echo_pcb, IP_ADDR_ANY,7);&lt;BR /&gt; if (err == ERR_OK)&lt;BR /&gt; {&lt;BR /&gt; tcp_echoclient_connect();&lt;BR /&gt; }&lt;BR /&gt; else &lt;BR /&gt; {&lt;BR /&gt; /* abort? output diagnostic? */&lt;BR /&gt; }&lt;BR /&gt; }&lt;BR /&gt; else&lt;BR /&gt; {&lt;BR /&gt; /* abort? output diagnostic? */&lt;BR /&gt; }&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;int Enet_Write(char *str){&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;err_t wr_err = ERR_OK;&lt;/P&gt;&lt;P&gt;while ( (str != NULL) &amp;amp;&amp;amp; (strlen(str) &amp;lt;= tcp_sndbuf(echo_pcb)) &amp;amp;&amp;amp; strlen(str) &amp;lt; 1025 &amp;amp;&amp;amp; echo_pcb != NULL)&lt;BR /&gt; {&lt;/P&gt;&lt;P&gt;wr_err = tcp_write(echo_pcb, str, strlen(str) , 1);&lt;/P&gt;&lt;P&gt;if (wr_err == ERR_OK)&lt;BR /&gt; {&lt;BR /&gt; tcp_output(echo_pcb);&lt;BR /&gt; DEBUGOUT("Transmitted data is : %s\r\n", str);&lt;BR /&gt; if( echo_pcb-&amp;gt;unacked != NULL )&lt;BR /&gt; DEBUGOUT("Acknowledged \r\n");&lt;/P&gt;&lt;P&gt;break;&lt;BR /&gt; }&lt;BR /&gt; else if(wr_err == ERR_MEM)&lt;BR /&gt; {&lt;BR /&gt; /* we are low on memory, try later / harder, defer to poll */&lt;BR /&gt;DEBUGOUT("Tcp_write memory error \r\n");&lt;BR /&gt; }&lt;BR /&gt; else&lt;BR /&gt; {&lt;BR /&gt; /* other problem ?? */&lt;BR /&gt; DEBUGOUT("wr_err is %d \r\n",wr_err);&lt;BR /&gt; }&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 17 Mar 2020 07:06:26 GMT</pubDate>
    <dc:creator>ramazan_kurban3</dc:creator>
    <dc:date>2020-03-17T07:06:26Z</dc:date>
    <item>
      <title>LWIP Can't Connect to Remote Server</title>
      <link>https://community.nxp.com/t5/MCUXpresso-General/LWIP-Can-t-Connect-to-Remote-Server/m-p/1036857#M3274</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi. My code is raw tcp/ip client application. It can connect local server on my computer frequently but it can't connect to remote server "sometimes (about 2/3 ratio) " . Remote server is working properly, I guarantee by connecting my computer with simple socket application. If I try to execute TCP_WRITE function, return error 13 so connection error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think that My device can't get ACK in timeout or I don't know.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can ı solve this ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My device is LPC1769. I use changed LPCopen TCP/IP Server&amp;nbsp;App to client version by myself.&lt;/P&gt;&lt;P&gt;I add some code block related with changed from lpcopen example.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I attach my lwipopt.h, that options can execute webserver application with 70kb webpage very fast.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;void tcp_echoclient_connect(void)&lt;BR /&gt;{&lt;BR /&gt; struct ip_addr DestIPaddr;&lt;/P&gt;&lt;P&gt;if (echo_pcb != NULL)&lt;BR /&gt; {&lt;BR /&gt;IP4_ADDR( &amp;amp;DestIPaddr, 192, 168, 1, 39 );&lt;/P&gt;&lt;P&gt;/* connect to destination address/port */&lt;BR /&gt; tcp_connect(echo_pcb,&amp;amp;DestIPaddr,7,echo_accept);&lt;BR /&gt; }&lt;BR /&gt; else&lt;BR /&gt; {&lt;BR /&gt; /* deallocate the pcb */&lt;BR /&gt; memp_free(MEMP_TCP_PCB, echo_pcb);&lt;BR /&gt; // DEBUGOUT("\n\r can not create tcp pcb");&lt;/P&gt;&lt;P&gt;}&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;void&lt;BR /&gt;echo_init(void)&lt;BR /&gt;{&lt;BR /&gt; echo_pcb = tcp_new();&lt;BR /&gt; if (echo_pcb != NULL)&lt;BR /&gt; {&lt;BR /&gt; err_t err;&lt;/P&gt;&lt;P&gt;err = tcp_bind(echo_pcb, IP_ADDR_ANY,7);&lt;BR /&gt; if (err == ERR_OK)&lt;BR /&gt; {&lt;BR /&gt; tcp_echoclient_connect();&lt;BR /&gt; }&lt;BR /&gt; else &lt;BR /&gt; {&lt;BR /&gt; /* abort? output diagnostic? */&lt;BR /&gt; }&lt;BR /&gt; }&lt;BR /&gt; else&lt;BR /&gt; {&lt;BR /&gt; /* abort? output diagnostic? */&lt;BR /&gt; }&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;int Enet_Write(char *str){&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;err_t wr_err = ERR_OK;&lt;/P&gt;&lt;P&gt;while ( (str != NULL) &amp;amp;&amp;amp; (strlen(str) &amp;lt;= tcp_sndbuf(echo_pcb)) &amp;amp;&amp;amp; strlen(str) &amp;lt; 1025 &amp;amp;&amp;amp; echo_pcb != NULL)&lt;BR /&gt; {&lt;/P&gt;&lt;P&gt;wr_err = tcp_write(echo_pcb, str, strlen(str) , 1);&lt;/P&gt;&lt;P&gt;if (wr_err == ERR_OK)&lt;BR /&gt; {&lt;BR /&gt; tcp_output(echo_pcb);&lt;BR /&gt; DEBUGOUT("Transmitted data is : %s\r\n", str);&lt;BR /&gt; if( echo_pcb-&amp;gt;unacked != NULL )&lt;BR /&gt; DEBUGOUT("Acknowledged \r\n");&lt;/P&gt;&lt;P&gt;break;&lt;BR /&gt; }&lt;BR /&gt; else if(wr_err == ERR_MEM)&lt;BR /&gt; {&lt;BR /&gt; /* we are low on memory, try later / harder, defer to poll */&lt;BR /&gt;DEBUGOUT("Tcp_write memory error \r\n");&lt;BR /&gt; }&lt;BR /&gt; else&lt;BR /&gt; {&lt;BR /&gt; /* other problem ?? */&lt;BR /&gt; DEBUGOUT("wr_err is %d \r\n",wr_err);&lt;BR /&gt; }&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Mar 2020 07:06:26 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-General/LWIP-Can-t-Connect-to-Remote-Server/m-p/1036857#M3274</guid>
      <dc:creator>ramazan_kurban3</dc:creator>
      <dc:date>2020-03-17T07:06:26Z</dc:date>
    </item>
    <item>
      <title>Re: LWIP Can't Connect to Remote Server</title>
      <link>https://community.nxp.com/t5/MCUXpresso-General/LWIP-Can-t-Connect-to-Remote-Server/m-p/1036858#M3275</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ramazan,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It would be useful if you could debug what type of error are you seeing. If you check &lt;STRONG&gt;tcp_connect&lt;/STRONG&gt; API you will see there are different types of error. Please check the definitions below from &lt;STRONG&gt;err.h&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="language-c line-numbers"&gt;&lt;CODE&gt;&lt;SPAN class="comment token"&gt;/* Definitions for error constants. */&lt;/SPAN&gt;

&lt;SPAN class="property macro token"&gt;#define ERR_OK          0    &lt;/SPAN&gt;&lt;SPAN class="comment token"&gt;/* No error, everything OK. */&lt;/SPAN&gt;
&lt;SPAN class="property macro token"&gt;#define ERR_MEM        -1    &lt;/SPAN&gt;&lt;SPAN class="comment token"&gt;/* Out of memory error.     */&lt;/SPAN&gt;
&lt;SPAN class="property macro token"&gt;#define ERR_BUF        -2    &lt;/SPAN&gt;&lt;SPAN class="comment token"&gt;/* Buffer error.            */&lt;/SPAN&gt;
&lt;SPAN class="property macro token"&gt;#define ERR_TIMEOUT    -3    &lt;/SPAN&gt;&lt;SPAN class="comment token"&gt;/* Timeout.                 */&lt;/SPAN&gt;
&lt;SPAN class="property macro token"&gt;#define ERR_RTE        -4    &lt;/SPAN&gt;&lt;SPAN class="comment token"&gt;/* Routing problem.         */&lt;/SPAN&gt;
&lt;SPAN class="property macro token"&gt;#define ERR_INPROGRESS -5    &lt;/SPAN&gt;&lt;SPAN class="comment token"&gt;/* Operation in progress    */&lt;/SPAN&gt;
&lt;SPAN class="property macro token"&gt;#define ERR_VAL        -6    &lt;/SPAN&gt;&lt;SPAN class="comment token"&gt;/* Illegal value.           */&lt;/SPAN&gt;
&lt;SPAN class="property macro token"&gt;#define ERR_WOULDBLOCK -7    &lt;/SPAN&gt;&lt;SPAN class="comment token"&gt;/* Operation would block.   */&lt;/SPAN&gt;
&lt;SPAN class="property macro token"&gt;#define ERR_USE        -8    &lt;/SPAN&gt;&lt;SPAN class="comment token"&gt;/* Address in use.          */&lt;/SPAN&gt;
&lt;SPAN class="property macro token"&gt;#define ERR_ISCONN     -9    &lt;/SPAN&gt;&lt;SPAN class="comment token"&gt;/* Already connected.       */&lt;/SPAN&gt;

&lt;SPAN class="property macro token"&gt;#define ERR_IS_FATAL(e) ((e) &amp;lt; ERR_ISCONN)&lt;/SPAN&gt;

&lt;SPAN class="property macro token"&gt;#define ERR_ABRT       -10   &lt;/SPAN&gt;&lt;SPAN class="comment token"&gt;/* Connection aborted.      */&lt;/SPAN&gt;
&lt;SPAN class="property macro token"&gt;#define ERR_RST        -11   &lt;/SPAN&gt;&lt;SPAN class="comment token"&gt;/* Connection reset.        */&lt;/SPAN&gt;
&lt;SPAN class="property macro token"&gt;#define ERR_CLSD       -12   &lt;/SPAN&gt;&lt;SPAN class="comment token"&gt;/* Connection closed.       */&lt;/SPAN&gt;
&lt;SPAN class="property macro token"&gt;#define ERR_CONN       -13   &lt;/SPAN&gt;&lt;SPAN class="comment token"&gt;/* Not connected.           */&lt;/SPAN&gt;

&lt;SPAN class="property macro token"&gt;#define ERR_ARG        -14   &lt;/SPAN&gt;&lt;SPAN class="comment token"&gt;/* Illegal argument.        */&lt;/SPAN&gt;

&lt;SPAN class="property macro token"&gt;#define ERR_IF         -15   &lt;/SPAN&gt;&lt;SPAN class="comment token"&gt;/* Low-level netif error    */&lt;/SPAN&gt;
&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Felipe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Mar 2020 23:44:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-General/LWIP-Can-t-Connect-to-Remote-Server/m-p/1036858#M3275</guid>
      <dc:creator>FelipeGarcia</dc:creator>
      <dc:date>2020-03-20T23:44:53Z</dc:date>
    </item>
    <item>
      <title>Re: LWIP Can't Connect to Remote Server</title>
      <link>https://community.nxp.com/t5/MCUXpresso-General/LWIP-Can-t-Connect-to-Remote-Server/m-p/1036859#M3276</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It gives -13 error.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Mar 2020 16:16:24 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-General/LWIP-Can-t-Connect-to-Remote-Server/m-p/1036859#M3276</guid>
      <dc:creator>ramazan_kurban3</dc:creator>
      <dc:date>2020-03-23T16:16:24Z</dc:date>
    </item>
    <item>
      <title>Re: LWIP Can't Connect to Remote Server</title>
      <link>https://community.nxp.com/t5/MCUXpresso-General/LWIP-Can-t-Connect-to-Remote-Server/m-p/1036860#M3277</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My pcb is blocked at echo_pcb-&amp;gt;state = SYN_Sent. It can't get ACK&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Mar 2020 10:49:50 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-General/LWIP-Can-t-Connect-to-Remote-Server/m-p/1036860#M3277</guid>
      <dc:creator>ramazan_kurban3</dc:creator>
      <dc:date>2020-03-24T10:49:50Z</dc:date>
    </item>
    <item>
      <title>Re: LWIP Can't Connect to Remote Server</title>
      <link>https://community.nxp.com/t5/MCUXpresso-General/LWIP-Can-t-Connect-to-Remote-Server/m-p/1036861#M3278</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The link-up for connection means hardware PHY's connection. Normally, this error means invalid connections.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Felipe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Mar 2020 17:41:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-General/LWIP-Can-t-Connect-to-Remote-Server/m-p/1036861#M3278</guid>
      <dc:creator>FelipeGarcia</dc:creator>
      <dc:date>2020-03-25T17:41:53Z</dc:date>
    </item>
    <item>
      <title>Re: LWIP Can't Connect to Remote Server</title>
      <link>https://community.nxp.com/t5/MCUXpresso-General/LWIP-Can-t-Connect-to-Remote-Server/m-p/1036862#M3279</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My device can connect to my local server properly, My pc can connect to my remote server properly but my device can't connect to remote server sometimes. It can run web server properly with this hardware setup so ı think hardware is true.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Mar 2020 10:20:29 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-General/LWIP-Can-t-Connect-to-Remote-Server/m-p/1036862#M3279</guid>
      <dc:creator>ramazan_kurban3</dc:creator>
      <dc:date>2020-03-31T10:20:29Z</dc:date>
    </item>
  </channel>
</rss>

