topamax once a day

Ralink/Realtek Wireless Dongle (rt3070) on the Raspberry Pi

Realtek WiFi dongle

Realtek WiFi dongle

Scenario

You have a HAWKING HWUN3 Hi-Gain Wireless Adapter dongle that you want to use on your Raspberry Pi running debian.

Note: the same set of steps will probably work for other variations of Ralink/Realtek wifi dongles [rt2561,rt2661,rt2860,rt2870,rt3070,rt3071,rt3090].

The Problem

The standard release (debian6-19-04-2012.zip) contains the needed drivers however, the firmware needed is not included. The following tutorial will describe how to get and “install” the needed firmware.
You will notice the firmware problem if after plugging in your wifi dongle you type dmesg and it complains about not being able to find the firmware.

dmesg

usb 1-1.2: USB disconnect, device number 4
usb 1-1.2: new high speed USB device number 6 using dwc_otg
usb 1-1.2: New USB device found, idVendor=0e66, idProduct=0013
usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
usb 1-1.2: Product: 802.11 n WLAN
usb 1-1.2: Manufacturer: Ralink
usb 1-1.2: SerialNumber: 1.0
cfg80211: Calling CRDA to update world regulatory domain
usb 1-1.2: reset high speed USB device number 6 using dwc_otg
ieee80211 phy0: Selected rate control algorithm ‘minstrel_ht’
Registered led device: rt2800usb-phy0::radio
Registered led device: rt2800usb-phy0::assoc
Registered led device: rt2800usb-phy0::quality
usbcore: registered new interface driver rt2800usb
phy0 -> rt2x00lib_request_firmware: Error – Failed to request Firmware.
phy0 -> rt2x00lib_request_firmware: Error – Failed to request Firmware.
phy0 -> rt2x00lib_request_firmware: Error – Failed to request Firmware.
phy0 -> rt2x00lib_request_firmware: Error – Failed to request Firmware.

The Solution

To fix the described problem we need to make the firmware available to the system by placing it in /lib/firmware/. How do you know if the solution provided works or not? The kernel will continually complain about not being able to find the firmware. Then, when the firmware is found, the kernel will stop complaining. You can monitor the complaints with the tail command.

Execute lsusb after you have inserted the wireless usb dongle to get more information about your device.

lsusb

Bus 001 Device 006: ID 0e66:0013 Hawking Technologies HWUN3 Hi-Gain Wireless-N Adapter [Ralink RT3070]
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp.
Bus 001 Device 005: ID 413c:2003 Dell Computer Corp. Keyboard
Bus 001 Device 002: ID 0424:9512 Standard Microsystems Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Ensure that the kernel you are running has loaded the required modules.

lsmod

Module Size Used by
arc4 764 2
rt2800usb 9148 0
rt2800lib 37652 1 rt2800usb
crc_ccitt 932 1 rt2800lib
rt2x00usb 6532 1 rt2800usb
rt2x00lib 25780 3 rt2800usb,rt2800lib,rt2x00usb
mac80211 171628 3 rt2800lib,rt2x00usb,rt2x00lib
cfg80211 123084 2 rt2x00lib,mac80211
fuse 49036 1
evdev 6404 1
joydev 7576 0

Monitoring the status of the firmware fix.

tail -f /var/log/syslog
or
tail -f /var/log/messages

Acquiring and installing the firmware.

