Woo Hoo!–wireless networking working under slackware linux 12.0

Woo Hoo!

I am posting this from my new Toshiba Satellite A205 Laptop.

It has Dual 32 bit Pentium T2330 CPU’s at 1.6 Ghz and 1014 MB Ram.

I got it off the bargain rack at best buy for less than $500.00 (:

It came pre-installed with Windoze Vista–opitmized by the Geek Squad, no less–and still ran slower than most computers that I have used since my first 486 back in the day.

Well, I wiped the hard drive, created a Windows and Linux partition and now dual boot Vista and Slackware Linux 12.0.

My slackware partition runs blazingly fast with all the ram and the linux kernel.

I had heard that wireless networking was a chore under Linux (I have never wirless networked before) so I have been poking about reading this and that trying to get it to work.

Well, I have! (:

Here is the process I will post it at slackware’s forum, but I want to post here first.

Overview of process.

  1. get the driver working
    • I used the rtl8187b-modified-dist driver
      from cuervo
    • From my reading, I gleaned that a native windows driver for the card, and ndiswrapper could be another option, but I did not go that route, since the linux “native” driver seems to work fine
  2. 2. get the datalink part working with..
    • the Linux Wireless Extensions
      • iwconfig
      • iwevent
      • iwgetid
      • iwlist
      • iwpriv
      • iwspy
    • wpa_supplicant tools
      • /etc/wpa_supplicant.conf
      • wpa_supplicant
      • wpa_gui
  3. 3. use dhcpcd (dhcp client daemon) to get an ip address attached to the card
  4. post on Blogger, baby (:

Here is a bit of detail for each of the steps above….

1. get the driver working.

Download the driver and compile it via the instructions.The install script did not work for me, but on examining it, I saw it just copied all the *.ko files to the /lib/modules/ directory.
I forget where I read it, but I read somewhere that you “should” put the modules in the
/lib/modules/ directory.
Well, examining that, I saw some sub-directories, so I created a realtek subdirectory and rebooted.

Then I did a lsmod and saw my drivers–here are the relevant bits…

root@howard:# lsmod
Module Size Used by
ieee80211_rtl 63748 1 r8187
ieee80211_crypt_rtl 8324 1 ieee80211_rtl

a lsusb shows…

Bus 6 Device 1: ID 0000:0000
Bus 7 Device 1: ID 0000:0000
Bus 1 Device 1: ID 0000:0000
Bus 2 Device 3: ID 0bda:8197 Realtek Semiconductor Corp.
Bus 2 Device 2: ID 0781:5406 SanDisk Corp.
Bus 2 Device 1: ID 0000:0000
Bus 5 Device 1: ID 0000:0000
Bus 4 Device 1: ID 0000:0000
Bus 3 Device 1: ID 0000:0000

so my device is seen by the kernel

2. get the datalink part working with…

  • the Linux Wireless Extensions
    • iwconfig
    • iwevent
    • iwgetid
    • iwlist
    • iwpriv
    • iwspy

The wirelesss tools are part of the Slackware 12.0 distribution. I believe they are what the wpa_supplicant uses to do its magic.
iwconfig is analagous to ifconfig. Just type iwconfig as root to see your wireless lan. If you can’t see it with this, then you have a driver or module issue.
Here is my output from iwconfig

wlan0 802.11b/g linked ESSID:"903 Mills Market"
Mode:Managed Channel=6 Access Point: 00:12:17:3C:5A:E3
Bit Rate=11 Mb/s
Retry:on Fragment thr:off
Encryption key:off
Link Quality:0 Signal level:0 Noise level:0
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:0 Invalid misc:0 Missed beacon:0

I found iwlist usefull as well. It takes several options for doing various things. It’s output kept me thinking I could get this thing working, and helped me develop my current ideas about how wireless works under linux.
Here is the output from iwlist wlan0 scanning

bash-3.1# iwlist wlan0 scanning
wlan0 Scan completed :
Cell 01 - Address: 00:18:F8:4E:86:C9
Protocol:IEEE 802.11bg
Encryption key:on
Bit Rates:54 Mb/s
Extra: Rates (Mb/s): 1 2 5.5 6 9 11 12 18 24 36 48 54
Quality:13 Signal level:0 Noise level:102
Extra: Last beacon: 366ms ago
Cell 02 - Address: 00:12:17:3C:5A:E3
ESSID:"903 Mills Market"
Protocol:IEEE 802.11b
Encryption key:off
Bit Rates:11 Mb/s
Extra: Rates (Mb/s): 1 2 5.5 11
Quality:13 Signal level:0 Noise level:73
Extra: Last beacon: 351ms ago
Cell 03 - Address: 00:40:96:3A:6C:34
Protocol:IEEE 802.11b
Encryption key:on
Bit Rates:11 Mb/s
Extra: Rates (Mb/s): 1 2 5.5 11
Quality:13 Signal level:0 Noise level:27
Extra: Last beacon: 461ms ago

At this point, I could see that my card could see the network. What I couldn’t figure out, was how to select a network. That’s where the next tool comes in….

  • wpa_supplicant tools
    • /etc/wpa_supplicant.conf
    • wpa_supplicant
    • wpa_gui

wpa_supplicant seems to be a means of tying the card to the network. A VERY IMPORTANT DISTINCTION is that it does NOT tie the computer to the network–you need dhcpcd for that; rather, it sets up what I believe is called the data-link layer between the card and the network.

wpa_supplicant uses a config file :/etc/wpa_supplicant.conf (imagine that (:). I only have mine configured to talk to non-encrypted networks where I don’t need to log in. (I will post on how to do that after I accomplish it).

The contents of my wpa_supplican.conf file are:

bash-3.1# cat /etc/wpa_supplicant.conf
# Plaintext (no encryption) network


ssid="example open network"

There are other examples in /usr/doc/wpa_supplicant-0.5.7/examples. My example is straigh from there.

There are several ways to invoke wpa_supplicant, but I am currently using wpa_supplicant -Dwext -i wlan0 -dd -c /etc/wpa_supplicant.conf . This ties the wpa_supplicant to the wireless extensions listed above (there are othe tools available that can talk to wpa_supplican: ndiswrapper, for example) and to my wireless card on wlan0. It is running in double verbose debugging mode (I like to see output from programs in a shell, so I can learn from them) and uses the wpa_supplicant.conf file.

Running this, shows a lot of stuff running by the screen, and trying to run firefox or lynx, results in network not found errors. That lead to the next tool: wpa_gui.

wpa_gui enables you to select your network. As root, run wpa_gui then click the [scan] button. A separate window appears with a list of networks. Double click on the one you want. A new window appears showing the details of the network. Click the [add] button and the network appears in the first window as “connected”.

Woo Hoo!

But wait! Now you open firefox, and nothing happens! WTF!

Tat brings us to dhcpcd.

dhcpcd is a program that aquires an i.p address for an interface. To get this, just run dhcpcd wlan0.

And that, all my fans, is the last piece of the puzzle.

I am happily composing this in Emacs at a very nice public market, sipping diet coke and digesting a lox and cream cheese bagle.

I am…


next up: getting better video under X11.


Posted on April 30, 2008, in programattical, surferdudeable. Bookmark the permalink. 2 Comments.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: