USB wireless adapter based on Ralink Dual Band RT2X00USB (RT3572) Wireless LAN NIC

From CAEN RFID support

Jump to: navigation, search

Here some instructions in order to install USB wireless Dual Band adapters based on Ralink (RT2x00USB) Wireless LAN NIC on the ION system. The dongle Wi-fi tested is a Linksys AE1000 V1 EU.

Contents

Identify the hardware

After connecting the USB device with the ION just get access to the system command line and use the command:

root@ion:~# lsusb 

you should get the line:

Bus 001 Device 004: ID 13b1:002f Linksys AE1000 v1 802.11n [Ralink RT3572]

The Linux driver

Warning: to get running this device on the ION you need the kernel 3.2.14 or later! See the ION's kernel & internals page in order to know how to install such kernel releases.

These adapters need the wireless Linux driver that should be automatically loaded after plugging it into the ION. You should see something like this:

root@ion:~# lsmod
Module                  Size  Used by
...
rt2800lib              31478  1 rt2800usb
crc_ccitt               1019  1 rt2800lib
rt2x00usb               6292  1 rt2800usb
rt2x00lib              22645  3 rt2800usb,rt2800lib,rt2x00usb
mac80211              159136  3 rt2800lib,rt2x00usb,rt2x00lib
cfg80211              115954  2 rt2x00lib,mac80211
...


The firmware

First of all we must install the firmware from the Debian's non-free pool (from Wheezy!) in order to activate the device:

root@ion:~# echo 'deb http://ftp.us.debian.org/debian wheezy non-free' > /etc/apt/sources.list.d/debian-wheezy-non_free.list
root@ion:~# aptitude update
root@ion:~# aptitude install firmware-ralink

If everything works well you should be able to activate the wlan0 interface:

root@ion:~# ifconfig wlan0 up

and the device is up and running:

root@ion:~# ifconfig wlan0                                                      
wlan0     Link encap:Ethernet  HWaddr bc:ae:c5:e8:59:7a                         
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1                    
          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)

The userland tools

Now we have to install some related code from Debian in order to manage the device, especially the encryption functions:

root@ion:~# aptitude install wireless-tools wpasupplicant

Then we can look the device configuration:

root@ion:~# iwconfig wlan0
wlan0     unassociated  Nickname:"rtl_wifi"
          Mode:Auto  Access Point: Not-Associated   Sensitivity:0/0
          Retry:off   RTS thr:off   Fragment thr:off
          Encryption key:off
          Power Management:off
          Link Quality:0  Signal level:0  Noise level:0
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:0   Missed beacon:0

The device is not associated with any access point so let's scan for some access point to connect to:

root@ion:~# iwlist wlan0 scan
wlan0     Scan completed :
          Cell 01 - Address: E0:91:F5:0F:77:81
                    ESSID:"caen_wifi2"
                    Protocol:IEEE 802.11bg
                    Mode:Master
                    Frequency:2.462 GHz (Channel 11)
                    Encryption key:off
                    Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 18 Mb/s
                              24 Mb/s; 36 Mb/s; 54 Mb/s; 6 Mb/s; 9 Mb/s
                              12 Mb/s; 48 Mb/s
                    Signal level=46/100

The access point with ESSID caen_wifi2 has no encryption so we can simply connect to it by using the command:

root@ion:~# iwconfig wlan0 essid caen_wifi2
root@ion:~# iwconfig wlan0
wlan0     IEEE 802.11bg  ESSID:"caen_wifi2"  Nickname:"rtl_wifi"
          Mode:Managed  Frequency:2.462 GHz  Access Point: E0:91:F5:0F:77:81
          Bit Rate:54 Mb/s   Sensitivity:0/0
          Retry:off   RTS thr:off   Fragment thr:off
          Encryption key:off
          Power Management:off
          Link Quality=97/100  Signal level=48/100  Noise level=0/100
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:0   Missed beacon:0

Ok, we are now connected! But we are connected with no encryption... to avoid this (bad) situation we can choose an access point with encryption enabled:

root@ion:~# iwlist wlan0 scan
wlan0     Scan completed :
          Cell 01 - Address: C0:3F:0E:54:EE:78
                    ESSID:"CAEN_RFID"
                    Protocol:IEEE 802.11bg
                    Mode:Master
                    Frequency:2.437 GHz (Channel 6)
                    Encryption key:on
                    Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 18 Mb/s
                              24 Mb/s; 36 Mb/s; 54 Mb/s; 6 Mb/s; 9 Mb/s
                              12 Mb/s; 48 Mb/s
                    Extra:wpa_ie=dd1c0050f20101000050f20202000050f2040050f202010
                    IE: WPA Version 1
                        Group Cipher : TKIP
                        Pairwise Ciphers (2) : CCMP TKIP
                        Authentication Suites (1) : PSK
                    Extra:rsn_ie=30180100000fac020200000fac04000fac020100000fac0
                    IE: IEEE 802.11i/WPA2 Version 1
                        Group Cipher : TKIP
                        Pairwise Ciphers (2) : CCMP TKIP
                        Authentication Suites (1) : PSK
                    IE: Unknown: DD0E0050F204104A0001101044000102
                    Signal level=100/100

in this case we must use the wpa_supplicant tool in order to manage the encrypted connection.

First of all we must add the wlan0 interface configuration to the system:

root@ion:~# cat >> /etc/network/interfaces

auto wlan0
iface wlan0 inet dhcp
        wpa-driver wext
        wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

and then the relative wpa_supplicant's configuration:

root@ion:~# cat > /etc/wpa_supplicant/wpa_supplicant.conf
ctrl_interface=/var/run/wpa_supplicant

in the end we add the passphrase:

root@ion:~# wpa_passphrase CAEN_RFID caenrfid >> /etc/wpa_supplicant/wpa_supplicant.conf

Ok, now we simply activate the interface and the wpa_supplicant should manage the encrypted connection:

root@ion:~# ifup wlan0
Internet Systems Consortium DHCP Client 4.1.1-P1
Copyright 2004-2010 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

Listening on LPF/wlan0/bc:ae:c5:e8:59:7a
Sending on   LPF/wlan0/bc:ae:c5:e8:59:7a
Sending on   Socket/fallback
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 6
DHCPOFFER from 192.168.0.253
DHCPREQUEST on wlan0 to 255.255.255.255 port 67
DHCPNAK from 10.0.1.1
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 4
DHCPOFFER from 192.168.0.253
DHCPREQUEST on wlan0 to 255.255.255.255 port 67
DHCPNAK from 10.0.1.1
DHCPACK from 192.168.0.253
bound to 192.168.0.3 -- renewal in 42145 seconds.
Personal tools