Results 1 to 3 of 3

Thread: Getting Your Wireless to Work

  1. #1
    Join Date
    Jun 2008
    Location
    Kansas City Area, Missouri, USA
    Posts
    7,235

    Default Getting Your Wireless to Work

    From what I remember about my earliest days as a noob with Linux and the nature of the current postings in the openSUSE Forums, the things that cause the most trouble are sound, multi-boot with Windows, and wireless. I am not an expert with the first two. If alsaconf ever fails to fix my system, I'll be posting about my sound, and I no longer run Windows except in a virtual machine, thus my multi-boot setups only deal with more than one version of Linux. This article will deal with getting a wireless device to work.

    In this tutorial, I will try to use the various GUI's whenever possible; however, there are certain operations that are not implemented in a GUI. For those commands, I will instruct you to open a terminal and type the command. The various command-line processors on Linux, also known as shells, are extremely powerful, unlike the equivalent on Windows. Interestingly enough,
    one of the "virtues" of Windows 7 is their "Power Shell 2.0".

    I. Why is Wireless a Problem?

    The first problem is that the IEEE 802.11 protocol is complicated, and getting more so every day. The degree of effort required to prepare a driver is considerably greater for wireless than for most other forms of networking.

    A second problem is that many vendors do not contribute to open-source drivers; however, this situation is changing. Within the past few months, I am aware of several vendors that have released vendor-written drivers, or have released previously closed components of their driver. Frequently, their code does not meet the very high standards of Linus, but these codes do show how to get started with the device.

    The closed nature of some vendors leads to a secondary problem, that of firmware or microcode, which executes on the internal cpu of the device. In several instances, a driver has been reverse engineered but not the firmware. As a result, openSUSE cannot distribute that firmware. Of course, the device will not operate without it and the user that does not have access
    to a wired connection is caught in a "chicken-and-egg" problem. This situation is changing rapidly. For example, open-source firmware for the Broadcom BCM4306/3 BCM4318, and BCM4311/1 was just released. Future openSUSE versions will be able to include this firmware and those devices will work immediately.

    The final major reason for problems is that there are large numbers of devices that have been manufactured in limited quantities, and used in the Windows OEM market. As long as there is a driver for that OS, the vendor is satisfied. To make things even worse for the Linux community, the PCI or USB ID's of these
    devices frequently do not uniquely identify the hardware. This causes Linux to load the wrong driver.

    Whatever problems you might be having with your wireless device, Please do not post "My Wireless Doesn't Work, What Do I Do Next?" This question does absolutely no good, as it conveys no useful information. The next section of this article will cover the steps you need to take to collect the information needed to resolve your problem.

    II. What device do you have?

    Information about your wireless hardware can be obtained by starting YaST, clicking on Hardware in the left panel and selecting Hardware Information. Henceforth, this sequence will be abbreviated YaST => Hardware => Hardware Information. In the resulting display, check for an entry named "Wireless LAN". Report its presence/absence in your report.

    If you found this entry in your list, then click on its + and find the "Kernel Driver" line, note and report that value.

    If the Wireless LAN entry is not found, you then need to open either the PCI or USB items to find your wireless device. Just because your wireless device is internal to the computer does not necessarily mean it is PCI as some internal devices are attached to a USB port. Scroll through the entries to find the one that starts with "UDI:" and post it. This line contains the PCI or USB ID that determines which driver is needed for the device. Note: To use copy-and-paste with the Hardware Information listing, you will need to copy it to a file, and then open that file with an editor such as Kedit. The saved listing will not look quite the same as the original, but will have the same information. The UDI line for my USB wireless stick with an RTL8187B chip is "udi = '/org/freedesktop/Hal/devices/usb_device_bda_8187_00e04c000001_if0'". The USB IDs for this device are 0bda:8187 (Leading zeros are suppressed.).

    III. Do you need to install external firmware?

    To answer this question, you need to look at the logs, in particular the info in /var/log/boot.msg. To see this, you need YaST => Miscellaneous => System Logs and select boot.msg. From the GUI, you will have to scroll through the entire file looking for lines that contain the word "firmware". If you are not opposed to using the command line, open a terminal and type the string "dmesg | grep firmware" (without the quotation marks, of course). This one command will output every line in the log that contains any mention of firmware. If you need external firmware, there will be a line that says that the driver was unable to load the firmware, and the name of the missing file should be noted. You will need to locate that file (on the Internet) and place it in the directory /lib/firmware. If you cannot find the file, then post the details on the wireless subforum. You should also inspect the boot log for other information regarding your device. In particular look for messages that your radio kill switch has been activated. A number of people have felt rather silly when they posted that their wireless didn't work, only to be told to "turn it on".

    IV. Making a connection

    Once you have installed any required firmware, you should be able to scan for Access Points (AP's) in your vicinity. The easiest way to do this is with a command-line tool called iwlist. To find all the AP's, you should execute this as root by issuing the command:

    sudo /usr/sbin/iwlist scan

    If everything is working, the resulting output will yield something like:

    wlan2 Scan completed :
    Cell 01 - Address: 00:1A:70:46:BA:B1
    ESSID:"lwfdjf_rad"
    Mode:Master
    Channel:1
    Frequency:2.412 GHz (Channel 1)
    Quality=66/100 Signal level:-46 dBm
    Encryption key:on
    IE: IEEE 802.11i/WPA2 Version 1
    Group Cipher : CCMP
    Pairwise Ciphers (1) : CCMP
    Authentication Suites (1) : PSK
    Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 18 Mb/s
    24 Mb/s; 36 Mb/s; 54 Mb/s; 6 Mb/s; 9 Mb/s
    12 Mb/s; 48 Mb/s
    Extra:tsf=000000da45e7c18a
    Extra: Last beacon: 68ms ago

    If you get this output (plus data for other AP's), then the interface is able to receive data (at least). Other results should be posted.

    V. Encryption

    If your wireless network is encrypted, and it should be to protect your data and your identity, then you will need the key in order to make a connection. With WPA and WPA2, you may use a pass phrase; however, that is not recommended for WEP. The reason is that WEP has several algorithms used to convert between a phrase and a key. If your AP and Linux use different methods, you will never connect. The safe way is to log into your AP and find the key that it is using. If the AP belongs to someone else, they will need to get the key for you. It will be a string of hexadecimal numbers 10 for 64-bit, and 26 for 128-bit encryption. Caution: If you run iwconfig as root, it will output a line like

    Encryption key:821F-91AA-F264-9812-6778-8AA3-2D6A-73BF [2] Security mode:open

    DO NOT POST THIS LINE in a public place as it is the key needed to access your network. This 36-digit key is for WPA2. Don't worry, I obscured my actual value.

    VI. Association and authentication

    There is a two-step process when connecting to an AP. The first is selecting the right AP based on the ESSID, and then negotiating the encryption to use. The whole process is too involved to be discussed here, but you need to know that NetworkManager will use an external program called wpa_supplicant whenever your network is encrypted. Make sure that its package has been installed.

    The details of the connection should be entered with YaST => Network Devices => Network Settings if you are using the traditional "ifup" method, or in the New Connection entry of the NetworkManager applet found in the right-hand corner of the screen - upper for Gnome and lower for KDE.

    Once you have associated with the AP, the command "/usr/sbin/iwconfig" will result in data that looks like:

    wlan2 IEEE 802.11bg ESSID:"lwfdjf_rad"
    Mode:Managed Frequency:2.412 GHz Access Point: 00:1A:70:46:BA:B1
    Bit Rate=54 Mb/s Tx-Power=20 dBm
    Retry min limit:7 RTS thr:off Fragment thr=2352 B
    Power Management:off
    Link Quality=70/100 Signal level:-43 dBm
    Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
    Tx excessive retries:0 Invalid misc:0 Missed beacon:0

    If the ESSID of your AP does not occur on the first line and the MAC address next to the "Access Point" label, then authentication/association has failed. Use the output of the dmesg command to find out why.

    When you configure your network, you should select DHCP and get an IP address automatically. If you really need to get a static IP address, then be sure you know what you are doing as you will need to set up routing and DNS server addresses.

    VII. Testing

    Once you have a connection and Firefox is able to browse the Internet, then all is well. In case of problems, there are tests to isolate the difficulty. The first is to see if your interface obtained an IP number by using the command "/sbin/ifconfig". You should see something like:

    wlan2 Link encap:Ethernet HWaddr 00:1B:2F:A2:07:CA
    inet addr:192.168.1.106 Bcast:192.168.1.255 Mask:255.255.255.0
    UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
    RX packets:19552 errors:0 dropped:0 overruns:0 frame:0
    TX packets:12554 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:15064420 (14.3 Mb) TX bytes:1774991 (1.6 Mb)

    The critical thing is that you have the line that starts with "inet addr:". If that is there, try to communicate with the AP using the command-line tool ping. Usually, your AP's address will have the first three parts of your IP with the final part being 1. Thus, the address of my AP is 192.168.1.1. The command I
    would use is:

    ping -c 5 192.168.1.1

    The resulting output is:

    PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data.
    64 bytes from 192.168.1.1: icmp_seq=1 ttl=64 time=3.93 ms
    64 bytes from 192.168.1.1: icmp_seq=2 ttl=64 time=1.37 ms
    64 bytes from 192.168.1.1: icmp_seq=3 ttl=64 time=1.70 ms
    64 bytes from 192.168.1.1: icmp_seq=4 ttl=64 time=1.54 ms
    64 bytes from 192.168.1.1: icmp_seq=5 ttl=64 time=1.75 ms

    --- 192.168.1.1 ping statistics ---
    5 packets transmitted, 5 received, 0% packet loss, time 4006ms
    rtt min/avg/max/mdev = 1.375/2.060/3.936/0.947 ms

    If you get something like

    From 192.168.1.106: icmp_seq=2 Destination Host Unreachable

    then your AP's address is not what you thought, or your network connection is bad.

    If you can ping your AP, the next step is to ping an external site. Try the command

    ping -c 5 66.70.73.150

    That is the address of www.samba.org. If that works, then try

    ping -c 5 www.samba.org

    If that works, then Firefox or any other application should work. If this step fails, your name server entries are wrong and you should seek help.

    VIII. Connection Speed

    If your network connection is working, but it seems too slow when using a browser you should disable IPV6 unless you really need it - you probably won't. To do the disabling, YaST => Network Devices => Network Settings and select the "Global
    Settings" tab. If IPV6 is enabled, but no suitable name servers exist, a timeout will occur for every domain name server lookup. Throughput is killed. This problem occurs for all forms of network connections, not just wireless.

    If you have disabled IPV6, but your wireless throughput is low, you should check the output of the command

    /usr/sbin/iwconfig wlan0 | grep Mb

    If your wireless device is not wlan0, change that part. You should see a line like

    Bit Rate=48 Mb/s Tx-Power=20 dBm

    Nearly all the in-kernel wireless drivers use the built-in rate-setting algorithms to set the speed; however, not all of them work correctly. If your output shows 1 Mb/s, the rate-setting mechanism for your device may not be working. You can test this by issuing the following command to force a higher rate:

    sudo /usr/sbin/iwconfig wlan0 rate XXM

    where XX is one of the speeds reported by your AP in the "iwconfig scan" command used above. I would try 24M first, and increase or decrease depending on success. The object is to find the value at which you get the best throughput. Of course,
    if your device or AP only supports 802.11b, 11M will be your highest rate.

    If you need to manually set the rate, please post the details of your system, including kernel version ("uname -r") and your device type and model.

    IX. Conclusions

    It would be impossible to cover every contingency that might happen. If I tried, this document would be too long for anyone to read. I hope, however, that these instructions will help you follow a logical set of steps in solving your wireless connection problems.

    Thanks to deltaflyer44 for looking over this contribution.

  2. #2
    Join Date
    Jun 2008
    Location
    The English Lake District. UK - GMT/BST
    Posts
    36,719
    Blog Entries
    20

    Default Re: Getting Your Wireless to Work

    Excellent work Larry. I bookmarked this as a reference to offer those in trouble.
    Thanks
    Leap 15_KDE
    My Articles Was I any help? If yes: Click the star below

  3. #3

    Default Re: Getting Your Wireless to Work

    A very good diagnostic script for network problems of all kind (not only WLAN) can be found here:

    collectNWData berblick / Overview | collectNWData.sh

    DL-Link:

    http://www.linux-tips-and-tricks.de/...-category.html

    It is actively maintained and the author (which I know personally) is always open for suggestions.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •