Sunday, January 25, 2009

This is how I set up my Zepto Znote 6024W (using the Ralink RT2860 wifi card) with my D-Link DI-524 router. It is a really crappy router, and I have had lots of problems with it, but today I seem to have found a solution to my problems. It still seems to disconnect a lot, but if I dhclient it again, it usually reconnects. This is how I set it up.

I really recommend you to read the README_STA that comes with the drivers. It tells you how to configure the drivers for your setup, even if they do leave a lot to wish for. The information that I'm sharing here is a mix between that file, as well as the info that can be found in the manpages for wpa_supplicant, wpa_cli, wpa_supplicant.conf and ifup.

First we change the config for the build so the card is being controlled by wext and network manager. Open the file os/linux/config.mk and set:'HAS_WPA_SUPPLICANT=y' and "HAS_NATIVE_WPA_SUPPLICANT_SUPPORT=y'.

Save the file, we now move on to configuring the more detailed stuff. The settings for the drivers are entered into the RT2860STA.dat file in the base directory of the drivers. This is then copied to /etc/Wireless/RT2860STA/ when we compile the source and run 'make install'.Edit the settings that interests you. I don't see why we need to enter our psk (preshared key) both here and in the wpa settings (see further down), but I haven't had the guts to remove my settings. The things I changed are:

#The word of "Default" must not be removedDefaultCountryRegion=5CountryRegionABand=7CountryCode=ChannelGeography=1SSID=your_ssidNetworkType=InfraWirelessMode=9Channel=0AuthMode=WPA2EncrypType=TKIPWPAPSK=cf3e61b119de1e8bceb45edc60c5b7aa00b240c58bee8ba83cc9448761300cf3

To find the encrypted version of your password, use wpa_passphrase. The output should look something like this:root@george:# wpa_passphrase your_ssid super_duper_passwordnetwork={ ssid="your_ssid" #psk="super_duper_password" psk=cf3e61b119de1e8bceb45edc60c5b7aa00b240c58bee8ba83cc9448761300cf3}

We will do the same again later, but for setting up the wpa_supplicant. Now let's build the driver and load it into the kernel.

root@george:# make all && make install && modprobe rt2860sta

Enable, build and load the kernel modules that allows for encryption (TKIP, AES etc). If you are running Ubuntu, these will be compiled as modules already (which means that we don't have to recompile anything), otherwise enable them as modules in the kernel and compile and install them.

The file should now look something like above. We now start wpa_supplicant with the arguments that it should use the wext (generic wireless driver for Linux) driver, with our config file. It will also set up the interface as ra0. We also tell it to be verbose, so it is easier to spot errors in our configuration.

My computer keeps disconnecting, and I'm unsure about what to do about that. This does at least get the network up, so I could post this article! First I had lots of settings for the encryption in my /etc/network/interfaces file, but I moved all these to the wpa_supplicant.conf file, which should mean that we can keep a very clean interfaces file. We do need to make it run wpa_supplicant every time we want the interface up though, so we'll add that to the config. Mine now looks like: