Intermittently, when I try to connect to a WiFi network, I get the following error message as a toast message:
Failed to connect to network
The message pops up immediately upon attempting to connect, so clearly it isn't trying and failing. I haven't found any mention of an error in the logs. The affected networks are ones that I've previously connected to with no change in settings.
How can I figure out what the problem is?
I've got a rooted Galaxy Nexus running Android 4.1.1 and the stock ROM. This question is related to another question that I posted earlier, but this one is more about how to find the source of a particular error message, so its focus is different.
Additional Details
Here are some more details based on the comments:
I've observed this on my home and work networks. One is identified as WPA2 PSK and the other is identified as WPA/WPA2 PSK.
I haven't powered off the phone as described in the troubleshooting guide mentioned in the comments. However, I have rebooted to no avail (using the reboot command that's available on rooted phones).
Forgetting the network and re-adding it has no effect. In fact, if I forget the network I can no longer successfully re-add it.
The wireless password hasn't changed.
There's no proxy configured when I'm on wireless. However, I run Onavo Extend when I'm on a data connection. Disabling it has no effect.
I've switched from DHCP to static IP addresses. Doing so reduced the frequency of problems and seems to have eliminated my earlier issue where wifi would be randomly dropped.
Wifi sleep is set to "Only when plugged in." I don't think it's relevant because my issue is establishing a connection in the first place (such as when I arrive at home or at work), not maintaining one.
Note that despite all these troubleshooting steps,my initial goal is to find an actual error message or log entry that gives useful information about the problem.
logcat
when the problem appeared? That might turn something up. Up to ICS (4.0) you can use one of the logcat apps from Google Play; however, as with JB they no longer can access anything but their own log entries, you might need to useadb logcat
then (or root your device).