Sci-fi, comics, humor, photos…it's all fair game.

Setting up a Wireless Network on Linux: Ralink 3062 and Network Manager

Ah, memories! These days, setting up hardware on Linux is often easier than it is in Windows. Lots of drivers are built-in and auto-detected, and many are provided through a distribution channel that makes it almost as easy.

Wireless networking, however, is a bit of a throwback to the old days. Half the hardware doesn’t have Linux drivers, and half of the devices that do require you to hunt for the driver — based on the chipset, of course, not on the name or model number on the box — and compile it yourself. (At least these days, you can sometimes run a tool to adapt the Windows drivers if there’s no native Linux option.)

The steps I actually needed to take to set up wifi on my Fedora 13 desktop probably only amounted to about 10 minutes. Unfortunately it took a lot of false starts to get there. I had installed a Zonet ZEW1642 PCI card, which my initial research suggested would be supported by the built-in rt2860 drivers. As it turned out, it wasn’t that simple.

First, what didn’t work:

Built-in drivers.

The rt2860 drivers (or any others) from RPMFusion.

Manually configuring the card with system-config-network (even after I got the right driver installed).

Key Info

lspci reports the card as:Network controller: RaLink Device 3062

It doesn’t use the rt2860 driver.

When the driver works, the card will show up as ra0 when you run ifconfig or iwconfig. If you run either of those and don’t see ra0, or if you try to configure ra0 and get a message like “unknown device,” you don’t have the right driver loaded.

When the driver works, NetworkManager will automatically recognize it. You don’t need to configure the interface first. (This tripped me up several times.)

The NetworkManager and network services conflict with each other. You have to pick one and disable the other.

Most of the information I found on this card…wasn’t actually about this card, but about related ones. What little I did find implied that it uses the same driver as the rt2860. It doesn’t. Well, not exactly. They use the same firmware, and the config file for the rt3062 is called RT2860STA.dat, which confuses the issue.

Howto

Go to Ralink’s Linux pageMediatek’s Downloads page and download the appropriate driver and firmware based on the model number.

You probably won’t need to change the Makefile or set compiler flags, but you will need to set it to work with either NetworkManager or wpa_supplicant. So edit os/linux/config.mk and set HAS_WPA_SUPPLICANT=y and HAS_NATIVE_WPA_SUPPLICANT_SUPPORT=y (for NetworkManager). If you don’t change this, it will not work. (Don’t worry about the next coulple of lines about wpa_supplicant. They don’t seem to be necessary from what I can tell.)

Build it by typing make in the main folder of the source archive.

As root, copy RT2860STA.dat to /etc/Wireless/RT2860STA/RT2860STA.dat

At this point, you can diverge from the directions a bit.

To install, switch to root and run make install in the main folder of the archive. This should copy rt3562sta.o to the appropriate location for your system.

If you haven’t been using NetworkManager, again as root, run service network stop to disable the standard network service (since it conflicts with NetworkManager).

Enable the driver: again as root, run modprobe rt3562sta

If you have NetworkManager running, it should immediately recognize the card and detect nearby networks.

Once you’ve got everything working, as root, run chkconfig --del network to permanently disable the other daemon. (But make a note of this in case you ever switch back.)

One more thing: keep this folder around! Because of the way Linux drivers work, you’ll need to re-install the drivers the next time your system updates to a new kernel. This is a pain, and is the reason I was hoping the built-in drivers or RPMFusion packages would work. More on that in the next section.

Follow-Through

Rebooting: Because I had previously removed NetworkManager from my system, I had to make sure the Gnome desktop would load the NM applet. That was fixed by going to System→Preferences→Startup Applications and enabling Network Manager.

Kernel Updates: I haven’t had to do this yet, but based on experience with other Red Hat-based systems where I’ve had to use third-party drivers, here’s how to reinstall the driver the next time Fedora sends you a kernel update.

After the new kernel is installed, but before you reboot, go back to the driver folder and run the following:

make clean

make

sudo make install (or just switch to root and run make install)

sudo modprobe rt3562sta (or stay as root and just run modprobe)

That should take care of it. If you forgot to do this first (and are reading this article on another computer), just run modprobe rt3562sta (as root) after you’re done.

Update: I originally suggested rebuilding the module before rebooting, but the Makefile automatically detects the running kernel. You can manually force it to use the source from the newer kernel, but for the sake of these directions, this way is simpler.

This 18-page thread at Fedora Forum was very informative, though it did point me in a few wrong directions.

20 thoughts on “Setting up a Wireless Network on Linux: Ralink 3062 and Network Manager”

I just want to thank you very much. I have been fighting with my new wifi GN-531I and the drivers in my kubuntu distribution long 6 evenings/nights trying almost everything I found on internet without any success until now. Your article was the last one and the one which worked for me. I am so happy. Once again thanks and thanks to all community for such a things you do. buker

Thanks for your post. I went through these steps on my own, before finding it, but in my case the driver crashes hard when I try to connect.
Were you on a 32-bit or 64-bit kernel? Mine is 64. I’m debating just sending the card back to Newegg, but if you got it to work then maybe I’ll try again.

This was on a 64-bit kernel. The process has continued to work across several kernel upgrades, so it seems to be solid, at least on Fedora.

The biggest gotchas I ran into were (a) making sure I had *exactly* the right driver (their naming conventions don’t help there) and (b) manual config and the usual network service conflicted with NetworkManager.

This a great and easy to follow article. I had previously looked over the referenced article prior to ordering my ZEW1642D this week but when it arrived today I located your post and had it setup and working in a half hour. Thank you for all help!

If you could expand on how to permanently disable the network service and some information on how to boost antenna transmit power (if possible with this card?) this would be a great one stop post.

My problem at the moment is even though I run “service network stop” checking with “service network status” indicates that it never truly does or is being started by another service or process? I’m on the lxde spin of Fedora 13 if you can help me troubleshoot the NetworkManager and network service conflicts, though I can connect to wireless networks the link quality seems to fluctuate irratically and drop off the connection at intervals, am I correct to assume these are the symptoms of the conflict you mention?

This process worked great for me with my Zonet PCI card on LinuxMint 10 x64. I just
followed the destructions and added ‘modprobe rt3562sta’ (without the tick marks)
to the /etc/rc.local file to enable the card at every boot. Many thanks, I had looked long and hard for a solution.

I was within minutes of taking my adapter back to the shop and pleading for a refund when I stumbled across your blog, after hours of fruitlessly trying different things.

After getting the adapter installed and basically working via your hackings, I did have one problem on OpenSuse 11.4, and my solution may help others.

Trying to set up NFS shares, I discovered that the adapter had not been assigned to a firewall interface, and it was not listed under devices in the firewall settings.

To fix that, I had to change back to ifup temporarily, and manually install the adapter. As part of that process, it was assigned to the external zone, and fortunately, after changing back to networkmanager, it was still listed listed there, so I could set up ports for NFS.

One question – I would actually prefer to use ifup rather than network manager for my setup, but couldn’t access the Internet after installing the adapter. Do I need different settings again in config.mk for ifup to work, or should it work with the default settings that only gave me limited control via the console?

Thank you. After many frustrating hours of trying to get this thing to work this is the only guide that worked for me. Now my card is running perfectly. You have permission to marry any of my children or father babies with my wife.

This worked for me on Opensuse 11.4 32bits. Althought I ran “make” as root (if not there was an error copying some file, because of permissions) and I did not step 5C (there is no such directory in my system).