Ubuntu 9.04 wlan support for RT3090

tisoft_media
Posts: 16
Joined: Sun Apr 19, 2009 8:40 am

Ubuntu 9.04 wlan support for RT3090

Post by tisoft_media »

Hi,

I just received my Fit-PC2 with the RT3090 wireless card.

I have installed Ubuntu 9.04, but my wireless is not working. It seems there is no driver support for the RT3090 card.

I have then installed the driver from the ralink site, which installs and loads fine, but doesn't work either.

Is there any way to activate wireless on this thing?

Regards,
Markus

Timon_and_Pumba
Posts: 26
Joined: Wed May 27, 2009 5:59 pm

Re: Ubuntu 9.04 wlan support for RT3090

Post by Timon_and_Pumba »

Guess it does not help much, but the driver shipped with the custom fit-pc linux image (ubuntu 8.04 hardy) does work.

Code: Select all

$ modinfo rt3090sta
filename:       /lib/modules/2.6.24.7-v1-fitpc2/kernel/drivers/net/wireless/rt3090sta.ko
version:        2.0.1.0
license:        GPL
srcversion:     E1B4C8D990E2E9747143550
alias:          pci:v00001A3Bd00001059sv*sd*bc*sc*i*
alias:          pci:v00001814d00003092sv*sd*bc*sc*i*
alias:          pci:v00001814d00003091sv*sd*bc*sc*i*
alias:          pci:v00001814d00003090sv*sd*bc*sc*i*
alias:          pci:v00001814d00000781sv*sd*bc*sc*i*
alias:          pci:v00001814d00000701sv*sd*bc*sc*i*
alias:          pci:v00001814d00000681sv*sd*bc*sc*i*
alias:          pci:v00001814d00000601sv*sd*bc*sc*i*
depends:        
vermagic:       2.6.24.7-v1-fitpc2 preempt mod_unload 586 4KSTACKS 
parm:           mac:rt28xx: wireless mac addr (charp)

tisoft_media
Posts: 16
Joined: Sun Apr 19, 2009 8:40 am

Re: Ubuntu 9.04 wlan support for RT3090

Post by tisoft_media »

Does it work with the NetworkManager, too? Or do you have to configure it in /etc/network/interfaces?

Timon_and_Pumba
Posts: 26
Joined: Wed May 27, 2009 5:59 pm

Re: Ubuntu 9.04 wlan support for RT3090

Post by Timon_and_Pumba »

The first, NetworkManager works fine.

SaWey
Posts: 2
Joined: Sat Jun 20, 2009 10:31 am

Re: Ubuntu 9.04 wlan support for RT3090

Post by SaWey »

Kind of off topic:

Does everything else work on 9.04 besides the wlan? As this versions is said to be more efficient with ssd's.

Thanks

prj
Posts: 90
Joined: Tue May 12, 2009 9:13 am

Re: Ubuntu 9.04 wlan support for RT3090

Post by prj »

SaWey: There's no gfx driver so you must use VESA (very slow). There are ACPI (or IO-APIC) related issues so you must change some BIOS settings to make it stable. Rebooting doesn't work either, you must roll your own kernel for that.

tisoft_media: Could you give more details on why the driver from the ralink website doesn't work. Could you pastebin the dmesg output?

I took a quick look at the source from ralink and it looks like there is AP mode support in there. Would be nice to get that working.

Timon_and_Pumba
Posts: 26
Joined: Wed May 27, 2009 5:59 pm

Re: Ubuntu 9.04 wlan support for RT3090

Post by Timon_and_Pumba »

I had checked the Ralink website previously, but I just discovered that they have released an initial Linux driver for the RT3090 chip:
http://www.ralinktech.com/ralink/Home/S ... Linux.html

I have not tried to build it yet, but browsing through the archive, it seems to me that some more work on the driver needs to be done, as it references a lot to an older driver; so they used a lot of copy'n'paste...

madgrt
Posts: 33
Joined: Sat Jun 13, 2009 8:30 am

Re: Ubuntu 9.04 wlan support for RT3090

Post by madgrt »

prj wrote: I took a quick look at the source from ralink and it looks like there is AP mode support in there. Would be nice to get that working.
As the info is so rare and so it doesn't get lost, I'll post here. Maybe print yourself a hard copy for when you are stuck at home on a rainy weekend. ;)

See this link:
http://www.geocities.com/gtalon51/Artic ... Linux.html

Below is for archive purposes.
Creating a Wireless Soft Access Point using Linux

