xmc4800 lwip active connection

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
User18744
Level 1
Level 1
hello,
I am trying to implement an active connection as declared [HTML]https://lwip.fandom.com/wiki/Raw/TCP#Active_connection[/HTML]
I can see that the passive connection is working..

what I get is a routing error ERR_RTE when I call tcp_connect() ...
On the other end is a simple nodejs server using the net module and waiting for connections at port 8080. Its IP is 192.168.0.1 and the xmc's IP is 192.169.0.10

Below is my code


char *buf = "Connect Called";
struct tcp_pcb *pcb = tcp_new();
err_t error_connection;
struct ip4_addr rem_ipaddr;

tcp_bind_netif(pcb, &ETH_LWIP_n.xnetif);

tcp_err(pcb, err_callback);

//IP4_ADDR(&rem_ipaddr, 192, 168, 0, 1);
IP4_ADDR(&rem_ipaddr, REM_IP_ADDR0, REM_IP_ADDR1, REM_IP_ADDR2, REM_IP_ADDR3);
error_connection = tcp_connect(pcb, &rem_ipaddr, 8080, on_connection_success);
if (error_connection == ERR_OK)
SEGGER_RTT_WriteString(0, buf);

0 Likes
1 Solution
SudheeshK
Moderator
Moderator
Moderator
250 sign-ins First question asked 750 replies posted
Hello,

Sorry for the delay. We have an example project in which client initiates connection to the server.
Please check the example project "IOT_EXAMPLE_XMC47" from the following link: https://www.infineon.com/cms/en/product/promopages/aim-mc/dave_downloads.html.

Thanks and Regards,
Sudheesh

View solution in original post

0 Likes
2 Replies
SudheeshK
Moderator
Moderator
Moderator
250 sign-ins First question asked 750 replies posted
Hello,

Sorry for the delay. We have an example project in which client initiates connection to the server.
Please check the example project "IOT_EXAMPLE_XMC47" from the following link: https://www.infineon.com/cms/en/product/promopages/aim-mc/dave_downloads.html.

Thanks and Regards,
Sudheesh
0 Likes
User18744
Level 1
Level 1
Hello KSudheesh

Thank you for your reply. I will look into it and let you know how it goes, in case any other users have same issue..

Regards
0 Likes