Firmware: A-410 [01 Apr. 2014] | A-400 [12 Mar. 2014] | C-300 [13 Feb. 2014] | A-300 [24 Feb. 2014] | C-200 [11 July 2013] | A-200/A-210 [11 July 2013] | Popbox V8 [3 Dec 2013]

Just got your NMT | WIKI has the answers | Search the forum | Forum Rules/Policy | Firmware & Official NMT News | Popcornhour manuals



User(s) browsing this thread: 1 Guest(s)
Post Reply 
[HOWTO] Ralink RT2870 wifi chipset
10-06-2010, 11:12 PM
Post: #1
[HOWTO] Ralink RT2870 wifi chipset
Hey, I've managed to compile and configure driver for RT2870 Ralink wifi-N USB dongle - Asus N11. It connects to my Asus wl500w at 135 Mbps, same connection speed achieved under Windows XP with bundle driver. Perhaps not able to achieve more speed due to my router settings which is configured for wifi b/g/n mixed mode.

Thanks to tiagor's guide on RT73 and RT2570 chipsets!

My steps were:
- configure toolchain under Debian VM image. Unfortunately I don't remember how I did that, hope just followed NMT wiki without extra steps.
- obtained latest (2.4.0.x) sources from RaLink website
- edited Makefile for
RT28xx_MODE=STA
PLATFORM=SIGMA
replaced paths to /root/sigma/smp86xx* with actual paths to kernel source and toolchain
- edited include/rtmp_def.h and replaced "ra" string with "wlan". This is to name wireless interface in same way as NMT's dirver for zd1221. Thus allowing gaya and scripts from firmware to control my dongle. Otherwise not able get wifi status from gaya.
- edited common/usb_main_dev.c and entered my dongle vendorID and deviceID. These values can be obtained from /sys/bus/usb/devices/ once dongle attached to USB port at NMT. For mine Asus N11 they are
0x1761 and 0x0b05. Strange, other Asus entries are having 0x0b05 as
vendorID. Looks like in my dongle vendorID and deviceID are mixed??
- make
- upload rt2870sta.ko and DAT file to nmt
- follow tiagor guide to configure module and wireless

I've also added hotplug rules at /etc/udev/rules.d/ and edited /etc/init.d/S40Network for support from gaya and ipmonitor.

I'm not using security on my home wireless, so here is all staff.

My entry script (rt2870.sh) which copy all staff, being called from start_app.sh
Code:
#! /bin/sh

if [ ! -e /etc/udev/rules.d/rt2870wifi.rules ]; then
    cp /share/.rt2870_2.4.0.1/rt2870wifi.rules /etc/udev/rules.d/rt2870wifi.rules
fi

cp /share/.rt2870_2.4.0.1/S40network /etc/init.d/S40network

if ! lsmod | grep -q arusb_lnx; then
    echo "Unloading Atheros driver"
    rmmod /opt/wifi/zd1221/arusb_lnx.ko
fi

if ! lsmod | grep -q rt2870; then
    echo "Loading Ralink RT2870 USB wifi adapter driver"
    mkdir -p /etc/Wireless/RT2870STA/
    cp /share/.rt2870_2.4.0.1/RT2870STA.dat /etc/Wireless/RT2870STA/RT2870STA.dat
    
    insmod /share/.rt2870_2.4.0.1/rt2870sta.ko


    USB_NUM_PORTS=2
    USB_PORTS="/sys/bus/usb/devices/1-"

    USB_RT2870_VENDOR_ID="1761"
    USB_RT2870_DEVICE_ID="0b05"

    wifi_config="/opt/wifi/config/wifi.config"

    usb_port_id=1;
    while [ $usb_port_id -le $USB_NUM_PORTS ]; do
        if [ -d $USB_PORTS$usb_port_id ]; then
        vendor_id=`cat $USB_PORTS$usb_port_id/idVendor`
        device_id=`cat $USB_PORTS$usb_port_id/idProduct`        
        if [ $vendor_id = $USB_RT2870_VENDOR_ID -a $device_id = $USB_RT2870_DEVICE_ID ]; then
            echo "RaLink RT2870 USB wifi adapter detected!"
            echo "net.wifi.device=usb_rt2870" > $wifi_config
            echo 7194 > /proc/sys/vm/min_free_kbytes
            sleep 3                # wait for the device node to be ready
            ifconfig wlan0 up
            /bin/ipmonitor reset    # re-generate setup page
            
            #press "Save" at Gaya wireless setup
            /opt/sybhttpd/default/setups.cgi QUERY_STRING="%7FSave=save&%7FhiDe=4&%7FSSIDList=MyHomeWirelessSSID&%7FSSID=MyHomeWirelessSSID&%7Fsecurity=none&%7Fkey="
            
            exit 0
        fi
        fi
        usb_port_id=$(( usb_port_id + 1 ))
    done

