Configuring Trendnet TEW-644UB on Debian Squeeze

    Recently acquired Trendnet TEW-644UB . The device uses the ralink2670 chip (quite a lot of devices are based on it, here is a list ), therefore, I thought there shouldn’t be any problems connecting it and setting it up in debian.

    So, the device is bought, brought home, unpacked and installed in the computer.
    The manual for setting up a wi-fi connection in debian was googled .
    Proceed:
    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 return any results. Kefir is forgotten, a new search has begun. As a result, a problem was found: new versions of the debian kernel (and ubuntu too) by default load the rt2800usb driver instead of the desired rt2870sta, which is why the device does not work correctly. The solution was to add this module to /etc/modprobe.d/blacklist:
    echo "blacklist rt2800usb" >> /etc/modprobe.d/blacklist

    Excellent! After the reboot, we see that the router is visible when searching, but you can’t connect to it - out of the box, WPA and WPA2 encryption are not supported. Not a problem:
    aptitude install wpasupplicant

    Now set up our entire economy:
    File / etc / network / interfaces. Add the following to it:
    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, automatic connection wlan0 at system startup, static network configuration and, most importantly - the wpa-conf parameter, indicating the location of the file with the settings for our wireless connection.

    Let's take a closer look. /etc/wpa_supplicant/wpa_supplicant.conf:
    ctrl_interface=/var/run/wpa_supplicant

    network={
    ssid="nobody"
    #psk="passphrase"
    psk=05e31b9d1544c68360877425983d85aec46cdebd849961f83e257eca61532fd3
    }

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

    and copy the output to our settings file).
    All! Settings are completed, 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, n-mode is disabled by default.
    We understand further. The ralink2870sta sources are downloaded, the following is written in readme:
    RT2870 driver can be configured via following interfaces,
    i.e. (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 point 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 providers are a little wiser. No problem!
    mv /etc/Wireless/RT2870STA/RT2870STA.dat /etc/Wireless/RT3070STA/RT3070STA.dat
    and reboot again. That's it, the device is connected at 107mbps and works great. It remains only to rewind all the extra wires and remove the computer away (:

    Also popular now: