สาระดีๆ มีให้อ่านทุกวัน

WIRELESS CARD HOWTO: ANY DISTRIBUTION OF LINUX

Sections:

1. Pre-requisites
2. Installing “build-essential”
3. Installing NDISwrapper from source
4. Installing your wireless driver
5. Activating your wireless card via terminal
6. Credits
7. Other methods

1. Pre-requisites

1) Working internet connection or method on getting new packages onto your computer (e.g. second computer & thumb-drive). I STRONGLY suggest you try to get a LAN or dial-up connection as it gets tedious without one.

2) The package “build-essential”. I will explain how to get this in the tutorial if you do not already have it.

3) Make sure the wireless driver you have is made for your architecture. 32 bit drivers do NOT work on 64 bit systems and vice versa!

2. Installing “build-essential”
NOTE: If you have the package “build-essential”, or you have the gcc compiler (3.4 or newer), you may skip to Section 3. If you do not use Ubuntu, Kubuntu, or Xubuntu, I recommend you try to install the gcc compiler that is available to your distribution, as this section will only accommodate those who can utilize the “apt-get” function or “dpkg” function of the terminal.

1) Type the following into the terminal (if you have an internet connection).

Code:
sudo apt-get install build-essential

Proceed to the next section.

2) If you do not have an internet connection, use another computer to download the “build-essential” package from packages.ubuntu.com. Use the search function there to find the package, or click here.

3) Once it is downloaded, transfer the file to the computer you are trying to configure wireless on. Put it in its own directory (folder).

4) Run this in a terminal. Make sure you are in the same directory as the “build-essential” package is.

Code:
sudo dpkg -i *.deb

5) If this works, you may safely delete these packages, and go to the next section.

If not, the there are probably dependency issues. The only thing I can suggest is to write down the names of the packages it says you need, download them and transfer them into the same directory as you are in now, and run the code again. If there are still issues with dependencies, do the same thing. This is why it is MUCH easier to have a working internet connection while doing this.


3. Installing NDISwrapper

NOTE: If you have ever tried to install your card via ndiswrapper before, type these into a terminal, each separately.

Code:
sudo rmmod ndiswrapper
sudo ndiswrapper -l
sudo ndiswrapper -e nameofdriver
sudo apt-get remove --purge ndiswrapper*

If you don’t have Ubuntu, Kubuntu, Xubuntu, or ‘apt-get’, instead of using the last line, remove the package ‘ndiswrapper*’ via however it was you installed it.

1) Download the NDISwrapper source code from here. Choose the latest stable version. The reason I am having you install from source is that I (along with others I know) have had issues with the ‘ndiswrapper’ package provided with Ubuntu. Not to discourage their packages, but I have had greater success with compiling from source. Also keep in mind that when there is a kernel upgrade, you may have to recompile ndiswrapper from source in order to make sure it keeps working.

2) Extract the archive with whatever archive extractor you wish. To do it from the terminal, though, here is the command.

Code:
tar -zxvf nameOfArchive.tar.gz

3) in the terminal, type this in

Code:
cd pathToFolder

where ‘pathToFolder’ is the directory created from extracting the archive in the last step.

4) Now, type in the following exactly, each separately

Code:
sudo make uninstall
sudo make uninstall
make
sudo make install

If you get no errors, you are good to proceed to the next section.

If you get any errors, make sure your gcc compiler is up to date. If you still get errors, or don’t want to upgrade, type this into the terminal.

Code:
sudo make uninstall
sudo make uninstall

Then try to use the Ubuntu provided packages.

Code:
sudo apt-get install ndiswrapper*

And proceed to the next section, though it is possible it won’t work.

If you do not have an internet connection, you will once again have to transfer the packages from another computer to this one, and use ‘sudo dpkg -i *.deb’ again, and fix the dependencies yourself.

4. Installing your wireless driver

You got this far. The hard part is OVER!!! Be happy

This tutorial DOES assume you have the driver for your wireless card. If you bought the card in a store, it will be on the CD provided. If you for whatever reason do not have a CD (e.g. internal wireless) the website of your computer should have it or the site of the maker of the card should have it on their site. If the driver is inside an EXE file, you should be able to extract it with an archive manager, such as file-roller.

Also, consider this a “Step 0”. Paste this into your terminal.

Code:
echo 'blacklist bcm43xx' | sudo tee -a /etc/modprobe.d/blacklist

The bcm43xx driver is a linux proprietary driver that will make some wireless cards with a Broadcom chipset work, but it is only “okay”, and it may conflict with your wireless hardware and prevent your wireless from working with ndiswrapper.

1) Via the terminal, change to the directory where the driver is. It will have to have the .inf and .sys file in there. Remember, the command to change directories is ‘cd’. If the driver is on a CD, the CD is usually mounted at ‘/media/cdrom0’ or somewhere in the ‘/mnt’ directory.

2) Once in the directory, type this into a terminal.

Code:
sudo ndiswrapper -i driver.inf

‘driver’ would be the name of the driver you need to use. And the accompanying .sys file MUST be in the same directory. If it discerns between which Windows driver, use the 2000 or XP one, never Vista, as Vista drivers are not yet supported (but will be in the near future, hopefully).

3) Now type in this

Code:
sudo ndiswrapper -l

If it says no hardware is present, then you have the wrong driver. If that happens here is how to uninstall the driver

Code:
sudo ndiswrapper -e driver

4) Type these into a terminal

Code:
sudo ndiswrapper -m
sudo modprobe ndiswrapper

5) Now open up /etc/modules with the text editor of your choice. Make sure you have super-user priveleges, a.k.a. use ‘sudo’. Add

Code:
ndiswrapper

to the bottom of the file. You should probably reboot here.

