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

Wi-Fi Combo

hoainguyen265
Level 2
10 replies posted 5 questions asked 10 sign-ins
Level 2

After join AP successfully with

wiced_join_ap_specific
wiced_ip_up

I want to leave and join with another AP by calling

wiced_ip_down

But i alway get error = 4 as return code. The error message is "Could not delete IP instance" so this is where i got the error code return in wiced_ip_down function

Screen Shot 2021-12-20 at 15.37.52.png

I want to know that how can i leave and join another AP in proper way?

I use CYW54907 with Wiced studio 6.6.

 

0 Likes
1 Solution
Rakesh_BG
Moderator
Moderator 10 likes received 25 solutions authored 50 replies posted
Moderator

Hi @hoainguyen265 ,

Your solution is correct, deinitializing http connection or mqtt client before calling wiced_network_down is perfect method.

Thanks,

Rakesh B G

View solution in original post

0 Likes
5 Replies
Rakesh_BG
Moderator
Moderator 10 likes received 25 solutions authored 50 replies posted
Moderator

Hi @hoainguyen265 ,

We had tested wiced_network_down() but this error could not be reproduced. Create a simple project with the following statements:

     wiced_result_t result;

     wiced_init();

     wiced_network_up(WICED_STA_INTERFACE, WICED_USE_EXTERNAL_DHCP_SERVER, NULL);

     result=wiced_network_down(WICED_STA_INTERFACE);

     printf("Result of wiced_network_down() is %d\n",result);

Check the result of wiced_network_down().

Thanks,

Rakesh B G

hoainguyen265
Level 2
10 replies posted 5 questions asked 10 sign-ins
Level 2

Thanks for your reply @Rakesh_BG ,

Yes, in normal condition that we just connect to the AP and do nothing, everything will be ok.

In my case, if wifi disconnected with the AP when i still have a http connection or mqtt client, .. that still remain the "IP HANDLE", i can't call the ip down success. So my solution here is deinit/free all that instances and call the ip down. Could you double check that my solution is a proper way?

0 Likes
Rakesh_BG
Moderator
Moderator 10 likes received 25 solutions authored 50 replies posted
Moderator

Hi @hoainguyen265 ,

Can you check what is the return value of nx_ip_delete function. And how are you deinitializing or freeing the instances.

Thanks,

Rakesh B G 

0 Likes
hoainguyen265
Level 2
10 replies posted 5 questions asked 10 sign-ins
Level 2

Sorry for late response,

the return value is 

NX_SOCKETS_BOUND
0 Likes
Rakesh_BG
Moderator
Moderator 10 likes received 25 solutions authored 50 replies posted
Moderator

Hi @hoainguyen265 ,

Your solution is correct, deinitializing http connection or mqtt client before calling wiced_network_down is perfect method.

Thanks,

Rakesh B G

0 Likes