fi

rt2870_hotplug.sh - being called by udev once dongle attached/detached to USB
Code:
#! /bin/sh

wifi_config="/opt/wifi/config/wifi.config"

if [ $# -eq 1 ]; then
    if [ $1 = "add" ]; then
        echo 7194 > /proc/sys/vm/min_free_kbytes
        if [ ! -f $wifi_config ]; then
            echo "net.wifi.device=usb_rt2870" > $wifi_config
            ifconfig wlan0 up
            /bin/ipmonitor reset    # re-generate setup page

            #press "Save" at Gaya wireless setup
            /opt/sybhttpd/default/setups.cgi QUERY_STRING="%7FSave=save&%7FhiDe=4&%7FSSIDList=MyHomeWirelessSSID&%7FSSID=MyHomeWirelessSSID&%7Fsecurity=none&%7Fkey="
            
        fi
    elif [ $1 = "remove" ]; then
        rm $wifi_config
        if [ -e /opt/wifi/config/wpa_supplicant/wlan0 ]; then
            /opt/wifi/bin/wpa_cli -p /opt/wifi/config/wpa_supplicant -i wlan0 terminate
        fi
        echo 2398 > /proc/sys/vm/min_free_kbytes
        /bin/ipmonitor reset    # re-generate setup page
        #echo -e -n "file:///opt/sybhttpd/default/network_wireless_manual.html::file:///opt/sybhttpd/default/network.html\0" > /tmp/gaya_bc
    fi
fi

rt2870wifi.rules
Code:
ACTION=="add", SYSFS{idVendor}=="1761", SYSFS{idProduct}=="0b05", RUN+="/share/.rt2870_2.4.0.1/rt2870_hotplug.sh add"
ACTION=="remove",SYSFS{idVendor}=="1761", SYSFS{idProduct}=="0b05", RUN+="/share/.rt2870_2.4.0.1/rt2870_hotplug.sh remove"

S40Network, my "if" under net_config_wlan now looks like this
Code:
    if [ $wifi_device = "usb_zd1221" ]; then
        /opt/wifi/zd1221/zd1221.sh
        wifi_driver="otus"
    elif [ $wifi_device = "pci_mtlk" ]; then
        /opt/wifi/mtlk/mtlk.sh
    elif [ $wifi_device = "pci_rt2880" ]; then
        /opt/wifi/rt2880/rt2880.sh
        wifi_driver="ralink"
    elif [ $wifi_device = "usb_rt2870" ]; then
        /share/.rt2870_2.4.0.1/rt2870.sh
        wifi_driver="ralink"
    fi

So far my connection from NMT works fine and quite stable. Uppreciate your comments on these.
Find all posts by this user
Add Thank You Quote this message in a reply
[+] 2 users say Thank You to artbern for this post
10-07-2010, 08:03 AM
Post: #2
RE: [HOWTO] Ralink RT2870 wifi chipset
What actual transfer speeds are you seeing. 135Mb/s sounds too high, at 16.9MB/s, for the actual transfer. That's as quick as wired using FTP!

A400: SD Card(Apps), HDMI C200: USB(Apps), BD ROM (SH-B083L(SB01)), HDMI
CAT6 Wired Network: TV Panasonic TX-P42G20, HP ProCurve 1400-8G, Netgear GS-608/605, Synology CS407
Find all posts by this user
Add Thank You Quote this message in a reply
10-08-2010, 07:22 PM
Post: #3
RE: [HOWTO] Ralink RT2870 wifi chipset
(10-07-2010 08:03 AM)chris57 Wrote:  What actual transfer speeds are you seeing. 135Mb/s sounds too high, at 16.9MB/s, for the actual transfer. That's as quick as wired using FTP!

Here are my stats:
Code:
/opt/sybhttpd/localhost.drives/HARD_DISK # /opt/wifi/bin/iwconfig
lo        no wireless extensions.

eth0      no wireless extensions.

wlan0     Ralink STA  ESSID:"mySSSID"  Nickname:"RT2870STA"
          Mode:Managed  Frequency=2.437 GHz  Access Point: 00:22:15:6D:C6:0C
          Bit Rate=135 Mb/s
          RTS thr:off   Fragment thr:off
          Encryption key:off
          Link Quality=100/100  Signal level:-41 dBm  Noise level:-62 dBm
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:0   Missed beacon:0

/opt/sybhttpd/localhost.drives/HARD_DISK #
Iperf test from my PCH-A110 to Asus wl500w via wifi
Code:
/opt/sybhttpd/localhost.drives/HARD_DISK # ./iperf -c 192.168.1.1
------------------------------------------------------------
Client connecting to 192.168.1.1, TCP port 5001
TCP window size: 16.0 KByte (default)
------------------------------------------------------------
[ 13] local 192.168.1.6 port 49836 connected with 192.168.1.1 port 5001
[ ID] Interval       Transfer     Bandwidth
[ 13]  0.0-10.0 sec  24.4 MBytes  20.4 Mbits/sec
/opt/sybhttpd/localhost.drives/HARD_DISK # ./iperf -c 192.168.1.1
------------------------------------------------------------
Client connecting to 192.168.1.1, TCP port 5001
TCP window size: 24.3 KByte (default)
------------------------------------------------------------
[ 13] local 192.168.1.6 port 49837 connected with 192.168.1.1 port 5001
[ ID] Interval       Transfer     Bandwidth
[ 13]  0.0-10.0 sec  24.6 MBytes  20.7 Mbits/sec
/opt/sybhttpd/localhost.drives/HARD_DISK #

Iperf test from router to PCH:
Code:
[admin@myrouter root]$ ./iperf -c 192.168.1.6
------------------------------------------------------------
Client connecting to 192.168.1.6, TCP port 5001
TCP window size: 16.0 KByte (default)
------------------------------------------------------------
[  5] local 192.168.1.1 port 1234 connected with 192.168.1.6 port 5001
[ ID] Interval       Transfer     Bandwidth
[  5]  0.0-10.0 sec  47.3 MBytes  39.7 Mbits/sec
[admin@myrouter root]$ ./iperf -c 192.168.1.6
------------------------------------------------------------
Client connecting to 192.168.1.6, TCP port 5001
TCP window size: 16.0 KByte (default)
------------------------------------------------------------
[  5] local 192.168.1.1 port 1236 connected with 192.168.1.6 port 5001
[ ID] Interval       Transfer     Bandwidth
[  5]  0.0-10.0 sec  48.6 MBytes  40.7 Mbits/sec
[admin@myrouter root]$

Quite intresting - bandwidth is not symmetric
Find all posts by this user
Add Thank You Quote this message in a reply
06-16-2011, 06:37 PM (This post was last modified: 06-16-2011 06:37 PM by loempie.)
Post: #4
RE: [HOWTO] Ralink RT2870 wifi chipset
Hi,
I also have a Ralink RT2870 chipset USB dongle over here.
But i don't understand the guide.
Can someone make a guide like this one please:
http://www.networkedmediatank.com/showth...#pid185740
Thanks!
Find all posts by this user
Add Thank You Quote this message in a reply
09-09-2011, 06:01 PM
Post: #5
RE: [HOWTO] Ralink RT2870 wifi chipset
Hi
I tried to compile the drivers but no success.
Its possible that someone that has this drivers compiled to post a link to download to test?
Thanks
Find all posts by this user
Add Thank You Quote this message in a reply
09-11-2011, 06:27 PM
Post: #6
RE: [HOWTO] Ralink RT2870 wifi chipset
(09-09-2011 06:01 PM)zito14 Wrote:  Hi
I tried to compile the drivers but no success.
Its possible that someone that has this drivers compiled to post a link to download to test?
Thanks

Here you go
https://rapidshare.com/files/203400590/RT2870STA.zip
Find all posts by this user
Add Thank You Quote this message in a reply
[+] 1 user says Thank You to artbern for this post
09-13-2011, 09:28 AM
Post: #7
RE: [HOWTO] Ralink RT2870 wifi chipset
Thanks
I will try this.

(09-11-2011 06:27 PM)artbern Wrote:  
(09-09-2011 06:01 PM)zito14 Wrote:  Hi
I tried to compile the drivers but no success.
Its possible that someone that has this drivers compiled to post a link to download to test?
Thanks

Here you go
https://rapidshare.com/files/203400590/RT2870STA.zip
Find all posts by this user
Add Thank You Quote this message in a reply
02-03-2012, 09:22 PM
Post: #8
RE: [HOWTO] Ralink RT2870 wifi chipset
(09-11-2011 06:27 PM)artbern Wrote:  Here you go
https://rapidshare.com/files/203400590/RT2870STA.zip

Not working on a300
Code:
insmod /share/.rt2870_2.4.0.1/rt2870sta.ko
insmod: can't insert '/share/.rt2870_2.4.0.1/rt2870sta.ko': invalid module format

Any chances it will work on a300?
Find all posts by this user
Add Thank You Quote this message in a reply
02-04-2012, 05:08 AM
Post: #9
RE: [HOWTO] Ralink RT2870 wifi chipset
As per error message, there is different kernel on a300. Need to recompile module, unfortunately I'm still on a110 and not able to test for a300
Find all posts by this user
Add Thank You Quote this message in a reply
02-04-2012, 09:13 PM
Post: #10
RE: [HOWTO] Ralink RT2870 wifi chipset
(02-04-2012 05:08 AM)artbern Wrote:  As per error message, there is different kernel on a300. Need to recompile module, unfortunately I'm still on a110 and not able to test for a300

I'm confused a bit about how to compile module for a300

I've downloaded toolchain according to this thread and driver sources from ralink (2010_0709_RT2870_Linux_STA_v2.4.0.1.tar.bz2).

Question 1: There are two sigma platforms in driver's Makefile - SIGMA and SIGMA_8622. Which one should I choose (btw A300 uses SMP8647 CPU)?

Question 2: Later in Makefile they set variables LINUX_SRC and CROSS_COMPILE. What should I specify in them?
Find all posts by this user
Add Thank You Quote this message in a reply
Post Reply 


[-]
Quick Reply
Message
Type your reply to this message here.



Smilies
:) ;) :cool: :D
:P :rolleyes: :shy: :(
:lightbulb: :angry: :-/ (A)
:heart: :dodgy: :blush: :huh:
:my: :sleepy: :exclamation: :S
[get more]

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  HOWTO: Windows 7 ext2/3 support - update? Minok 6 12,160 12-25-2011 09:37 PM
Last Post: newmediawhisperer
  HOWTO: Mount NMT share on Windows Mobile mkkm 0 3,323 12-25-2010 02:53 PM
Last Post: mkkm
  Howto: Updated - Get mythtv playback nice and pretty WORKING! tivo1 1 3,656 08-29-2010 08:40 AM
Last Post: tivo1
Lightning [Script] Automatic wifi connection drop detection and reconnect mgtroyas 0 4,227 06-28-2010 11:32 PM
Last Post: mgtroyas
  HOWTO: Windows 7 ext2/3 support [USB-Slave] DeliriumNL 35 209,499 02-21-2010 12:57 AM
Last Post: maxyvan98
  HOWTO: installing telnetd &apps from USB via PC w/o internal disk java.lang 14 14,969 12-27-2009 06:39 PM
Last Post: rastin
  HOWTO: C-200 - Use a Harmony Infrared Remote smeghead 1 5,745 12-13-2009 12:48 PM
Last Post: lanthor
Information HOWTO: Linux/MacOS X automated DVD/VOB/M2TS to MKV with subs/audio tracks/chapters grok 35 56,878 12-07-2009 09:30 PM
Last Post: yonux
  [HOWTO] Replace your usb adapter by a wireless bridge Shaika-Dzari 6 11,893 10-16-2009 05:31 PM
Last Post: chris57
Thumbsup [HOWTO] Ralink RT73 wifi chipsets tiagor 13 16,568 10-14-2009 11:34 AM
Last Post: frendeze

Forum Jump: