From Technologic Systems Manuals
Jump to: navigation, search
Released Mar. 2011
Accessories Product Page
Ralink Drivers
Operating Temperature
Cold 0C
Hot 45C


1 Overview

The WIFI-N-USB or USB-N13 is an 802.11 B, G, and N device that operates on the 2.4GHZ spectrum. This uses the rt3070L chipset provided by ralink. This module measures 7.0 cm L* 2.2 cm W* 1.0 ccm H (Weight 12 gm). The WIFI-N-USB has 2 built in antennas, and has a maximum range of 490 ft (150m).

Depending on the rt3070sta driver version this device may show up as ra0, or rausb0. Aside from the drivers, some older boards with smaller flashes did not include the iwconfig or wpa_supplicant tools. Check your board's FTP directory for copies of these binaries.

2 Installation

Newer images will already contain these drivers. First you may want to try just loading the driver to see if it works:

modprobe rt3070sta

If this does not return with "Module not found" or a similar error then you should now be able to see the device in the 'ifconfig -a' listing. If you are working from an older board or older image you will need to install these manually.

This example shows installing the drivers for the TS-4800 with the 2.6.35 kernel.

cd /tmp 
tar -xf wifi-n-usb-binaries.tar.gz
# Copy the TS-4800 module to the system modules
cp wifi-n-usb-binaries/TS-kernel-2.6/rt3070sta-4800.ko /lib/modules/
# Rebuild the dependency list (so it will load the appropriate USB modules first)
# Copy the driver's binary to where the driver will load it
cp wifi-n-usb-binaries/TS-kernel-2.6/RT2870STA-2.6.dat /etc/Wireless/RT2870STA/RT2870STA.dat
# Load the driver
modprobe rt3070sta
# You should now see an additional ra0 or rausb0 device in ifconfig or iwconfig.
ifconfig -a
# On some boards you may not have the wireless-tools package installed.  You can
# download this from APT on most boards, or copy the binaries from your board's FTP directory if
# your board does not run Debian.
apt-get update && apt-get install wireless-tools
# Now you should be able to scan for networks
ifconfig ra0 up
iwlist scan

3 Usage

3.1 Infrastructure Mode

3.1.1 Connect to an Open Access point

ifconfig ra0 up
# Replace linksys with your network name
iwconfig ra0 essid "linksys" 
# Set a static ip address
#ifconfig ra0
# Request an IP address from a DHCP server
# Depending on your board, this could be pump, dhclient, or udhcpc
dhclient ra0

3.1.2 Connect to a WEP Encrypted Access point

ifconfig ra0 up
# Replace linksys with your network name, as well as the 'testing' key.
iwconfig ra0 essid "linksys" key "testing"
# Set a static ip address
#ifconfig ra0
# Request an IP address from a DHCP server
# Depending on your board, this could be pump, dhclient, or udhcpc
dhclient ra0

3.1.3 Connect to a WPA Encrypted Access point

ifconfig ra0 up
# Generate a configuration file for wpa_supplicant to use
wpa_passphrase the_essid the_password > /etc/wpa_supplicant_custom.conf
# Insert "proto=RSN" into "network" block in /etc/wpa_supplicant_custom.conf
vi /etc/wpa_supplicant_custom.conf
# Use wpa_supplicant to associate with AP and run it in the background (-B)
# Note that setting up this interface automatically can be in /etc/network/interfaces
# Please see the man page for interfaces for more information about this
wpa_supplicant -ira0 -Dwext -c/etc/wpa_supplicant_custom.conf -B
# Set a static ip address
#ifconfig ra0
# Request an IP address from a DHCP server
# Depending on your board, this could be pump, dhclient, or udhcpc
dhclient ra0
Note: WPA is not supported on boards using a 2.4 kernel.

3.2 Adhoc Mode

ifconfig ra0 up
# Set ra0 to adhoc mode.  Change "testing" to set the broadcasted network name.
iwconfig ra0 mode ad-hoc channel 3 enc off essid "testing"
# Set a static ip address
#ifconfig ra0

3.3 Master Mode

Unfortunately the driver does not yet support this functionality. When it does this page will be updated.

4 Troubleshooting

4.1 Unknown Symbol

The message rt2870sta: Unknown symbol x means that the module dependencies have not been satisfied. Use the following as a guide as a basic checklist to insure the correct modules are loaded:

modprobe hid
modprobe usbcore
modprobe usb_storage
modprobe scsi_mod
modprobe ohci_hcd

The message insmod: error inserting 'rt2870sta_tsXXXX.ko': -1 Invalid module format will occur if you are trying to insert a module into a kernel that it was not compiled for. Verify that you have the correct module for your board. If you're sure the module should work, try using the insmod command with the -f option (ie. insmod -f rt2870sta_tsXXXX.ko).

If you are having difficulties in pinging your AP, try to disconnect eth0 byusing the command ifconfig eth0 down.

4.2 Operation not permitted

If you receive the error:

 SIOCSIFFLAGS: Operation not permitted

This has 2 possible solutions. Make sure the firmware file is in '/etc/Wireless/RT2870STA/RT2870STA.dat'. The other possibility is a conflict with older versions of some of our kernels. If this is the case the best option is simply to download our latest image or kernel sources if you have custom options. You can verify the kernel issue by typing 'dmesg' after trying to bring up the interface:

 [  635.270000] <-- ERROR in Alloc TX TxContext[2] HTTX_BUFFER !! 
 [  635.270000] <-- RTMPAllocTxRxRingMemory, Status=3
 [  635.270000] ERROR!!! RTMPAllocDMAMemory failed, Status[=0x00000003]
 [  635.270000] !!! rt28xx Initialized fail !!!

4.3 Errata

4.3.1 TS-75XX/TS-4500 Issue

The TS-75XX/TS-4500 series of SBCs have an errata when using this driver/device with WPA networks, connecting to open and WEP networks are not affected by this issue. This issue is present on image release Sept062011 and all prior releases. The wifi-g-usb-2 device driver required a special version of `wpa_supplicant` in order to connect to WPA networks. Because of this, the default version of `wpa_supplicant` on the default distribution is 0.5.8 and is designed for the wifi-g-usb-2 device. This version of `wpa_supplicant` is incompatible with the wifi-n-usb and will not find all of the access points in range. Corrective Action

The solution is to install the Debian version of `wpa_supplicant` and use that for configuring WPA. In order to install the new wpa_supplicant, perform the following steps:

mv /usr/local/bin/wpa_supplicant /usr/local/bin/wpa_supplicant.old
apt-get update && apt-get install wpasupplicant #This assumes a proper internet connection is established
# reset the shell to find the new wpa_supplicant
exec bash
# Verify that it is the correct version:
wpa_supplicant -v

It should return at least 0.6.4 as the version number