Wednesday, August 21, 2013

Ubuntu 12.04 and Wireless Not Playing Nice... When on Battery.

Wrong place, wrong time. Story of my life.

I ran into this problem when, in one of my insomiac states, was writing some code on the Linux side of my laptop. In my vantage point it appeared I really broke something. When I booted up, Ubuntu would connect to my Wireless network. At least it said it did... but I couldn't reach the internet. So after a few profanities, I resigned myself to the fact that i wasn't going to sleep just yet. And started the investigation.

First I looked to see what did go right and typed the ubiquitous:

ifconfig -a

This returned and showed that I indeed did have an IP Address leased from my router. It also showed errors on transmit and receipt. Uh-oh. I then tried to ping my router... no dice. I found that if I turned off wireless through my laptop button and turned it back on it worked! But when I rebooted, and it automatically connected, I was back to the problem state.

Head bowed down, I then went off down the troubleshooting-bricked road. Restarted the router. Nope. Checked resolve.conf. Nothing in there. Checked to make sure software and hardware firewalls were behaving. Nice try. and then...

I noticed that the signal strength dropped and was very weak. Even though I was a few feet from the router. "Odd," I thought. But it had to be something to do with what I was working on. Right? Right?!?

It then dawned on me that at my home I'm never on battery power... could it be... could it possibly be an incompatibility with Ubuntu power management on battery and my wireless card (Intel 5100 AGN, for you keeping track at home)?

I began an internet search on this and found that there were indeed issues for some wireless adapters when on battery. I couldn't find a setting to change, but I did find that there was a work around. Basically you create a blank file called "wireless" and copy it to:

/etc/pm/power.d

This is because this blank file is read first and that other power management wireless file located
in /usr/lib/pm-utils/power.d is ignored.

I then rebooted, and low and behold, my problems went down the drain. Get it? Drain? Like battery drain? Ah, never mind.

Of course this might mean shortened battery life, but who cares if you can get some sleep?


No comments:

Post a Comment

I want to hear what you think! Don't be shy, comment today.

NOTE: To combat spam, I'm moderating the comments. Rest assured, however, that I will publish them. Even if you are commenting to say I'm a big dumb idiot. Providing you do so in a civilized manner and it is on topic, of course. :o)