1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Ralink rt2870 wifi support?

Discussion in 'Peripheral Hardware' started by tim-m89, Sep 14, 2009.

  1. tim-m89

    tim-m89 New Member

    Messages:
    123
    Thanks Received:
    0
    Original question:

    Does FreeBSD support RaLink rt2870. My exact wifi is this if that makes any difference?

    Update:

    Summary of this thread:
    egorenar has been developing an rt2860 and a rt2870 driver for both FreeBSD 7.2 and 8.0.
    He is hosting them here.
    Download the latest tarball that is correct for both your chipset and your FreeBSD version. Then:
    Code:
    tar xvzf driver.tar.gz
    cd driver
    make

    As root or prepending with sudo the usual commands for driver loading kldstat, kldload, kldunload can be used or, if you prefer, you may want them to load automatically at boot time:
    Code:
    cp rt2870.ko /boot/modules/
    chmod 555 /boot/modules/rt2870.ko

    And add a line to /boot/loader.conf:
    Code:
    rt2870_load="YES"

    Loading rt2860.ko/rt2870.ko will create the hardware interface rt28600/rt28700 respectively but since version 8 of FreeBSD, these are not controlled directly for the usual settings but with a virtual interface that must created either manually like:
    Code:
    ifconfig wlan0 create wlandev rt28700

    Or automatically via /etc/rc.conf. Snippet of my rc.conf for a wpa network (must have a wpa_supplicant.conf file in /etc/):
    Code:
    wlans_rt28700="wlan0"
    ifconfig_wlan0="WPA inet 192.168.2.110 netmask 255.255.255.0 country NZ"
    defaultrouter="192.168.2.1"


    During the development a slight bug in FreeBSD wifi was found. If your Access point sends ADDBA requests you may need this to get 802.11n working. You will need kernel source to patch it. Follow the usual guide for rebuilding the kernel.

    If you use FreeBSD 7.2 with 802.11N then you may also want this patch. This patch is not required for FreeBSD 8.0 though unlike the above patch.

    I have been successfully using this rt2870 driver for a 802.11n connection with WPA2-AES security for a while now and others have reported great success with both rt2860 and rt2870 in 802.11N mode.

    If you can correctly use FreeBSD's wifi then any feedback specific to this driver is a great help for it's ongoing development. Posts to this thread may become very helpful to other users (if they are experiencing the same problems for example).

    A big thank you to egorenar for all his efforts. :beer.

    Update:

    If anyone is interested in why he dropped development of this. He has been very busy. It turn's out that he is also the legendary graf_chokolo. He has made some important developments in getting ps3's to run homebrew. Homebrew doesn't necessarily mean piracy but sony have their lawyers all over his ass anyway. He has been struggling with legal bills and could really do with some help.

    Meanwhile development for the run driver will likely be supported long term. It is from another developer but supports as similar set of hardware and is include within the latest freebsd source tree.
     
  2. egorenar

    egorenar New Member

    Messages:
    199
    Thanks Received:
    20
    I'm currently developing a driver for this chip for FreeBSD 7.2.
    Monitor mode is already working with wireshark :)
    I will implement transmitting later.
     
  3. aragon

    aragon New Member

    Messages:
    2,031
    Thanks Received:
    252
    It seems [thread=7562]more than one person[/thread] is working on getting this into FreeBSD.
     
  4. NAC

    NAC New Member

    Messages:
    34
    Thanks Received:
    1
    I am looking for it as well. I can't wait to get it worked. :)
     
  5. egorenar

    egorenar New Member

    Messages:
    199
    Thanks Received:
    20
    i also plan to implement rt2860 driver later.
     
  6. egorenar

    egorenar New Member

    Messages:
    199
    Thanks Received:
    20
    :) WEP is working now !!!
     
  7. tim-m89

    tim-m89 New Member

    Messages:
    123
    Thanks Received:
    0
    This one wireless networking device is the reason freebsd is not a suitable option for my desktop so I am very interested in this. What is he status of 802.11N and WPA2-AES?
     
  8. egorenar

    egorenar New Member

    Messages:
    199
    Thanks Received:
    20
    802.11n does not work yet, but i'm working on it, stay tuned.
    Currently i'm working on WPA and WPA2-AES.
     
    chalbersma thanks for this.
  9. egorenar

    egorenar New Member

    Messages:
    199
    Thanks Received:
    20
    WPA2 is working !!!
    TKIP is still not working. :-(
    Stay tuned, guys.
     
  10. egorenar

    egorenar New Member

    Messages:
    199
    Thanks Received:
    20
    TKIP is working now also !!!
     
  11. tim-m89

    tim-m89 New Member

    Messages:
    123
    Thanks Received:
    0
    Could you please provide instructions on how I can go about testing this out? Thanks a lot for all you time + effort developing this.
     
  12. egorenar

    egorenar New Member

    Messages:
    199
    Thanks Received:
    20
    I developed and tested my driver only on FreeBSD 7.2 and only with Linksys WUSB600N. What NIC do you have ?
     
  13. tim-m89

    tim-m89 New Member

    Messages:
    123
    Thanks Received:
    0
    this
     
  14. egorenar

    egorenar New Member

    Messages:
    199
    Thanks Received:
    20
    OK, i extended my driver so it supports now also D-Link DWA-140 which also has rt2870 chip.

    I attached my driver for rt2870. The driver is a kernel loadable module (KLM). Extract it and you will see the directory rt2870_fbsd72. Change into it and enter the command "make"
    (Have you installed FreeBSD kernel source ? If not then you should do it).
    Now you should see the KLD rt2870.ko if everything went right.
    Load it with "kldload ./rt2870.ko" (run it as root !!!). Now insert your USB NIC into your system.

    If you enter "ifconfig" now then you should see the interface "rt28700".

    To associate with your wireless network:
    Code:
    1. ifconfig rt28700 channel <your channel> ssid <your ssid> up
    2. wpa_supplicant -dd -i rt28700 -c <path to your wpa_supplicant.conf>


    The above shell commands should be run as root !!!

    After you was associated with your WLAN you have to run dhclient
    in order to obtain an IP from DHCP server or assign a static IP.
    The routing table must be adjusted also. Or you can edit /etc/rc.conf and restart your network script with "/etc/rc.d/netif restart".

    I think you know what wpa_supplicant is or should I provide an example also ?

    WEP, TKIP and AES worked with Linksys WUSB600N and this driver.
    And i could surf and download. 802.11n is not implemented yet.

    Please post your feedback here because i tested my driver only with Linksys WUSB600N and i have no possibility to test it with other NICs.
     

    Attached Files:

    NAC thanks for this.
  15. tim-m89

    tim-m89 New Member

    Messages:
    123
    Thanks Received:
    0
    OK thanks. I will try this from a live freebsd disc when I get the time.
     
  16. NAC

    NAC New Member

    Messages:
    34
    Thanks Received:
    1
    WOW! you r the man! :e

    thanks a lot for your efficient! i have just tried ,it worked once..i am using wpa. the problem is that after it was associated, once i run /etc/rc.d/netif restart. the driver stops!
     
  17. egorenar

    egorenar New Member

    Messages:
    199
    Thanks Received:
    20
    Ye, i know. I just reload the driver after i started netif script in that case and then it works.
    I guess, the KLM should be loaded automatically at boot time
    to avoid this problem.
     
  18. egorenar

    egorenar New Member

    Messages:
    199
    Thanks Received:
    20
    What NIC do you have ?
     
  19. NAC

    NAC New Member

    Messages:
    34
    Thanks Received:
    1
  20. egorenar

    egorenar New Member

    Messages:
    199
    Thanks Received:
    20
  21. NAC

    NAC New Member

    Messages:
    34
    Thanks Received:
    1
    NO, once i try to give it an IP, the driver alway stops, and somehow i can ping to my router, but cannot get internet.
     
  22. egorenar

    egorenar New Member

    Messages:
    199
    Thanks Received:
    20
    Did you add this to your rc.conf:

    Code:
    ifconfig_rt28700="DHCP WPA"
     
  23. NAC

    NAC New Member

    Messages:
    34
    Thanks Received:
    1
    Hm.. no, i use this ifconfig_rt28700="inet 10.1.1.90 netmask 255.255.255.0"

    i gonna try "DHCP WPA" later. thanks :)
     
  24. egorenar

    egorenar New Member

    Messages:
    199
    Thanks Received:
    20
    How to configure rt2870 driver:

    1. Load KLM rt2870.ko

    Code:
    # kldload ./rt2870.ko


    2a. Dynamic IP

    Edit rc.conf (Don't forget to remove all other ifconfigs from rc.conf)

    Code:
    ifconfig_rt28700="WPA DHCP"


    2b. Static IP

    Edit rc.conf

    Code:
    ifconfig_rt28700="WPA inet 10.1.1.90 netmask 255.255.255.0"
    defaultrouter="<ip address of your router>"
    


    Add default route:

    Code:
    # route add default <ip address of your router>


    Add DNS nameserver to /etc/resolv.conf:

    Code:
    nameserver <ip address of your router>


    3. Restart netif

    Code:
    # /etc/rc.d/netif restart


    4. Wait some time till your NIC associates and gets an IP.


    It worked for me if i followed the steps above
    (I'm writing this text and surfing with rt2870 driver :e).

    Have fun.
     
    NAC thanks for this.
  25. NAC

    NAC New Member

    Messages:
    34
    Thanks Received:
    1
    thanks for your steps.everything works well, but once i run
    Code:
    # /etc/rc.d/netif restart

    i would get
    Code:
    Stopping network:wpa_supplicant not running? (check /var/run/wpa_supplicant/rt28700.pid).
    
    rt28700: no link ...... got link
    DHCPREQUEST on rt28700 to 255.255.255.255 port 67
    DHCPREQUEST on rt28700 to 255.255.255.255 port 67
    DHCPACK from 10.1.1.1
    bound to 10.1.1.4 -- renewal in 1800 seconds.
    


    it seems something wrong at here I am trying to sort it out, it is a bit different with my Gentoo wpa_supplicant, i have checked my folder, there is no file called: /var/run/wpa_supplicant/rt28700.pid