View Full Version : [ubuntu] Dwa 140

March 9th, 2009, 10:14 AM
Dear Forum,

I've seen previous threads on installing the DWA140. It seems that since they've been written some changes to Kernel have been implemented so I'm going to try to get the new stuff working. I thought I'd put a thread out so that others might either help or follow without making my mistakes.

My setup as follows:
Ubuntu 8.10 desktop x64 (core2quad)
D-link DWA140 wireless
Home network based on fritzbox WPA2. Desktop PC always get the same internal IP from the router. External IP through dyndns. Wireless n/g are supported on all channels.

Other forum entries tell me that the d-link is using the Railink 2870 chipset.

I don't have a wired network connection to the desktop so I'm going to rely on wireless as my only Internet connection.

Step 1
I install Ubuntu 8.10 x64 on a USB stick with Unetbootin (loads of forum info on this so I'll not go any further).

Step 2 - Get the driver
I got the driver from the Railink website http://www.ralinktech.com/ralink/Home/Support/Linux.html. I downloaded the RT2870 driver.

Step 3 - Unpack
I unpacked the driver from Nautilus but you can also use

tar -xvzf DPB_RT2870_Linux_STA_x.x.x.x.tgz

Step 4 - Configure the make file
In the instructions from Railink it states

set the "MODE = STA" in Makefile and chose the TARGET to Linux by set "TARGET = LINUX"
define the linux kernel source include file path LINUX_SRC
modify to meet your need.

I found the MODE = STA and TARGET = LINUX already set. The next part I wasn't sure. There are a lot of paths LINUX_SRC that seem to be set according to hardware. In the make file there is a line for PC

ifeq ($(PLATFORM),PC)
# Linux 2.6
LINUX_SRC = /lib/modules/$(shell uname -r)/build
# Linux 2.4 Change to your local setting
#LINUX_SRC = /usr/src/linux-2.4
LINUX_SRC_MODULE = /lib/modules/$(shell uname -r)/kernel/drivers/net/wireless/

I left this file unchanged since from my limited knowledge, I think it is already correct. My in lib/modules of the target computer I have a single directory 2.6.27-7-generic.

Step 5 - Setup the config.mk

I'm using network manager so I set


Railink calls for the following

=> #>cd wpa_supplicant-x.x
=> #>./wpa_supplicant -Dwext -ira0 -c wpa_supplicant.conf -d

I used the command

whereis wpa_supplicant.conf

Results in

/sbin/wpa_supplicant /etc/wpa_supplicant

Not sure which one of these should be modified but I assume the etc. I've left it blank at the moment because it seems to work without.

Step 6 - make

make gave me a load of errors and debug

sudo make seemed to work fine.

then I ran
sudo install

Step 7 - Copy driver

cp RT2870STA.dat /etc/Wireless/RT2870STA/RT2870STA.dat

didn't work because sudo install had created the directories and the permissions where not correct. Therefore I used "sudo cp"

Step 8 - Install driver

sbin/insmod rt2870sta.ko

Network manager worked immediately. I'd expected to need ifconfig ra0 up but didn't seem necessary.

Step 9 - Connect to network.

Here I just selected my network in the network manager and entered the WPA2 key. No further changes.

The output of ifconfig is now

eth0 Link encap:Ethernet HWaddr 00:22:68:3a:90:99
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
Interrupt:249 Base address:0xe000

lo Link encap:Local Loopback
inet addr: Mask:
inet6 addr: ::1/128 Scope:Host
RX packets:244 errors:0 dropped:0 overruns:0 frame:0
TX packets:244 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:15308 (15.3 KB) TX bytes:15308 (15.3 KB)

ra0 Link encap:Ethernet HWaddr 00:22:b0:57:cd:84
inet addr: Bcast: Mask:
inet6 addr: fe80::222:b0ff:fe57:cd84/64 Scope:Link
RX packets:55260 errors:4 dropped:0 overruns:0 frame:0
TX packets:7466 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:21958722 (21.9 MB) TX bytes:1190674 (1.1 MB)

Hope this helps. Maybe some of those with more knowledge can improve a little or make corrections.