"iw" and some of its commands do not return any output
Solution 1
You need to install wireless_tools
Open a terminal and type the following commands:
aptitude install wireless-tools
Restart network services:
/etc/init.d/networking restart
Update
You need to add interfaces with iw
iw dev wlan0 interface add <name> type <type>
For wired connection:
iw phy phy0 interface add <name> type <type>
There are several modes supported. The modes supported are:
monitor
managed [also station]
wds
mesh [also mp]
ibss [also adhoc]
Example:
iw phy phy0 interface add moni0 type monitor
iw dev wlan0 interface add wlan0 type station
Solution 2
Install the iw
package,
apt-get install iw
then you will have the iw
command.
EDIT:
it is pretty obvious at this moment that you have a bug somewhere. You have the following alternatives:
Since you have a very old kernel, 3.4.90 (see here), you may wish to dramatically update your kernel. There are guides to do this all over Google.
-
you may try to recompile the device driver, in the hope that the bug is there, not in the old version of
iw
you run. You do this as follows: downloads Linux backports from here, go to the directory where you downloaded the above file, and give these commands:sudo apt-get install linux-headers-$(uname -r) build-essential firmware-realtek tar xvfz backports-4.4.2-1.tar.gz cd backports-4.4.2-1/ make defconfig-rtlwifi make sudo make install
Reboot, try your iw
commands again. If this fails, I can only suggest updating your old kernel: 3.4 was released in May 2012.
Related videos on Youtube
vaid
Updated on September 18, 2022Comments
-
vaid almost 2 years
I've been trying to set up my ARM based computer so that it becomes a hotspot and a client at the same time.
However all of the information I've found about such functionality mention the
iw
command which seems to be crucial for me to solve the problem I'm having.It does not seem to work properly for me.
When I type
iw wlan0 info
I get the error messagecommand failed: No such device (-19)
.Why is this happening?
I'm on Debian Wheezy.
EDIT: I have a fully functional WiFi dongle connected to the ARM computer. The WiFi dongle is the only connection to my network.
The Wifi dongle is based on
RTL8188CUS
.IMPORTANT
I managed to get it to work briefly by doing the following:
Add
contrib non-free
to the first two sources in /etc/apt/sources.listRun
apt-get update
Runapt-get upgrade
Run
apt-get install firmware-realtek
Connect wifi dongle
Run
iw list
, it works now.Kind of off topic, but related to why I need IW to work, and I'll get back to IW after my explanation
The wifi dongle I have uses an
RTL8188CUS
chip, and according to RealTek's release notes this chip should support mixed modes as of version4.0.0_5967.2021201
.By mixed modes I mean
Station+Station
,Station+AP
,Station+P2P
.Note: The mode "Station" is also refered to as "Managed"
I've been trying to figure out how to make this chip use the Station+AP for months now, however, old drivers have been installed on every system I've used and set up, until I found this (which I'm trying now): https://github.com/pvaret/rtl8192cu-fixes
I've found some more resources which I'll try later.
NOW, back to
IW
;IW
seems to stop working when the wrong drivers are used.Even though I use the wrong drivers, I still manage to connect the Wifi dongle to any network, but
IW
no longer recognizes the device.IWCONFIG
works fine,IFCONFIG
works fine.So I believe that the wrong drivers will cause commands such as
iw dev
to stop working.Additional information: the module
8192cu
is never loaded when following the installation steps in the GITHUB above.I know, they are not for the same driver, but they should still work for
8188cu
according to RealTek. -
vaid over 8 yearsIt says that
wireless-tools
is already installed. -
vaid over 8 years
iwconfig
works fine. It shows my WiFi device as expected. -
vaid over 8 yearsbtw, you've been trying to help me with something related to this before @MariusMatutiae. And I still haven't solved it.
-
vaid over 8 years
iw
is also insatalled. I've reinstalled it as well. -
vaid over 8 yearsBy doing
iw dev wlan0 interface add <name> type <type>
I just get help information which tries to tell me how to useiw
. -
vaid over 8 yearsI think that
iw
doesn't know what physical devices are available somehow. -
vaid over 8 yearsYes. I do everything in root.
-
vaid over 8 yearsSorry for not being clear. That's exactly how I wrote it. I replaced
<name>
withwlan0
and<type>
withmanaged
because it worked on my other computer which is x86 based. -
vaid over 8 yearsYes,
wpa_supplicant
is also installed. -
vaid over 8 yearsI don't have any other wifi adapter, however, when I connect the wifi adapter that I am using in to my x86 linux computer
iw
works fine. -
GAD3R over 8 yearsthe ouput of
rfkill list
-
vaid over 8 yearsit says
bash: rfkill: command not found
I guess I have to install it -
vaid over 8 yearsI installed it, now when I write
rfkill list
it returns nothing. It just goes straight to bash again. -
vaid over 8 yearsSure, can I use a command to figure out the vendor and product code?
-
vaid over 8 yearsHere's the output of
lsusb
:Bus 004 Device 003: ID 0bda:8176 Realtek Semiconductor Corp. RTL8188CUS 802.11n WLAN Adapter
-
vaid over 8 yearsOk, the line
sudo apt-get install linux-headers-$(uname -r) build-essential firmware-realtek
gives me the errorE: Unable to locate package linux-headers-3.4.90
andE: Couldn't find any package by regex 'linux-headers-3.4.90'
. I've encountered this before, but I don't recall resolving it. -
vaid over 8 yearsI'm sorry, this is just insane. I can't find ANY information about why
iw <commands>
does not work. It also stopped working on my x86 Linux computer for some reason. I've installed a fresh version of Debian Jessie on VirtualBox and same thing there. It just won't work and it's driving me crazy. Why does it not work? -
vaid over 8 yearsCould it be that some service is using the device so that
iw
can't read it? When I writeiw wlan0 link
it saysNot connected
-
vaid over 8 yearsPlease see my edit in the question
-
vaid over 8 yearsplease see the edit in my question. btw, I never managed to get rfkill to work