lwip_read is not working after some successful operations.

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

lwip_read is not working after some successful operations.

rahul.mane .

Hello All,

I am using LWIP stack (2.0.2) with pppos.
I have NXP MC5748 board wi SIM900a interface with one UART channel.


I am trying to send data to server using LWIP socket programming.

Steps of programming:

1. lwip_socket(PF_INET, SOCK_STREAM, 0);

2. lwip_connect(socket_fd,(struct sockaddr_in*)&sa,sizeof(struct sockaddr_in));

3. lwip_write(socket_fd, "test", 4);

4. lwip_read(socket_fd, rxbuf, 512)


and this above operations are working fine. But there is issue.

Step 3 & 4 ie WRITE & READ are called in WHILE LOOP. 

after some number of successful  write and read operations, code get stuck in read operation.

So I have enabled some #define and put some console print, for debugging,.

And my observation is following:


1. while successful operation, I was getting log as 

ip_input: iphdr->dest 0x646494b2 netif->ip_addr 0x646494b2 (0x646494b2, 0x646494b2, 0x0)
ip4_input: packet accepted on interface pp

2. Getting this log, When read is not getting data :

ip_input: iphdr->dest 0xb8482fbb netif->ip_addr 0x646494b2 (0xb8482fbb, 0x646494b2, 0x0)
ip4_input: packet not for us.


my further analysis is 
/* match packet against an interface, i.e. is this packet for us? */
  if (ip4_addr_ismulticast(ip4_current_dest_addr())) in ip4.c     When Issue occurs, IF conditions gets FAILED


In unsuccessful opertion "ip_data.current_iphdr_dest.addr" is 0xb8482fbb 
And for successful operation it is 0x646494b2.

Is above mentioned difference gives some kind of HINT ? 

I don't know much about lwip, So please help me to understand this issue and how to resolve it ?




Thanks
Rahul


_______________________________________________
lwip-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-users
Reply | Threaded
Open this post in threaded view
|

Re: lwip_read is not working after some successful operations.

rahul.mane .

Hello All,

I am still investing above issue.

There is one more observation. I am not able to send more than 1024 bytes  using lwip socket operation.

I am sending 128 bytes through lwip socket. And server side i am getting this bytes correctly.

Above operation works successfully 8 times( i.e. 128*8 =1024). On 9 th times data is not getting to server.


Any recommendation for debug path. 

Thanks
Rahul

 

On Monday, May 20, 2019, 4:10:21 PM GMT+5:30, rahul.mane . <[hidden email]> wrote:



Hello All,

I am using LWIP stack (2.0.2) with pppos.
I have NXP MC5748 board wi SIM900a interface with one UART channel.


I am trying to send data to server using LWIP socket programming.

Steps of programming:

1. lwip_socket(PF_INET, SOCK_STREAM, 0);

2. lwip_connect(socket_fd,(struct sockaddr_in*)&sa,sizeof(struct sockaddr_in));

3. lwip_write(socket_fd, "test", 4);

4. lwip_read(socket_fd, rxbuf, 512)


and this above operations are working fine. But there is issue.

Step 3 & 4 ie WRITE & READ are called in WHILE LOOP. 

after some number of successful  write and read operations, code get stuck in read operation.

So I have enabled some #define and put some console print, for debugging,.

And my observation is following:


1. while successful operation, I was getting log as 

ip_input: iphdr->dest 0x646494b2 netif->ip_addr 0x646494b2 (0x646494b2, 0x646494b2, 0x0)
ip4_input: packet accepted on interface pp

2. Getting this log, When read is not getting data :

ip_input: iphdr->dest 0xb8482fbb netif->ip_addr 0x646494b2 (0xb8482fbb, 0x646494b2, 0x0)
ip4_input: packet not for us.


my further analysis is 
/* match packet against an interface, i.e. is this packet for us? */
  if (ip4_addr_ismulticast(ip4_current_dest_addr())) in ip4.c     When Issue occurs, IF conditions gets FAILED


In unsuccessful opertion "ip_data.current_iphdr_dest.addr" is 0xb8482fbb 
And for successful operation it is 0x646494b2.

Is above mentioned difference gives some kind of HINT ? 

I don't know much about lwip, So please help me to understand this issue and how to resolve it ?




Thanks
Rahul


_______________________________________________
lwip-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-users
Reply | Threaded
Open this post in threaded view
|

Re: lwip_read is not working after some successful operations.

rahul.mane .

Hello All,

In further investigation, i found that lwip stack is not sending more than 1400 bytes.
where mss value is 1400.

So i think, lwip stack is not getting signal or acknowledgement  of 1400 bytes has transmitted and now reinitialize the buffer for more 1400 byte.

Any recommendation for debug path. 

Thanks
Rahul

On Thursday, May 23, 2019, 6:35:13 PM GMT+5:30, rahul.mane . <[hidden email]> wrote:



Hello All,

I am still investing above issue.

There is one more observation. I am not able to send more than 1024 bytes  using lwip socket operation.

I am sending 128 bytes through lwip socket. And server side i am getting this bytes correctly.

Above operation works successfully 8 times( i.e. 128*8 =1024). On 9 th times data is not getting to server.


Any recommendation for debug path. 

Thanks
Rahul

 

On Monday, May 20, 2019, 4:10:21 PM GMT+5:30, rahul.mane . <[hidden email]> wrote:



Hello All,

I am using LWIP stack (2.0.2) with pppos.
I have NXP MC5748 board wi SIM900a interface with one UART channel.


I am trying to send data to server using LWIP socket programming.

Steps of programming:

1. lwip_socket(PF_INET, SOCK_STREAM, 0);

2. lwip_connect(socket_fd,(struct sockaddr_in*)&sa,sizeof(struct sockaddr_in));

3. lwip_write(socket_fd, "test", 4);

4. lwip_read(socket_fd, rxbuf, 512)


and this above operations are working fine. But there is issue.

Step 3 & 4 ie WRITE & READ are called in WHILE LOOP. 

after some number of successful  write and read operations, code get stuck in read operation.

So I have enabled some #define and put some console print, for debugging,.

And my observation is following:


1. while successful operation, I was getting log as 

ip_input: iphdr->dest 0x646494b2 netif->ip_addr 0x646494b2 (0x646494b2, 0x646494b2, 0x0)
ip4_input: packet accepted on interface pp

2. Getting this log, When read is not getting data :

ip_input: iphdr->dest 0xb8482fbb netif->ip_addr 0x646494b2 (0xb8482fbb, 0x646494b2, 0x0)
ip4_input: packet not for us.


my further analysis is 
/* match packet against an interface, i.e. is this packet for us? */
  if (ip4_addr_ismulticast(ip4_current_dest_addr())) in ip4.c     When Issue occurs, IF conditions gets FAILED


In unsuccessful opertion "ip_data.current_iphdr_dest.addr" is 0xb8482fbb 
And for successful operation it is 0x646494b2.

Is above mentioned difference gives some kind of HINT ? 

I don't know much about lwip, So please help me to understand this issue and how to resolve it ?




Thanks
Rahul


_______________________________________________
lwip-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-users