Move successfully from one network to another?

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

cross mob
agmi_3321141
Level 4
Level 4
5 likes given First like received First like given

Can you outline steps to correctly move from one network to another? I am able to leave and rejoin a different network, but I think the IP address change may not be handled correctly, so even after joining the new network, I cannot ping any website successfully.

I tried using "wiced_network_down", but that fails at the "wiced_ip_down" call with error "Could not delete IP instance". So what is the correct way of getting the IPv4/6 address on the new network?

Scenario is as follows:

- boot

- do wiced_network_up with network A [external dhcp]

- Ping website (GET/POST) successful

- Leave network A with wwd_wifi_leave

- Join network B with wwd_join_specific

- Ping unsuccessful

The above method works if I connect to the same network again, but not if connected to another network, for example one that may not assign 192.168.x.x type IP  (10.xx etc)

0 Likes
1 Solution

Hello:

I just use our command_console_wifi.c to test the disassociation and association process ,

please use below command to have a try , and compare if it is what your needed on your application.

you can see the DHCP process runs well.

> leave

> join leikeT wpa2 12345678

1 wiced_network_is_up =0

Joining : leikeT

Successfully joined : leikeT

Obtaining IPv4 address via DHCP

DHCP CLIENT hostname WICED IP

nx_ip_status_check time  is  4000

IPv4 network ready IP: 192.168.0.22

> leave

> join 5g wpa2 12345678

1 wiced_network_is_up =0

Joining : 5g

Successfully joined : 5g

Obtaining IPv4 address via DHCP

DHCP CLIENT hostname WICED IP

nx_ip_status_check time  is  5000

IPv4 network ready IP: 192.168.2.4

View solution in original post

5 Replies
Zhengbao_Zhang
Moderator
Moderator
Moderator
250 sign-ins First comment on KBA 10 questions asked

I think if the AP side DHCP is running well , the switch should work well also. 

I have tested AP switch from 2.4G to 5G before, didn't meet such problems.

How to switch AP connection in an application

0 Likes

Hi thanks for the link. My device doesn't support 5GHz, so I'm only testing switching between 2.4GHz networks. I think I can switch AP just fine with leave and join_specific. I have mentioned that it joins a new network successfully. What I don't think is happening is IP address resolution[my guess] in time before I try to ping and it takes a lot of tries before it automatically gets the IP on the new network. So I guess my question would be how to ensure that the address resolution on the new network has happened or force it to happen before trying to ping.

I cannot use wiced_network up directly since I have to join a network based on some additional parameters not accounted for in the simpler DCT based wifi join used in that call. Additionally, I'd rather prefer not to bring down the DHCP server and restarting it to obtain IP whenever it tries to switch to a new network[as suggested in the blog post]. Please suggest if this is a realistic expectation.

0 Likes

Hello:

So your issue was solved with last thread you posted with a semaphore ?

0 Likes

Hi, well my last post about join was solved by using semaphore argument of the function and just waiting for a longer duration to let join complete.

However it only solves the problem of joining a network. The dhcp doesnt update immediately [as you rightly said it depends on AP], so the wireless_link_up_handler which tries to force renew the dhcp doesnt always work right away. So my question was how to ensure it is correctly updated? Although the link_up and link_renew functions are called, sometimes the renew function fails with code 33 [uninitialized], giving a message: "Dynamically changing the ARP entry failed". What is a good way to ensure this is handled cleanly?

Hello:

I just use our command_console_wifi.c to test the disassociation and association process ,

please use below command to have a try , and compare if it is what your needed on your application.

you can see the DHCP process runs well.

> leave

> join leikeT wpa2 12345678

1 wiced_network_is_up =0

Joining : leikeT

Successfully joined : leikeT

Obtaining IPv4 address via DHCP

DHCP CLIENT hostname WICED IP

nx_ip_status_check time  is  4000

IPv4 network ready IP: 192.168.0.22

> leave

> join 5g wpa2 12345678

1 wiced_network_is_up =0

Joining : 5g

Successfully joined : 5g

Obtaining IPv4 address via DHCP

DHCP CLIENT hostname WICED IP

nx_ip_status_check time  is  5000

IPv4 network ready IP: 192.168.2.4