6) If this works, congrats, your wireless is installed. You can either configure it using the network manager that came with your distribution, or you can use a handy program called Wifi-Radar, which effectively manages your wireless. If you choose to install Wifi-Radar, make sure you have Python installed as well. If you do not have a GUI interface, I will be providing the necessary code to bring up your wireless and scan for SSIDs (network names) thru the terminal.

If you are doing this on Hardy, and this did not work, follow the steps in this guide for a workaround until whatever bug this is is fixed. This may be fixed by the time Hardy’s release comes around, though, so let me know if this is not an issue for you.

5. Activating your wireless card via terminal

Here is everything you should need to know for bringing up a wireless (or any internet connection) from the terminal. Keep in mind that your wireless connection may not always be called wlan0. For example, my interface is eth1. the command “iwconfig” should give you the interface name.

To scan for a wireless network (essid)

Code:
sudo iwlist wlan0 scan

To bring up the interface

Code:
sudo ifconfig wlan0 up

To bring down the interface

Code:
sudo ifconfig wlan0 down

To connect to a router

Code:
sudo iwconfig wlan0 essid ID key k

where “ID” is the name of the router you want to connect to (returned by iwlist scan wlan0), and “k” is the network key to connect to the router

Now that you know what each command does, here is what most people should have to type into their terminal

Code:
sudo iwlist wlan0 scan
sudo ifconfig wlan0 down
sudo ifconfig wlan0 up
sudo iwconfig wlan0 essid ID key k

I am unsure if this terminal method works with WPA encryption, so keep that in mind, as I use WEP because of the difficulty I have had with WPA in general. In theory it should work, but I don’t know if thee are any extra steps to it.

6. Credits

While I largely did learn on my own how to use NDISwrapper, I must thank trubblemaker for showing me how to compile ndiswrapper from source, how to purge it from my system, and how to stop the bcm43xx driver from loading. I also want to thank Jim for showing me the commands to bring up a wireless interface from the terminal, even though I forgot them and had to re-ask  Also thanks to Mazza558 for the Hardy workaround.

7. Other Methods

If this guide does not work for you, but you are able to get your wireless card working some other way, outline what you did or link the walkthrough you followed, along with your wireless hardware or laptop model. I will put that information in this section.

Atheros AR5007 wireless device- http://www.ubuntugeek.com/atheros-ar…rdy-heron.html

Also, please vote in the poll at the top, I’d like to know how helpful this has been to you. If anything is unclear or not straightforward, please tell me so I can fix it. In the words of GLaDOS, “thank you for helping me help you help us all.”

Good luck and Godspeed

————————————————-

“ขั้นตอนการใช้งาน ndiswrapper
ให้ Download ที่
http://prdownloads.sourceforge.net/ndiswrapper/ndiswrapper-1.10.tar.gz?download
จะเป็น version 1.10
จากนั้นแตก file ครับ
# tar zxvf ndiswrapper-1.10.tar.gz
# cd ndiswrapper-1.10
ใช้คำสั่ง make และ make install เพื่อ Compile
# make
# make install

เสร็จแล้วลองใช้คำสั่ง ndiswrapper ดูครับ
# ndiswrapper
Usage: ndiswrapper OPTION

Manage ndis drivers for ndiswrapper.
-i inffile Install driver described by ‘inffile’
-d devid driver Use installed ‘driver’ for ‘devid’
-e driver Remove ‘driver’
-l List installed drivers
-m Write configuration for modprobe

where ‘devid’ is either PCIID or USBID of the form XXXX:XXXX
หากใฃ้คำสั่งได้ ก็จะขึ้นมาดังตัวอย่าง

ขั้นตอนต่อไปทำการติดต้อง driver Windows ครับ
ให้ copy driver Card Lan สำหรับ Window XP จาก cdrom ทั้ง directory ไปไว้ที่ไหนก็ได้ครับ
จากนั้นใช้คำสั่ง ndiswrapper -i ตามด้วยชื่อ driver นามสกุล inf
อย่างของผม Driver มีชื่อว่า TTNET1130.INF

# ndiswrapper -i TTNET1130.INF

เมื่อเสร็จแล้วลองใช้คำสั่ง ndiswrapper -l ดูครับ จะเห็นชื่อ Driver ตามข้างล่าง
# ndiswrapper -l
Installed drivers:
tnet1130 driver installed, hardware present

จากนั้นให้ระบุ device ให้ใช้ driver ครับ โดย ใช้ ndiswrapper -d devid driver
devid = หมายเลย device card wireless
driver = driver card wireless ของผมก็คือ tnet1130
วีธีดูหมายเลข device ครับ

# lspci
00:0a.0 Network controller: Texas Instruments ACX 111 54Mbps Wireless Interface

จะเห็น 00:0a.0 ใช่ไหมครับ จากนั้นให้ใช้คำสั่ง
# lspci -n
00:0a.0 Class 0280: 104c:9066
จะเห็นว่า 00:0a.0 ใช้ device เป็น 104c:9066

ก็ให้ไปใช้คำสั่ง ndiswrapper -d ตัวอย่างเครื่องผมครับ
#n diswrapper -d 104c:9066 tnet1130

ต่อไปก็ save ครับ โดยใช้คำสั่ง
# ndiswrapper -m ครับ

เราก็สามารถมี Driver ใช้งาน Wireless บน Linux ครับ “

ใส่ความเห็น

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 / เปลี่ยนแปลง )

Twitter picture

You are commenting using your Twitter account. Log Out / เปลี่ยนแปลง )

Facebook photo

You are commenting using your Facebook account. Log Out / เปลี่ยนแปลง )

Google+ photo

You are commenting using your Google+ account. Log Out / เปลี่ยนแปลง )

Connecting to %s

Tag Cloud

%d bloggers like this: