⬆️ ⬇️

Configuring Trendnet TEW-644UB in Debian Squeeze

Recently acquired a Trendnet TEW-644UB . The device uses the ralink2670 chip (quite a few devices are based on it, here is the list ), so I thought there shouldn't be any problems with its connection and configuration in debian.



So, the device is purchased, brought home, unpacked and installed in the computer.

There was a manual for setting up a wi-fi connection in debian.

Let's start:

aptitude update

aptitude install firmware-ralink wireless-tools


All packages are downloaded, installed, the device is found, iwconfig shows us a new wireless interface. It seems to be all right and you can already start drinking kefir.

However, the attempt to connect the computer to the router failed, moreover, iwlist wlan0 scan did not produce any results. Kefir forgotten, began a new search. Following the results, a problem was found: new debian kernel versions (and ubuntu too) load the rt2800usb driver by default instead of the rt2870sta driver needed, which is why the device is not working properly. The solution was to add this module to /etc/modprobe.d/blacklist:

echo "blacklist rt2800usb" >> /etc/modprobe.d/blacklist


Fine! After the reboot, we see that the router is visible during the search, only you cannot connect to it - WPA and WPA2 encryption is not supported out of the box. No problem:

aptitude install wpasupplicant


Now we will configure all our economy:

File / etc / network / interfaces. We add there the following:

auto wlan0

iface wlan0 inet static

address 172.16.0.3

netmask 255.255.255.0

gateway 172.16.0.1

wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf


Actually, the automatic connection wlan0 at system startup, static network configuration and, most importantly, the wpa-conf parameter, which indicates the location of the file with the settings of our wireless connection.



Consider it closer. /etc/wpa_supplicant/wpa_supplicant.conf:

ctrl_interface=/var/run/wpa_supplicant



network={

ssid="nobody"

#psk="passphrase"

psk=05e31b9d1544c68360877425983d85aec46cdebd849961f83e257eca61532fd3

}


We take as a basis the /usr/share/doc/wpasupplicant/examples/plaintext.conf file and read the man. So, to configure WPA2 encryption, you need the following: ssid is the name of the network to which we want to connect, psk is the key (indicated either by direct text or by a hash — for this we use the program
wpa_passphrase <ssid> [passphrase]



and copy the output to our configuration file).

Everything! Settings are finished, we are overloaded and we see that the connection is established, everything works. But for some reason at a speed of 54mbps, and not at 150mbps, as we would like ... Apparently, the n-mode is disabled by default.

We understand further. The ralink2870sta sources are downloaded, the following is written in the readme:

RT2870 driver can be configured via following interfaces,

ie (i)"iwconfig" command, (ii)"iwpriv" command, (iii) configuration file



i) iwconfig comes with kernel.

ii) iwpriv usage, please refer to file "iwpriv_usage.txt" for details.

iii)modify configuration file "RT2870STA.dat" in /etc/Wireless/RT2870STA/RT2870STA.dat.


Copy RT2870STA.dat to /etc/Wireless/RT2870STA/RT2870STA.dat and read the readme further. Here is the item of interest:

@> WirelessMode=value

value

0: legacy 11b/g mixed

1: legacy 11B only

2: legacy 11A only //Not support in RfIcType=1(id=RFIC_5225) and RfIcType=2(id=RFIC_5325)

3: legacy 11a/b/g mixed //Not support in RfIcType=1(id=RFIC_5225) and RfIcType=2(id=RFIC_5325)

4: legacy 11G only

5: 11ABGN mixed

6: 11N only

7: 11GN mixed

8: 11AN mixed

9: 11BGN mixed

10: 11AGN mixed


We edit the file, save, reboot and see that the connection again has a speed of 54mbps.

dmesg reports interesting things:

[ 10.584155] <-- RTMPAllocTxRxRingMemory, Status=0

[ 10.585882] -->RTUSBVenderReset

[ 10.586007] <--RTUSBVenderReset

[ 10.874039] --> Error 2 opening /etc/Wireless/RT3070STA/RT3070STA.dat

[ 10.874042] 1. Phy Mode = 0

[ 10.874044] 2. Phy Mode = 0

[ 10.903181] RTMPSetPhyMode: channel is out of range, use first channel=1

[ 10.913054] 3. Phy Mode = 0

[ 10.917313] MCS Set = 00 00 00 00 00

[ 10.926551] <==== RTMPInitialize, Status=0

[ 10.928068] 0x1300 = 000a4200

[ 14.217511] fuse init (API version 7.13)

[ 14.793973] DRS: unkown mode,default use 11N 1S AP

[ 14.793978] DRS: unkown mode (SupRateLen=0, ExtRateLen=0, MCSSet[0]=0x0, MCSSet[1]=0x0)





Those. Driver vendors are a little wise. No problem!
mv /etc/Wireless/RT2870STA/RT2870STA.dat /etc/Wireless/RT3070STA/RT3070STA.dat
and reboot again. Everything, the device was connected at a speed of 107mbps and works fine. It remains only to wind all the extra wires and put the computer away (:


')

Source: https://habr.com/ru/post/93543/



All Articles