When I plug in my Wifi adapter (a no-brand made-in-China Wifi adapter, model number SL-1504N) to a powered USB hub (brand name "plugable", tested and works quite well) that is connected to the Pi, the Wifi adapter is automatically recognized and the correct driver is loaded without any sort of configuration or fuss. The line that shows the Wifi adapter in the output of the lsusb command is:

My problem is: When I type iwlist wlan0 scan at the terminal prompt to see available wireless networks, I get:

wlan0 No scan results

I've tried to bring down the interface (sudo ifdown wlan0) and bring it back up (sudo ifup wlan0), as well as various solutions I have found on the web that have worked for other people, but I still could not get it to work. As a last ditch effort, I did the following:

Start LXDE from the terminal prompt (startx)

Double-click the "WiFi Config" icon on the desktop (it is simply a shortcut/link to /usr/sbin/wpa_gui, a GUI frontend for wpa_supplicant)

Click the "Scan" button, which causes a second window to pop up

In the new window that popped up, click the "Scan" button

It takes about 5-10 seconds, but the scan works and displays the list of available Wifi networks. This is interesting because I don't know what wpa_gui is doing differently from iwlist wlan0 scan that enables it to get scan results. What's even more interesting is that if I now go back to the terminal prompt (either within LXDE or after closing LXDE and returning to the original terminal prompt) and type the same iwlist wlan0 scan command, I now get results.

Clearly, wpa_gui does something that I wasn't doing at the terminal prompt.

My questions are:

Does anyone know what the "Scan" capability in wpa_gui does differently from the iwlist wlan0 scan command?

(Continuation of 1) How can I get this iwlist wlan0 scan to work without first doing the scan with wpa_gui?

In the iwconfig output shown above, what precisely is the meaning of "unassociated"?

Note: For the purposes of getting this to work, I was using all default settings/files. The /etc/network/interfaces file is the default one from the Raspbian installation. If there is a utility I can run that would give useful information for troubleshooting, please let me know.

If you still encounter the error in your Raspberry Pi, the first thing to check is if you are able to successfully connect your Raspberry Pi to the WLAN network using the wpa_supplicant tool.

You can try to connect successfully using the following command:

sudo wpa_supplicant -iwlan0 -c /etc/wpa_supplicant.conf

If this command succeeds and you are able to connect successfully, then all your network configuration parameters configured for your Raspberry Pi is just working fine. In that case, all you have to do is to open up your wpa_supplicant.conf file and add the following lines at the top of that file:

ctrl_interface = /var/run/wpa_supplicant

Once done, you should now be able to connect your Raspberry Pi to the WiFi network successfully using iwlist tool.

I encountered the same problem with my raspberry pi 3. I was messing up early day with the raspberry pi configuration.... and later that day i couldn't connect with any wifi due to the response that says (scanning is not supported).

Having same issues in New Zealand, solution was to comment out (or delete) the'country=US' line in the wpa_supplicant.conf file.
Symptom was wifi reporting no networks in the GUI, but once running 'sudo iwlist wlan0 scan', it would then list the networks...10 seconds later, back to not seeing any networks. Even the wpa_supplicant.conf documentation doesn't mention a 'country=' option, so not sure what this is supposed to do, but it certainly seems to break it!