wifi connect disconnect handling

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

cross mob
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

I'm having a strange issue when trying to test wifi connection and disconnection handling.

In my code I've written handlers for link_up and link_down.

In another thread, I'm pinging google.com.

It all works fine when in the first run, but when I turn my wifi off ( it goes into link_down handler) and than up(it goes in link_up handler), ping always times out.

What my guess is, there are some variables which needs to be reinitialized. I call

wiced_network_down(WICED_STA_INTERFACE);

in my link_down handler to make sure when next time my device connects to wifi router, it obtains proper ip address.

But still no luck with pinging google after wifi reconnect. I'm attaching my source code herewith

0 Likes
5 Replies
Anonymous
Not applicable

I observe the same issue, it seems link_up only work once.

My test is very simple that just print something in link_up/down callback.

The second time turn off AP than turn on AP, I don'e see link_up get called.

0 Likes
Anonymous
Not applicable

Yeah it works sometimes, rest of the time it doesn't. Very much

unpredictive.

To resolve this problem, I start a thread which scans available networks

and as soon as it finds one same as configured in dct, it will try to

connect.

As soon as connection is done, it goes into link_up handler.

Regards

Shatruddha Singh Kushwaha

+919972742845

On Fri, Feb 6, 2015 at 9:55 AM, sam.lin <

0 Likes
Anonymous
Not applicable

Another strange thing I noticed today

Before that, a prelog to what I'm doing :

I'm sending a "Hi" on ip address 8.8.8.8 at port 80.

At first startup it all works fine, when I disconnected and reconnected, I'm obtaining a new IP address through DHCP.

Now in my observation I see that after reconnecting and obtaining new IP address, the message that I'm sending is still being sent using the previous IP address.

I checked in my router log to see all the transactions happening through my router. There I see my my device has an IP address 192.168.1.141 and my old IP address before reconnect was 192.168.1.133.

In the messages sent after reconnect, I still see packets being sent using 192.168.1.133.

So clearly new IP address obtained is not replacing the old one in the stack. I'm unable to find out where this is set.

Can anybody help?

0 Likes

Hi,

Could you please provide sniffer trace for this test?

Seyhan

0 Likes
Anonymous
Not applicable

Discussion is being locked. If you have follow-up, please start a new discussion.

0 Likes