cancel
Showing results for 
Search instead for 
Did you mean: 

WICED Studio Wi-Fi Combo

Anonymous
Not applicable

Test on sdk3.0.1, with FreeRTOS+LwIP.

Below code snip shows wiced_tcp_create_socket fails if i >= 5.

The fail result is 25 (SOCKET_CREATE_FAIL).

Which means I can only successfully create 5 sockets at the same time. (0 ~ 4).

for (i = 0; i < 10; i ++) {

            result = wiced_tcp_create_socket(&socket, WICED_STA_INTERFACE);

            if (result != WICED_SUCCESS) {

                WPRINT_APP_INFO(("wiced_tcp_create_socket fails %u  i=%d\r\n", result , i));

            }

}

So any limitation about the number of sockets can be created at the same time?

0 Likes
1 Solution
VikramR_26
Employee

Hi Sam Lin,

Also change the following to the number of sockets required

MEMP_NUM_TCP_PCB and  MEMP_NUM_UDP_PCB in opt.h

/**

* MEMP_NUM_UDP_PCB: the number of UDP protocol control blocks. One

* per active UDP "connection".

* (requires the LWIP_UDP option)

*/

#ifndef MEMP_NUM_UDP_PCB

#define MEMP_NUM_UDP_PCB                10

#endif

/**

* MEMP_NUM_TCP_PCB: the number of simulatenously active TCP connections.

* (requires the LWIP_TCP option)

*/

#ifndef MEMP_NUM_TCP_PCB

#define MEMP_NUM_TCP_PCB                10

#endif

Let me know if you face any issues.

thnx

vik86

View solution in original post

0 Likes
7 Replies
GregG_16
Employee

Hello,

LWIP uses pre-allocated pool.

The fixed sized is controlled by a variable.  We may need to change the configuration to allow more than 5.

In lwipopts.h check, MEMP_NUM_NETCONN is defined to be 8, if you increase this, does this allow you to have more?

0 Likes
Anonymous
Not applicable

Hi gangi,

Below code always fails at "i = 5 , result=25".

int i;

for (i = 0; i < 10; i ++) {

        wiced_result_t result = wiced_tcp_create_socket(&test_socket, WICED_STA_INTERFACE);

        if (result != WICED_SUCCESS) {

                WPRINT_APP_INFO(("i = %d , result=%u\r\n", i , result));

                break;

        }

}

I have changed MEMP_NUM_NETCONN to 16, but the test result is still the same.

0 Likes
GregG_16
Employee

Can you confirm this is still an issue in SDK 3.1.0?

Anonymous
Not applicable

Hi Gangi,

I just test again with sdk 3.1.0 and still hit this issue with exactly the same result.

Thanks.

0 Likes
VikramR_26
Employee

Hi Sam Lin,

Also change the following to the number of sockets required

MEMP_NUM_TCP_PCB and  MEMP_NUM_UDP_PCB in opt.h

/**

* MEMP_NUM_UDP_PCB: the number of UDP protocol control blocks. One

* per active UDP "connection".

* (requires the LWIP_UDP option)

*/

#ifndef MEMP_NUM_UDP_PCB

#define MEMP_NUM_UDP_PCB                10

#endif

/**

* MEMP_NUM_TCP_PCB: the number of simulatenously active TCP connections.

* (requires the LWIP_TCP option)

*/

#ifndef MEMP_NUM_TCP_PCB

#define MEMP_NUM_TCP_PCB                10

#endif

Let me know if you face any issues.

thnx

vik86

View solution in original post

0 Likes
Anonymous
Not applicable

Hi vik86,

yes, that is the setting we are looking for.

BTW, do you have document about adjusting these settings in WICED-SDK?

Some settings a not very trivial, for example,

I'd like to know how to set MEM_SIZE setting in

WICED/network/LwIP/ver1.4.0.rc1/src/include/lwip/opt.h

And also how to set proper value for LWIP_NUM_PACKET_BUFFERS_IN_POOL.

(My question is how to calculate the *proper value* we need?)

thanks.

0 Likes