How do I get a D-Link DWA-140 usb wlan working?

18,308

I have also got an DWA 140 and was affected by the same problem on Natty Beta 2. The reason for the problem is that Ubuntu does not only load the rt2870sta kernel module which is needed by the DWA 140, it also loads some other modules for other ralink chipsets.

First look which ralink-ralated modules you have loaded:

lsmod | grep ^rt

Example output:

rt2870sta             450556  0 
rt2800usb              18235  0 
rt2800lib              45181  1 rt2800usb
rt2x00usb              20330  1 rt2800usb
rt2x00lib              49235  3 rt2800usb,rt2800lib,rt2x00usb

Now you have have to unload everything that starts with "rt":

sudo modprobe -rf rt2870sta rt2800usb rt2800lib rt2x00usb rt2x00lib

Then re-load the rt2870sta module

sudo modprobe rt2870sta

You should now be able to connect to your network. If you don't want to load/unload these modules on every reboot, you must blacklist the needless modules in your /etc/modprobe.d/blacklist.conf file, for example add these lines:

blacklist rt2800usb
blacklist rt2800lib
blacklist rt2x00usb
blacklist rt2x00lib
Share:
18,308
pavel
Author by

pavel

WordPress, UX, e-commerce & photo freelance. Running the adventure brand Sten. Working as a teacher.

Updated on September 18, 2022

Comments

  • pavel
    pavel over 1 year

    I just installed natty beta 1 and my d-link dwa-140b2 usb wlan dongle doesn't work any more. Any ideas for how to fix it?

    This is what I get in syslog

    Apr 12 20:00:16 agda kernel: [  118.779178] ieee80211 phy2: Selected rate control algorithm 'minstrel_ht'
    Apr 12 20:00:16 agda kernel: [  118.786483] Registered led device: rt2800usb-phy2::radio
    Apr 12 20:00:16 agda kernel: [  118.786572] Registered led device: rt2800usb-phy2::assoc
    Apr 12 20:00:16 agda kernel: [  118.786658] Registered led device: rt2800usb-phy2::quality
    Apr 12 20:00:16 agda NetworkManager[712]: <info> found WiFi radio killswitch rfkill2 (at /sys/devices/pci0000:00/0000:00:1d.7/usb1/1-3/1-3:1.0/ieee80211/phy2/rfkill2) (driver <unknown>)
    Apr 12 20:00:16 agda NetworkManager[712]: <info> (wlan0): driver supports SSID scans (scan_capa 0x01).
    Apr 12 20:00:16 agda NetworkManager[712]: <info> (wlan0): new 802.11 WiFi device (driver: 'rt2800usb' ifindex: 5)
    Apr 12 20:00:16 agda NetworkManager[712]: <info> (wlan0): exported as /org/freedesktop/NetworkManager/Devices/3
    Apr 12 20:00:16 agda NetworkManager[712]: <info> (wlan0): now managed
    Apr 12 20:00:16 agda NetworkManager[712]: <info> (wlan0): device state change: 1 -> 2 (reason 2)
    Apr 12 20:00:16 agda NetworkManager[712]: <info> (wlan0): bringing up device.
    Apr 12 20:00:16 agda NetworkManager[712]: <warn> (wlan0): firmware may be missing.
    Apr 12 20:00:16 agda NetworkManager[712]: <info> (wlan0): deactivating device (reason: 2).
    Apr 12 20:00:16 agda NetworkManager[712]:    SCPlugin-Ifupdown: devices added (path: /sys/devices/pci0000:00/0000:00:1d.7/usb1/1-3/1-3:1.0/net/wlan0, iface: wlan0)
    Apr 12 20:00:16 agda NetworkManager[712]:    SCPlugin-Ifupdown: device added (path: /sys/devices/pci0000:00/0000:00:1d.7/usb1/1-3/1-3:1.0/net/wlan0, iface: wlan0): no ifupdown configuration found.
    Apr 12 20:00:16 agda kernel: [  118.896657] phy2 -> rt2x00lib_request_firmware: Error - Current firmware does not support detected chipset
    
    • pavel
      pavel about 13 years
      (The DWA-140b2 worked fine for weeks in Crunchbang Linux)
  • user35246
    user35246 almost 13 years
    Appendix: The above workaround works, but actually both drivers are suitable for the DWA 140. rt2870sta is the old one (will be dropped in the future) and rt2800usb is the new one, but Natty ships an older version of linux-firmware than needed. With a new version of the rt2870.bin firmware you can get the new driver working (blacklist the old rt2870sta), check launchpad bug bugs.launchpad.net/bugs/762987
  • Morten Siebuhr
    Morten Siebuhr almost 13 years
    You can make the removal-step even quicker with sudo modprobe -rf 'lsmod | awk '/^rt/ {print $1}'' (the outer ticks should be back-ticks...)