So what do you do if you want a wireless-N access point and possibly router but don’t want to pay for it? If you have a bit of experience using Linux and some time to spare you might find this quite useful.

Before you start, you'll want to make sure you have the following:

* A spare machine or VM to install Fedora (I used version 8) and build everything
* A Ralink RT2860T chipset based wireless card. One such card is this.
* A spare machine with your RaLink based card, a normal wired card for your LAN and another network card if needed for WAN.
* These scripts.

Basically what this article will describe is how to modify the popular IPCop Linux distribution so that it can act as a bridge between your wired and wireless networks essentially performing the duty of a wireless access point. It can also be made to act as a router with very little effort as this is actually what IPCop is designed for.

Doing this will involve editing a number of configuration files, executing a whole load of commands and finally generating an ISO image which can be burnt and installed on a machine of your choice.

This article is divided into the following sections

1. Building IPCop Unmodified
2. A Software Switch
* 2.1 Kernel bridge support
* 2.2 Force a module dependency check on boot
* 2.3 Install bridge-utils
3. Driving your Wireless Network Card
* 3.1 Building
* 3.2 Configuring
4. Build the final image
5. Comments
6. Troubleshooting
7. Contact

1. Building IPCop Unmodified

The first thing we need to do is build IPCop unmodified to get all the directories created and source unpacked. We can then make our changes, configure and rebuild (for more information on any of these build steps please refer to the current and stable IPCop v1.4.x guide or Google for "ipcop build howto").

