wiced_packet_create_tcp sometimes fails

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

cross mob
MaFa_974161
Level 5
Level 5
100 sign-ins 50 replies posted 50 questions asked

Hello,

I'm using CYW954907AEVAL1F to send WiFi UDP packets larger than 1KByte at a rate of 30x2Packets/s.

 

I'm using wiced_packet_create_tcp API and sometimes it fails : it returns 2 (TIMEOUT)

 

I run debugger and I see this situation ...

MaFa_974161_0-1638259951830.png

 

Can someone help me ?

0 Likes
1 Solution

Hi @MaFa_974161 ,

WICED_TCPIP_TIMEOUT happens when internal packet creation doesn't happens because of unavailable memory in netbuf. you can check return value of netbuf_alloc function in internal_packet_create function in tcpip.c

Thanks,

Rakesh B G

View solution in original post

0 Likes
4 Replies
GauravS_31
Moderator
Moderator
Moderator
10 questions asked 250 solutions authored 250 sign-ins

If you want to send UDP packets, the function wiced_packet_create_udp() should be used and not TCP API. Please refer to snip.udp_transmit code example.

0 Likes
MaFa_974161
Level 5
Level 5
100 sign-ins 50 replies posted 50 questions asked

You are right ... I explained my problem in a wrong way.

 

I obtain WICED_TCPIP_TIMEOUT sometimes when I call api

wiced_packet_create_tcp  

or when I call api

wiced_packet_create_udp .

 

My application sends realtime data on an Android Tablet via WiFi. The application configure processor as AP.

 

The data are sent to the tablet by using 1KByte UDP packets.

The source of data is an FPGA and generates 60packets/sec on an SPI but I retransmit every packet three times, so the final rate on WiFi is 180 packets/sec (180MBps).

 

My application also use TCP to get commands from Android Tablet

 

I use UDP for realtime data because UDP has no latency but it's not reliable (this explain why I retrasmit every packet three times: to ensure Tablet get it). I use TCP for commands because it is reliable but has latency.

 

What I observe is that sometimes, when I call wiced_packet_create_tcp  or when I call wiced_packet_create_udp, their return WICED_TCPIP_TIMEOUT (api code 2) ... 

 

What is this timeout due to ?

 

A timeout in wiced_packet_create_udp is not a problem for me ... but in TCP is a big problem.

0 Likes

Hi @MaFa_974161 ,

WICED_TCPIP_TIMEOUT happens when internal packet creation doesn't happens because of unavailable memory in netbuf. you can check return value of netbuf_alloc function in internal_packet_create function in tcpip.c

Thanks,

Rakesh B G

0 Likes
MaFa_974161
Level 5
Level 5
100 sign-ins 50 replies posted 50 questions asked

but why this behaviour ?

This occours when I receive UDP packets with some Android tablets.

I transmit UDP packets at a rate of 60packets/s and every packet is 1KByte.

0 Likes