LwIP host connecting to LwIP client

classic Classic list List threaded Threaded
3 messages Options
Vic
Reply | Threaded
Open this post in threaded view
|

LwIP host connecting to LwIP client

Vic
Hi all,

I set up the LwIP Stack on two microcontroller and use the raw mode. Now I'm trying to build up a connection and send some data over TCP with static IP. But it doesn't work. I can see the ARP request with wireshark but there is no response. Also the request is send only one time. The strange thing is that I can connect and send some data with putty over a PC.
Is there anything special I have to consider when connecting from LwIP to LwIP?

I have enabled TCP, ARP, ICMP and call every 250ms tcp_tmr(), every 5000ms etharp_tmr() also every 1ms a tick is generated for sys_now().

The initialization of the listening pcb is:
struct tcp_pcb *receive_pcb;
receive_pcb = tcp_new();
tcp_bind(receive_pcb, IP_ADDR_ANY, 4098);
receive_pcb = tcp_listen(receive_pcb);
tcp_accept(receive_pcb, tcp_accept_connection);

The initialization of the active pcb is:
struct tcp_pcb *transmit_pcb;
struct ip_addr ipAddr_dest;
IP4_ADDR(&ipAddr_dest,192,168,0,2);
transmit_pcb = tcp_new();
tcp_connect(transmit_pcb, &ipAddr_dest, 4098, tcp_send_data);
Reply | Threaded
Open this post in threaded view
|

Re: LwIP host connecting to LwIP client

Nicolas V.
Hi Vic,
I had a similar issue. I was seeing the ARP request from the PC but no reponse from the embedded platform with Lwip running.
In my case it was due to a wrong configuration of the ethernet driver which was discarding all ethernet frames with a broadcast address.

Rds,
Nicolas.
Vic
Reply | Threaded
Open this post in threaded view
|

Re: LwIP host connecting to LwIP client

Vic
This was it. Thank you Nicolas for the clue.