Archive

Posts Tagged ‘wifi’

Installing Linux to an external hard drive (+ driver issues)

July 27th, 2013 No comments

While I haven’t quite figured out what I’m going to be doing for this round of The Linux Experiment, I have decided that now is a good time to try something I’ve been meaning to try for a while: get Linux to boot off of an external hard drive. This was actually such a straight forward process, simply install like normal but choose the external drive for the location of all files, that I won’t bother you with the details. The only special thing I did was decide to install GRUB on the external drive making the whole install essentially a completely isolated thing – that way if I turn off the external drive then the computer boots up off of the internal drive like normal, if I boot with the external drive on then GRUB asks me what to do.

The only downside to a setup like this is that I am using USB 2.0 as my connection to the hard drive which means the disk I/O and throughput will be theoretically lower than normal. Arguably I could get around this by using something like USB 3.0 or eSATA but so far in my experience this hasn’t really been an issue. Besides once the OS boots up almost everything is running and/or cached within RAM anyway. In fact that only problems I have run into with running Linux on this desktop were, ironically, driver issues.

First up is the wireless drivers. Yes, it is 2013 and I am still having Linux WiFi driver issues… This issue was unlike any I had seen before – the wireless card was automatically detected, the Broadcom proprietary driver was automatically selected and enabled, it even appeared to work but no matter what I tried it simply would not make a lasting connection to the wireless network. On a whim I decided to just turn off the device driver and, even though the dialog window told me that I would no longer be using the device, things suddenly started working like magic. I have to assume that buried deep within the Linux kernel is already an open source implementation for my wireless driver and that is what is actually working right now. Whatever the actual cause, the device is now working flawlessly.

For future reference: Do not use the device = magically make everything work perfectly

For future reference: Do not use the device = magically make everything work perfectly

The other driver issue I had was again related to a proprietary driver, this time for my graphics card. By default the install used the open source driver and this worked fine. However I have had a long battle with AMD/ATI cards working on Linux without using the proprietary driver and so I decided to enable it in order to avoid any future problems.

graphics

One reboot later and not only was my colour and resolution completed screwed up but I also got this “awesome” overlay on my desktop that said “Hardware not supported”. I tried to take a screenshot of it but apparently it is drawn onto the screen post-display or something (the screenshot did not show the overlay). So for now I am back to using strictly open source drivers for everything and amazingly it is all just working. That’s probably the first time I’ve ever been able to say that about Linux before.




I am currently running a variety of distributions, primarily Linux Mint 17.
Previously I was running KDE 4.3.3 on top of Fedora 11 (for the first experiment) and KDE 4.6.5 on top of Gentoo (for the second experiment).
Check out my profile for more information.

Querying the State of a Hardware WiFi Switch with RF-Kill

October 8th, 2012 No comments

The laptop that I’m writing this post from has a really annoying strip of touch-response buttons above the keyboard that control things like volume and whether or not the wifi card is on. By touch-response, I mean that the buttons don’t require a finger press, but rather just a touch of the finger. As such, they provide no haptic feedback, so it’s hard to tell whether or not they work except by surveying the results of your efforts in the operating system.

The WiFi button in particular has go to be the worst of these buttons. On Windows, it glows a lovely blue colour when activated, and an angry red colour when disabled. This directly maps to whether or not my physical wireless network interface is enabled or disabled, and is a helpful indicator. Under Linux Mint 12 however, the “button” is always red, which makes it a less than helpful way to diagnose the occasional network drop.

Lately, I’ve been having trouble getting the wifi to reconnect after one of these drops. To troubleshoot, I would open up the Network Settings panel in Mint, which looks something like this:

Mint 12's Wireless Network Configuration Panel

The only problem with this window is that the ON/OFF slider that controls the state of the network interface would refuse to work. If I drag it to the ON position, it would just bounce back to OFF without changing the actual state of the card.

In the past, this behaviour has really frustrated me, driving me so far as to reboot the machine in Windows, re-activate the physical interface, and then switch back to Mint to continue doing whatever it was that I was doing in the first place. Tonight, I decided to investigate.

I started out with my old friend iwconfig:

jonf@jonf-mint ~ $ sudo iwconfig
lo        no wireless extensions.

eth0      no wireless extensions.

wlan0     IEEE 802.11abgn  ESSID:off/any
Mode:Managed  Access Point: Not-Associated   Tx-Power=off
Retry  long limit:7   RTS thr:off   Fragment thr:off
Encryption key:off
Power Management:off

As you can see, the wireless interface is listed, but it appears to be powered off. I was able to confirm this by issuing the iwlist command, which is supposed to spit out a list of nearby wireless networks:

jonf@jonf-mint ~ $ sudo iwlist wlan0 scanning
wlan0     Interface doesn’t support scanning : Network is down

Again, you can see that the interface is not reacting as one might expect it to. Next, I attempted to enable the interface using the ifconfig command:

jonf@jonf-mint ~ $ sudo ifconfig wlan0 up
SIOCSIFFLAGS: Operation not possible due to RF-kill

Ah-ha! A clue! Apparently, something called rfkill was preventing the interface from coming online. It turns out that rfkill is a handy little tool that allows you to query the state of the hardware buttons (and other physical interfaces) on your machine. You can see a list of all of these interfaces by issuing the command rfkill list:

jonf@jonf-mint ~ $ rfkill list
0: phy0: Wireless LAN
Soft blocked: no
Hard blocked: yes
1: hp-wifi: Wireless LAN
Soft blocked: no
Hard blocked: yes

Interestingly enough, it looks like my wireless interface has been turned off by a hardware switch, which is what I had suspected all along. The next thing that I tried was the rfkill event command, which tails the list of hardware interface events. Using this tool, you can see the effect of pressing the physical switches and buttons on the chasis of your machine:

jonf@jonf-mint ~ $ rfkill event
1349740501.558614: idx 0 type 1 op 2 soft 0 hard 0
1349740505.153269: idx 0 type 1 op 2 soft 0 hard 1
1349740505.354608: idx 1 type 1 op 2 soft 0 hard 1
1349740511.030642: idx 1 type 1 op 2 soft 0 hard 0
1349740515.558615: idx 0 type 1 op 2 soft 0 hard 0

Each of the lines that the tool spits out shows a single event. In my case, it shows the button that controls the wireless interface switching the hard block setting (physical on/off) from 0 to 1 and back.

After watching this output while pressing the button a few times, I realized that the button does actually work, but that when the interface is turned on, it can take upwards of 5 seconds for the machine to notice it, connect to my home wireless, and get an ip address via DHCP. In the intervening time, I had typically become frustrated and pressed the button a few more times, trying to get it to do something. Instead, I now know that I have to press the button exactly once and then wait for it to take effect.

I stand by the fact that this is a piss-poor design, but hey, what do I know? I’m not a UX engineer for HP. At least it’s working again, and I am reconnected to my sweet sweet internet.




On my Laptop, I am running Linux Mint 12.
On my home media server, I am running Ubuntu 12.04
Check out my profile for more information.

Wireless Networking: Using a Cisco/Linksys WUSB54GC on Gentoo

November 13th, 2011 1 comment

We live in an old house, which has the unfortunate side-effect of lacking a wired network of any kind. All of our machines connect to a wireless network, and my desktop is no exception. I’ve got an old WUSB54GC wireless stick that was manufactured some time in 2007. In computer years, this is way old hardware. But with a bit of work, I managed to get it working with my Gentoo install.

This bitch is old... but it works

I started out by installing the NetworkManager applet with a tutorial on the Gentoo Wiki. This was a straightforward process, and after a restart, the applet icon appeared in the top right corner of my screen. If you left-click on the icon, it drops down a menu that lists your wireless interfaces. Under the Wireless Networks heading, it said that it was missing the firmware necessary to talk to my hardware.

The next step was to look around the net and figure out the firmware/kernel module combination that supports this stick. I found my answer over at the SerialMonkey project, which is run by a group that took on maintenance of older Ralink firmware after the company of the same name dropped support. According to the SerialMonkey hardware guide, my stick (or at least a very similar stick called the WUSB54GR) works with the rt73usb kernel module and related firmware.

This known, there are two methods of proceeding. Those running older kernels may need to manually compile the necessary packages using instructions similar to these, from the Arch Linux project. For more modern kernels, the Gentoo project provides a Wiki entry detailing the necessary steps.

After following the steps in the Gentoo Wiki entry, I restarted my system, and now have full wireless support. Genius!




On my Laptop, I am running Linux Mint 12.
On my home media server, I am running Ubuntu 12.04
Check out my profile for more information.
Categories: Gentoo, Jon F Tags: , , , ,

Ubuntu 11.10’s WiFi crashes my router

October 19th, 2011 9 comments

No seriously, it does. Whenever it makes a connection to the router it causes it to enter some bad state wherein it refuses to allow any connections to occur. This also has the effect of booting all other machines from the network. Apparently I’m not the only one to have this problem either.

I did manage to find a bit of a work around though:

  1. Set your wireless router to Mixed B/G mode only (yes I know, you lose out on N by doing this…)
  2. Enter the following into a terminal:
    echo "options iwlagn 11n_disable=1" | tee /etc/modprobe.d/iwlagn.confg
    sudo modprobe -rf iwlagn
    sudo modprobe -v iwlagn
    sudo service network-manager restart
  3. Maybe reboot?

I’ve also heard of some people getting it to work by enabling this instead of disabling it. To do so simply change the 11n_disable=1 line above to 11n_disable=0.

Hopefully they will have this annoying bug fixed soon.




I am currently running a variety of distributions, primarily Linux Mint 17.
Previously I was running KDE 4.3.3 on top of Fedora 11 (for the first experiment) and KDE 4.6.5 on top of Gentoo (for the second experiment).
Check out my profile for more information.
Categories: Tyler B, Ubuntu Tags: , , , ,

Getting Up and Running with Debian

September 1st, 2009 3 comments

Considering that it was my first experience with Linux, the installation of Debian actually went rather smoothly. I popped in the Debian live disc, rebooted my machine, and said goodbye to Windows XP.

The Basics:

I chose the graphical installer, because I’m a big wimp, and because it makes screenshots. You might ask how the installer saves screenshots to a hard drive that is as of yet unpartitioned, and will be wiped/encrypted during the coming hours… I don’t know either, but I guess that’s a part of the Linux magic. (You don’t get any of these pictures, because I lost them when I reinstalled, and forgot to take more the second time around).

The first few settings were fairly straightforward. Debian asked me to choose my default language, geographical location, and keyboard layout. Debian appears to support some 44 different keyboard layouts on install, including Dvorak, and Canadian Multilingual, which is perhaps the most awful layout ever conceived by man. Is it as bad for the Quebecois as it is for us Ontarians?

Next, the installer attempted to detect my hardware settings, and scanned the live disc for required drivers. At this point, the installer notified me that my system would require non-free firmware files to get my wireless card working. In Linux-speak, non-free simply means that the firmware is distributed as a compiled binary, and that the source code is not available. It is, however, free in the sense that I don’t have to pay a dime to use it, although I have to agree to a license to do so. Given the option to load the firmware files from a disc, or to wait and deal with the problem once the desktop was up and running, I chose the latter.

The next step was for the Debian installer to attempt to auto-configure my DHCP settings, and to use my ethernet card to connect to the internet. Since the laptop wasn’t plugged in to an ethernet cable, it didn’t really surprise me that this step failed. I chose to configure the network later, and moved on to giving my machine a name and choosing my timezone instead.

Partitions and Full-Disc Encryption:

When it came time to partition my disks, I chose to take a shot at full-disc encryption. The most basic Linux drive has two partitions – one called /boot that is generally formatted with ext2 and takes the place of Window’s boot sector, and another called / that contains the rest of your data, including the OS. Once the BIOS has finished all of it’s startup checks and initializations, it hands off to GRUB, which is stored on the /boot partition. GRUB does some other stuff, and then boots the operating system, which is stored on the secondary partition, usually formatted with one of the many available file systems that Tyler covered in detail in a previous post. There is a great explanation of the entire boot process available here.

To allow for multiple partitions, Linux utilizes some fancy software called the LVM (logical volume manager), which virtualizes any partitions that you create within the big main one. When enabling full-disc encryption, everything inside of the LVM (all of the partitions except for /boot, because the machine needs to be able to start) is encrypted as it is written to disc, and decrypted as it is read from disc. This method of protecting your data is extremely secure, as the encryption is transparent to the user and operating system, while every file on the system remains encrypted until the correct password is provided by the user.

Debian allows me to put each of the important parts of my root directory on separate drive partitions. For example, I can separate the /home partition from the /usr, /var, and /tmp partitions within the LVM. This would be extremely handy if my machine were running multiple physical discs, and I wanted to put my install on a separate disk from my data so that backups and reinstalls are less painful. Because I’m new at this and have only one disc, I chose to put all of my files in a single partition.

Before proceeding with installation, Debian tried to zero all existing data on my drive. Since that data wasn’t at all sensitive, my hard drive is small, and I don’t care to wait years for the wiping process to finish, I hit the cancel button in the bottom-right hand corner of the screen, which allowed me to skip to the next step. I actually found this out by accident, fully expecting the cancel button to boot me right out of the install process. Silly UI design, that.

The last step in partitioning my drives was to provide a password for the full-disc encryption, and to choose the file system for each of my newly created partitions. As previously noted, my /boot partition is formatted with ext2, and the LVM is using a filesystem called crypto, which I assume is just the name of the encrypted partition container. Linux also creates a root partition for me (located at /), which I’ve chosen to format with the ext3 filesystem, since ext4 does not appear to be supported by my installer. Finally, a partition called /swap is created (the equivalent of the Window’s swap file), that is formatted with the (what else?) swap file system.

It should be noted that the partition manager screen also had a strange UI bug in it – the continue button that had been my friend and companion thus far throughout the install process ceased to have any meaningful functionality. I had to choose to ‘finish partitioning and write changes to disc’ from the partition manager menu before I could continue with the installation.

Just About There:

With all of the setup options behind me, the Debian installer helpfully finished the install all on it’s own, pausing only to demand that I enter a root password, a default user account name and user account password. It should be noted that if you intend to become a l337 system administrator, your root password should be hard to guess but easy to type, as you’ll be forced to enter it whenever you do an action that is outside of the user account security privileges (or in other words, essentially anything of consequence).

Lastly, the installer asked if I wanted to enable the Debian package popularity contest (popcon), and which default software I wanted to install. I chose to add a web server, file server, and SQL database to the default install. That done, the installer went on it’s merry way and actually got down to the business of installing my distribution.

Adding the Tubes (Or Not):

Remember how the Debian installer failed to auto-detect my DHCP settings because my laptop wasn’t plugged into an ethernet cable? Well it also “forgot” to install my ethernet card driver at the same time. Since the machine doesn’t have a network connection, I have no access to the Debian repositories from which I can get the required drivers, but I can’t seem to get them without access to those repositories. I found the driver in question here, but have no idea what to do with the driver once I get it, because it is distributed as a *.rpm package, which is the Fedora package format, and unsupported by Debian. I’ve found various discussions on the Debian website that reveal that tg3, the driver for my network card, was removed from the Debian package, because it is not “free” in the sense that it is distributed as a compiled binary, and not as source.

After spending a half hour scouring the GOOG for instructions on how to install this driver, only to come up empty handed, I’ve decided to simply reinstall, but to plug the ethernet cable in this time, and hope that it works better than it did last time. If anybody knows what the hell happened, I’d love to hear an explanation, and perhaps a method by which I can fix the problem.

Back from the Reinstall:

So after waiting for Debian to reinstall, I got back up and running, and just needed my wireless card active so that I could put my ethernet cable back in my other computer. Luckily, the steps to get it working are very straightforward:

  1. Open the synaptic package manager
  2. Under the settings menu, select repositories, and select the DFSG and Non-DFSG checkboxes. This will allow synaptic to install packages that are non-free.
  3. Search for a package called firmware-ipw2x00, and install it
  4. Agree to the firmware license
  5. Open a root terminal
  6. Type “modprobe ipw2200″ to load the firmware kernel module
  7. Navigate to the etc/ directory, and open the file “modules” in the nano editor
  8. add the line “ipw2200″ to the end of the file
  9. Hit ctrl-x to close the file, and Y to save the changes.
  10. Restart your machine

Once your machine restarts, the wireless firmware will be loaded, and you should be able to click on the network icon in the taskbar and select an available wireless network to connect to.

So Everything is Cool, Right?

Well, not quite. My system is up and running, supports full-disc encryption, wired and wireless networking; but the GNOME desktop bugs the hell out of me, and so far as I can tell, I don’t have a working sound card yet… More on that one tomorrow. The moral of this story is as follows: NEVER install Debian without a network connection present. It’s just not worth your time.