sudo apt-get install git-core
git clone http://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git
cp linux-firmware/rt2870.bin /lib/firmware/rt2870.bin

  • hcv

    No need for all of this, you can just install the firmware-ralink package in the non-free repository.

    • This method didn’t work for me, at least not with my dongle. The firmware load resulted in a kernel panic.

      • hcv

        I guess that blob in squeeze is out of date, since the one in the wheezy package is identical to the git repo. Probably worth a bug report.

  • Michal

    You should probably change the title. It is not Realtek. It is Ralink 🙂

    • Thanks for the catch Michal, from the dmesg output, it is indeed Ralink.

  • Craig

    Ralink use RA designation, RealTek uses RT.
    At least on the Ralink and Realtek wifi cards I have.

  • Craig

    It appears that at least for the dongles RT can be either Ralink or RealTek, sorry.

    • Thanks for the clarification Craig, I have updated the title accordingly!

  • Stuart

    I don’t get this, just why do you need firmware? Which device takes the actual f/w and what for!?
    Isn’t it fair to say that firmware (on the wifi card) is there already? Are we essentially talking about a f/w update to accommodate what that driver expects to ‘talk’ with?
    Thanks for any info you can give me.
    Stu

    • Many devices require a firmware to operate. Historically, firmware were built-into the device’s ROM or Flash memory, but more and more often, the firmware has to be loaded into the device by the driver during the device initialization.

  • Thanks for figuring this out. I just got my Raspberry Pi today and installed Debian. I’ve ordered an rt3070. I’m going to try your quake 3 tutorial while I wait for my dongle.

    Thanks again,
    G

  • Bill Smith

    Apologies for the novice question. Why would this happen:

    $ git clone http://git.kernel.org/?p=linux/kernel/git/firmware/linux-firmware.git
    Cloning into ‘linux-firmware’…
    fatal: http://git.kernel.org/?p=linux/kernel/git/firmware/linux-firmware.git/info/refs not found: did you run git update-server-info on the server?

  • Siraaj

    says git not recognised as a command; bash: git: command not found <- this is on debian.

    • meyers

      Siraaj, run the below command ad then try again.
      sudo apt-get install git-core

  • How do you then configure the card to access your router – I have no graphic interface loaded and will to set my network address and access point from the command line

    • An easy way to do this without a GUI is with wicd, a network configuration manager with a command line (curses) interface. Install it like this:
      sudo apt-get install wicd-curses
      And run it like this:
      wicd-curses

  • I think installing firmware by apt-get install firmware-ralink is possible. It worked for me. But my wifi dongle was self made. I’ve got it from a wm8650 netbook.

    • civer

      hola madanadam yo tengo una tablet que tiene el chip wm8650 me podrias ayudar hacer funcionar el chip rt3070 gracias

  • Jesse

    Doing a search on Amazon for this type of dongle seems to give me a bunch of options, but none of them see exactly right. Would you mind please letting me know which of these would be the one that would work with your instructions? I really would appreciate it 🙂 http://www.amazon.com/s/ref=nb_sb_noss/184-8604379-0650912?url=search-alias%3Daps&field-keywords=Ralink+Wireless+Dongle+rt3070

  • Pingback: Adding wireless to the Raspberry Pi - Hack a Day()

  • thinks_a_lot

    hi, will this work on my android tablet?

    i’m trying to install two wifi adaptors, connect one to the local network, and create a hotspot so i can extend the network.

    regards, Sorna

    • thinks_a_lot

      i have the Ralink RT3x7x wifi adaptor. I tried copying the bin file to the library folder.

      nothing worked so far.

  • Fernando Lourenco

    Thanks! Worked great!

  • civer

    hola muy buenas soy poseedor de una tablet con chip wm 8650 me podriais ayudarme a conseguir hacer funcionar mi tarjeta usb wifi rt3070 gracias

  • Hi,

    I have the same problem, but what ever I try, using you method, which gets me the firmware, or using to install from the non-free, the shitty thing just won’t run under pwnpi. I have to admit, I am a total beginner with pi and linux, but I followed lots of tutorials around here.

    Do I have do blacklist? Upon startup the its say that there are 2 errors with the device and iwconfig tells me for lo and eth0 there is no wireless extension.

  • sushant

    Please tell me how to install
    please check this error:

    http://www.friendlyarm.net/forum/topic/5934

  • Omid

    Thanks man , It solved my probelm ,
    Really apperciate