11

I tried to scan for available wifi networks in my area, but sudo iw wlan0 scan gives me command failed: No such device (-19). Since I have no detailed knowledge about the iw command, I also tried sudo iw phy wlan0 scan, which gave me command failed: No such file or directory (-2).
NOTE: The adapter works fine, I already established a connection to my router, and iwlist is able to list available wifi networks. Yet, for some reason, iw does not work.

(I know, I can achieve a similar output with iwlist wlan0 scanning, but at my point, I just want this to work somehow.)

I am using the mini-wifi-adapter from adafruit with a RTl8192/8188CUS chipset.

I came across this SE-post, which says that the important kernel module is included, but not compiled. As clearly stated by that post, I tried to compile Raspbian with rtlwifi-support and did everything as told. Still, several hours later it's still the same. iw still gives the the same error-message as before and I don't see anything about rtlwifi- or rtl8192cu-drivers in lsmod.

Did I do something wrong or is there another way to make iw work on Raspian? Thanks in advance.

Additional information:
lsusb gives

Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp. 
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. 
Bus 001 Device 004: ID 0bda:8176 Realtek Semiconductor Corp. RTL8188CUS802.11n WLAN Adapter

uname -a gives

Linux hostname 4.1.7-v7+ #817 SMP PREEMPT Sat Sep 19 15:32:00 BST2015 armv7l GNU/Linux
Sirac
  • 231
  • 2
  • 6
  • Are you saying that `iwlist` works but `iw` does not? It's not clear here whether you think you are having a problem with the adapter, or just that particular command. – goldilocks Dec 17 '15 at 18:34
  • @goldilocks I updated my question. It's `iw` that does not work, the adapter is completely fine. – Sirac Dec 17 '15 at 18:39
  • What about `iw dev wlan0 scan`? – goldilocks Dec 17 '15 at 18:44
  • No luck, it prints `command failed: No such device (-19)`. – Sirac Dec 17 '15 at 18:48
  • Just to confirm it works for me on a pi -- not raspbian, but I don't think that will make any difference. – goldilocks Dec 17 '15 at 19:53
  • @goldilocks You're right with the OS. On Ubuntu, I have no problems at all. Still, changing OS'es is something I consider a last option. But if, do you have any OS-recommendations for the raspberry? – Sirac Dec 17 '15 at 20:47
  • Hmmm, well that is interesting then. Might be worth reporting as a bug. My recommendation generally would be "raspbian", although I use [fedora](http://raspberrypi.stackexchange.com/q/27544/5538) on the pi 2 because it's possible, but not necessarily a wise move for everyone. I have a raspbian pi here I can test the same adapter on, but it will have to wait until later (I have to take the interface down to scan, I think, and right now it is online). – goldilocks Dec 17 '15 at 20:53
  • 2
    @goldilocks It seems that this bug exists for some time now. I found https://raspberrypi.stackexchange.com/questions/14528/rtlwifi-drivers-without-a-custom-kernel this question with the same core problem. I think this is a good points to end this, since the solutions presented there are too complicated, given that I can still use `iwlist`. Raspbian still has some severe bugs, I also cannot mount my USB-stick on boot :(. Thank you for the time you took to help me and giving me the pragmatic idea of using another OS (I never could have come up with this). – Sirac Dec 17 '15 at 21:55
  • But I will try another OS(es) before I finally give up, so wish me luck :) – Sirac Dec 17 '15 at 21:56
  • Did you ever get this working? – Philip Kirkbride Oct 30 '17 at 13:55

1 Answers1

2

If you are sure your adapter works fine, try running the command

sudo ifconfig wlan0 up

When you do this, all the available wifi networks should show up when you click the wifi signal button at the top right of the screen. You should then be able to click any of them and type in your password.

Edit: Try running the command sudo iw dev wlan0 scan since you say your wlan0 is up

Kenneth Spear
  • 426
  • 2
  • 5
  • 12
  • 1
    Note, from `man ifconfig`: *"This program is obsolete! For replacement check ip addr and ip link."* It still works and should continue to indefinitely, but if you are new to all this you might as well learn the new ones. The equivalent here would be `ip link set wlan0 up`. – goldilocks Apr 04 '16 at 19:46
  • 1
    I tried using `sudo ifconfig wlan0 up`, but wlan0 was already up (as shown in `ifconfig`). Even after that command `iw` doesn't work. As stated in the question and in the comments, this might be a driver bug. (I can still scan for networks with `iwscan`, but I specifically want to use `iw`, just to be happy :) ) – Sirac Apr 07 '16 at 22:02
  • Try looking at my edit – Kenneth Spear Apr 08 '16 at 16:13