1. Download the IPCop sources. In this case I downloaded "ipcop-1.4.21-sources.tgz".
2. Extract the sources using the command "tar –xvzf FILENAME" which will give you a build directory.
3. You now need to download all the packages necessary to build a final IPCop iso image. The build script can be told to do this using one of two methods. You can either download one package with everything you need from sourceforge (recommended as it’s faster) or you can tell it to go and get each part from different sites. To do it the recommend way, from the build directory run "./make.sh getothersrc". To use separate sites run "./make.sh prefetch".
4. To use these sources they need to be built using a toolchain (http://en.wikipedia.org/wiki/Toolchain) that IPCop provides so that everything is built with the correct libraries. You can either download the sources and then build it or you can get a precompiled version which is much faster. To get the prebuilt version you should run "./make.sh gettoolchain". If you want to build the toolchain yourself (e.g. if you wanted to build IPCop for something other than a x86, alpha or powerpc) you don’t need to do anything as all this code will automatically be retrieved for you.
5. Once that’s done you’re good to go, just run "su root" and then "./make build". At this point you’ll probably want to go and get some coffee or something as the whole build process takes some time.

2. A Software Switch

The first change to be made is to make your machine act as a network bridge. This basically means you will end up with a switch in software that will connect your wireless network to your wired.
2.1 Kernel bridge support

At the core of the operating system we need to enable bridge support so that the bridge-utils configuration package can be used.

1. Modify either ipcop/config/kernel/kernel.config.i386 or kernel.config.i386.smp (depending on if you have multiple CPUS/cores) and do a search for "BRIDGE" then change that line so it reads "CONFIG_BRIDGE=y".
2. Remove from the log directory either linux-2.4.36.6-ipcop for a single CPU target or linux-2.4.36.6-ipcop-smp and linux-2.4.36.6-ipcop for an SMP target. This will force IPCop to rebuild the kernel when we next issue the make command

2.2 Force a module dependency check on boot

This step ensures that required kernel modules/drivers are always loaded on boot.

1. Edit make.sh and comment out or remove the line "rm –f $LFD/var/run/{need-depmod-$KVER, need-depmod-$KVER-smp}" (line 773).
2. Edit IPCOP_ROOT_DIR/src/ROOTFILES.i386 and add var/run/need-depmod-2.4.36 and var/run/need-depmod-2.4.36-smp under the var/run/utmp entry

2.3 Install bridge-utils

1. Copy the included "bridge-utils" from the IPCop folder to Ipcop/lfs. This is a little helper script that knows the details of how to download and build the package.
2. To ensure the built binaries are included in the final image, edit /IPCOP_ROOT_DIR/src/ROOTFILES.i386 and add the following at the end:

##
## bridge-utils-1.0.6
##
usr/local/sbin/brctl
usr/local/lib/libbridge.a

3. Open make.sh in the root of your IPCop build directory, search for stage3 and then add "ipcopmake bridge-utils" to the end of it so you have something that looks like:

ipcopmake wireless
ipcopmake libsafe
if [ 'i386' = $MACHINE -o 'alpha' = $MACHINE ]; then
ipcopmake 3c5x9setup
fi
ipcopmake bridge-utils

This will causes the build system to invoke the helper script that was copied above.

That concludes the bridge configuration but at the moment it’s of little use unless we have two networks to connect.
3. Driving your Wireless Network Card

It’s now time to get the driver source code, build it and ensure it gets included in the final image and loaded at boot time.

Although these instructions apply to the Ralink RT2860T chipset, the general concepts should apply to most network drivers so if you have a different card that you know is supported you may still get something out of this section.

There are at least 2 Linux drivers for the RT2860T chipset. One of these is probably available from the network card manufacturers website which is most likely not the one you want, the other is the softAP driver (8031N.rar) which can be downloaded from here
3.1 Building

1. Make a directory somewhere in your IPCOP_ROOT_DIR/Build directory and then extract the linux/2007_0801_RT2860_Linux_SoftAP_Drv1.5.0.0.tgz. In this case I am using IPCOP_ROOT_DIR/build/home/develop
2. Extract the driver source (tgz file) using: Tar –xvf FILENAME
3. Change to the newly extracted directory/Module and then overwrite that makefile with the one included in the ralink_driver folder. For those interested, I have explained the exact changes required below.

The first change made was to ensure the driver knows where the kernel sources are located. If you look at line 38 you can see this is where it is set for either a 2.6 or 2.4 kernel. As IPCop uses the 2.4 kernel the line under Linux 2.6 was commented out using a # and then the line under 2.4 was set to equal the full path to the sources which ended up looking like the following:

ifeq ($(PLATFORM),PC)
# Linux 2.6
#LINUX_SRC = /lib/modules/$(shell uname -r)/build
# Linux 2.4 Change to your local setting
LINUX_SRC = /usr/src/linux-2.4.36
CROSS_COMPILE =
endif

(LINUX_SRC must say linux-2.4.36 rather than just using the standard Linux symbolic link (generally seen as /usr/src/linux) as the version number in the path is used later to determine which makefile to use to build other parts of the code).

The last change made was to ensure the driver binary is gzipped and then copied to /lib/modules so that when the IPCop ISO is built, the driver will be included. These changes were made by adding the following lines (starting at line 80)

gzip -f $(RT2860_DIR)/os/linux/rt2860ap.o
cp -f $(RT2860_DIR)/os/linux/rt2860ap.o.gz /lib/modules/2.4.36/kernel/drivers/net/wireless
cp -f $(RT2860_DIR)/os/linux/rt2860ap.o.gz /lib/modules/2.4.36-smp/kernel/drivers/net/wireless

You can now build the driver by doing the following:

1. Change to the root of your IPCop build directory
2. Change to root using "su root"
3. Get a shell within the IPCop build environment using "./make.sh shell" (this provides a chrooted (http://en.wikipedia.org/wiki/Chroot) environment and is needed so that the correct tool chain is used).
4. Change to the directory where the drivers Makefile is stored, in this example it would be something like /home/develop/EXTRACTED FILE NAME/Module
5. Type "make" which will then build the driver and copy it to the correct location.

3.2 Configuring

You now need to setup the driver configuration file to specify the access point name, encryption type, password etc. This is done by editing the RT2860AP.dat file which is located in the same directory as the Makefile. Note: this file must be edited in binary mode which can be done by running the command "vi –b RT2860AP.dat". If you haven’t use vi before then you’ll definitely want to Google a beginners tutorial on it before you make the change.

Although there are a lot of options that can be set, you are probably only going to be interested in the few listed below (I am not a wireless expert, this is merely a list of those values which I believe are important):

* SSID1 – Set this to the name you want your access point to have.
* HideSSID – You may want to set this although see here for why you shouldn’t
* WirelessMode – You may want to change this for example if you want to support old 802.11b devices. The valid values are:
0 = PHY_11BG_MIXED
1 = PHY_11B
2 = PHY_11A
3 = PHY_11ABG_MIXED
4 = PHY_11G
5 = PHY_11ABGN_MIXED
6 = PHY_11N
7 = PHY_11GN_MIXED
8 = PHY_11AN_MIXED
9 = PHY_11BGN_MIXED
10 =PHY_11AGN_MIXED //this can't be set in the config file only by using iwpriv
* AuthMode – This can have the following values: WEPAUTO, OPEN, SHARED, WPA2PSK, WPA2, WPA1WPA2, WPAPSKWPA2PSK, WPAPSK, WPA. If no value or an invalid value is specified the default is OPEN. I recommend WPA2PSK.
* EncrypType – This can have the following values: NONE, WEP, TKIPAES, TKIP, AES. The default is NONE. I recommend AES as TKIP has known security issues.
* WPAPSK1 – Password for your encryption

For the interested reader

More information on all these values can be found by looking at the help files that come with the standard Linux drivers available from the ralink website or you can look at the soft AP source code.

These values can be changed using the RT2860AP.dat configuration file or using the iwpriv command.

Source code:
If you look at the function "RTMPReadParametersHook" in Module/os/Linux/rt_profile.c at line 1062 you can see at line 1682 where the Encryption type is set, if you scroll down a bit you can then see all the available values.

iwpriv:
This can be used to set private options on the adapter as long as the adapter is up and running (i.e. after doing ifconfig ra0 up if isn’t already up) example:
iwpriv ra0 set WirelessMode=10

Once you’ve set these values to your taste you the need to ensure the config file is included in the final image by doing the following:

1. Create a directory in /etc of your IPCop build environment. Presuming you haven’t quit out of it you can use the following command "mkdir –p /etc/Wireless/RT2860AP".
2. Copy the config file to that directory by doing "cp RT2860AP.dat /etc/Wireless/RT2860AP".
3. Copy the included rc.bridgescript into /etc/rc.d and use the command "chmod 755 rc.bridgescript" to set the appropriate permissions. This startup script will load the wireless card driver, set the IP address, create the bridge and apply a firewall rule to allow traffic to flow over the bridge.
4. Ensure these files are included in the IPCop final image by editing the IPCOP_ROOT_DIR/src/ROOTFILES.i386 and adding an entry for etc/Wireless/RT2860AP/ RT2860AP.dat at the end and add "etc/rc.d/rc.bridgescript" under "etc/rc.d/rc.network". Note: this is a bit of a hack but it’s a lot quicker than trying to add the driver into the main IPCop build process.
5. Exit the IPCop shell by entering "exit" or pressing CTRL-D.

4. Build the Final Image

From the IPCop root directory execute "./make.sh build" to create the ISO ready for burning and installing.

Ensure on the first boot that you have a non USB keyboard attached and reboot once you have reached the command prompt. Also make sure you have correctly set the time in the BIOS otherwise you may encounter issues accessing the system remotely.
5. Comments

The one issue with this setup is that the configuration software that comes with IPCop doesn’t recognise the wireless card due to its name i.e. its called raNUMBER whereas IPCop expects all network cards to be named ethNUMBER. This can actually be modified in the wireless driver if you look at the "alloc_netdev" function or you can use the nameif command. The latter is probably not included with IPCop so you’ll have to build it using the IPCop shell. You also run the risk that doing either will break things so be warned!

As everything seems to work well without doing this it’s probably best to just setup IPCop as though the wireless card did not exist. It will then use the same IP address as the green device as you can see from the rc.bridgescript located in etc/rc.d.

If I’ve missed any steps or you find any of the commands confusing etc please drop me a mail and I’ll try to help you out the best I can. Otherwise, enjoy!
6. Troubleshooting

Q: The driver segfaults on bringing it up with ifconfig
A: This is most likely due to a bad combination of hardware and you will need to swap parts out to see what is causing it.

rasseren
Posts: 3
Joined: Wed Apr 08, 2009 7:07 pm

Re: Ubuntu 9.04 wlan support for RT3090

Post by rasseren »

Progress... I am able to see access points in Network Manager, but not able to connect - it will not accept my wpa psk key.

Configuration: xubuntu 9.04.
What i did:
Downloaded rt3090PCIe from http://www.ralinktech.com/ralink/Home/S ... Linux.html
Extracted it.
Installed build-essential
sudo make (yes, sudo is needed to make)
sudo make install
sudo ln -s /etc/Wireless/RT3090STA /etc/Wireless/RT2860STA
reboot

Any ideas on how to actually connect?

madgrt
Posts: 33
Joined: Sat Jun 13, 2009 8:30 am

Re: Ubuntu 9.04 wlan support for RT3090

Post by madgrt »

rasseren wrote:Progress... I am able to see access points in Network Manager, but not able to connect - it will not accept my wpa psk key.

Any ideas on how to actually connect?
First things first, can you at least connect to the AP / router without any security / encryption ?

Post Reply

Return to “Ubuntu 9.04”