LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices

Reply
 
LinkBack Search this Thread
Old 06-09-2012, 07:07 PM   #1
taylorkh
Senior Member
 
Registered: Jul 2006
Location: North Carolina
Distribution: CentOS 6 on my desktop, Ubuntu 12.04 LTS on my server, Ubuntu 12.04 on my netbook and the wife's PC
Posts: 1,170

Rep: Reputation: 95
Running on battery throttles wireless connection(?)


Dell Latitude 2100 with Broadcomm wireless card. Ubuntu 12.04.

I just completed an install of Ubuntu 12.04. The netbook previously had been running 12.04 for a couple of years and 9.04 when received from Dell. I just noticed that download speed when running on battery was only about 85KB/sec. Normal download speed is in the range of 340 - 360 as measured by an ftp script. If I connect the Ethernet cable but no charger the speed is fine. Or, if I connect the charger the speed is fine. Copying files to another PC over my network was also effected. The batter is showing full charge.

I do not recall this problem with Ubuntu 10.04. I may restore my last 10.04 backup to verify. Other than that, any ideas why this is happening? Is there a power saving setting which might cause this? It does not seem to make much sense to throttle the network speed on a netbook which is intended to be used on the go.

TIA,

Ken
 
Old 06-10-2012, 10:02 AM   #2
taylorkh
Senior Member
 
Registered: Jul 2006
Location: North Carolina
Distribution: CentOS 6 on my desktop, Ubuntu 12.04 LTS on my server, Ubuntu 12.04 on my netbook and the wife's PC
Posts: 1,170

Original Poster
Rep: Reputation: 95
Update:

I installed Ubuntu 10.04 on the netbook. The wireless connection works full speed with or without charger connected. I am going to do a minimal install of 12.04 to see if some of my package installs, configurations and tweaks may have caused the issue. I will update when I have more data.

Ken
 
Old 06-10-2012, 10:44 AM   #3
taylorkh
Senior Member
 
Registered: Jul 2006
Location: North Carolina
Distribution: CentOS 6 on my desktop, Ubuntu 12.04 LTS on my server, Ubuntu 12.04 on my netbook and the wife's PC
Posts: 1,170

Original Poster
Rep: Reputation: 95
Update 2:

A fresh install of Ubuntu 12.04 produces the same effect. With th netbook on battery the download speed is 85 KB/sec. With the charger connected the speed is 346 KB/sec. Wired connection speed is unaffected. The Broadcomm driver is properly installed. netsat -ie shows a few dropped packets on TX but actually less when the netbook is on battery. I see nothing obvious in power management regarding network or wireless NIC.

Ken

p.s. In technical terms this sucks
 
Old 06-10-2012, 12:05 PM   #4
jefro
Guru
 
Registered: Mar 2008
Posts: 10,246

Rep: Reputation: 1255Reputation: 1255Reputation: 1255Reputation: 1255Reputation: 1255Reputation: 1255Reputation: 1255Reputation: 1255Reputation: 1255
I would think that the cpu is being throttled and that affects wireless since is uses so much processor time especially with encryption.
 
Old 06-10-2012, 01:31 PM   #5
taylorkh
Senior Member
 
Registered: Jul 2006
Location: North Carolina
Distribution: CentOS 6 on my desktop, Ubuntu 12.04 LTS on my server, Ubuntu 12.04 on my netbook and the wife's PC
Posts: 1,170

Original Poster
Rep: Reputation: 95
Thanks jefro,

I was thinking that it was Canonical that SHOULD have been throttled. However, a kind person over on the Ubuntu forum had the answer http://ubuntuforums.org/showthread.p...1#post12015161. By using iwconfig I was able to turn off power management of the wireless NIC
Quote:
sudo iwconfig eth1 power off
My wireless network is now back to full speed.

Ken
 
Old 06-11-2012, 09:39 AM   #6
taylorkh
Senior Member
 
Registered: Jul 2006
Location: North Carolina
Distribution: CentOS 6 on my desktop, Ubuntu 12.04 LTS on my server, Ubuntu 12.04 on my netbook and the wife's PC
Posts: 1,170

Original Poster
Rep: Reputation: 95
But to make it stay at full speed after a reboot...http://askubuntu.com/questions/85214...eing-turned-on
I used the second approach
Quote:
Than to make it permanent run command as follows:

1.cd /etc/pm/power.d

2.sudo gedit wifi_pwr_off

This will open an empty file, copy the code below into it:

#!/bin/sh
/sbin/iwconfig wlan0 power off

3.Save the file, remember to

sudo chmod +x wifi_pwr_off

and restart
and now all is well (at least for this issue).

Ken
 
Old 06-11-2012, 03:31 PM   #7
jefro
Guru
 
Registered: Mar 2008
Posts: 10,246

Rep: Reputation: 1255Reputation: 1255Reputation: 1255Reputation: 1255Reputation: 1255Reputation: 1255Reputation: 1255Reputation: 1255Reputation: 1255
Glad you fixed it.

From the man page on iwconfig I'd have thought that that has nothing to do with throttling, just power on or off.

Last edited by jefro; 06-11-2012 at 03:35 PM.
 
Old 06-11-2012, 04:02 PM   #8
taylorkh
Senior Member
 
Registered: Jul 2006
Location: North Carolina
Distribution: CentOS 6 on my desktop, Ubuntu 12.04 LTS on my server, Ubuntu 12.04 on my netbook and the wife's PC
Posts: 1,170

Original Poster
Rep: Reputation: 95
Well I have worked around it but not I think resolved it. I found this in the Kubuntu Precise release notes
Quote:
pm-utils now has two new scripts to power down USB and various PCI devices in battery mode. A number of desktop packages were fixed to wake up less often. Both of these reduce power consumption and thus improve battery lifetime.
So I decided to have a look around for pm-utils bits and pieces. I found this script /usr/lib/pm-utils/power.d/wireless which I think is part of the issue.
Code:
#!/bin/sh

. "${PM_FUNCTIONS}"

# See if we have the usual wireless tools.
# Do not just fail because not all cards require these.
which iwpriv >/dev/null 2>&1 && have_iwpriv="true"
which iwconfig >/dev/null 2>&1 && have_iwconfig="true"

# If only all the drivers did The Right Thing with iwconfig power.
# Too bad they do not.

get_wireless_params() {
    # $1 = interface 
    # $2 = on or off
    unset iwpriv iwconfig iwlevel
    
    # Don't do anything if we cannot find a driver for this iface.
    [ -L "/sys/class/net/$1/device/driver" ] || return 1
    # Skip if not a wireless card.
    [ -d "/sys/class/net/$1/wireless" ] || return 1
    # Also don't do anything if the device is disabled
    [ "$(cat /sys/class/net/$1/device/enable)" = "1" ] || return 1
    driver="$(readlink "/sys/class/net/$1/device/driver")"
    driver=${driver##*/}
    case $driver in
        ipw2100) iwpriv_ac="set_power 0"
            iwpriv_batt="set_power 5"
            iwconfig_ac="power on"
            iwconfig_batt="power on";;
        ipw3945)
            iwpriv_ac="set_power 6"
            iwpriv_batt="set_power 7";;
        iwl*) if [ -f "/sys/class/net/$1/device/power_level" ]; then
                 iwlevel_ac=0
                 iwlevel_batt=3
              else
                 iwconfig_ac="power off"
                 iwconfig_batt="power on"
              fi;;
        *) iwconfig_ac="power off"
           iwconfig_batt="power on";;
    esac
    case $2 in
        off) [ "$iwpriv_ac" ] && iwpriv="$iwpriv_ac"
            [ "$iwconfig_ac" ] && iwconfig="$iwconfig_ac"
            [ "$iwlevel_ac" ] && iwlevel="$iwlevel_ac";;
        on) [ "$iwpriv_batt" ] && iwpriv="$iwpriv_batt"
            [ "$iwconfig_batt" ] && iwconfig="$iwconfig_batt"
            [ "$iwlevel_batt" ] && iwlevel="$iwlevel_batt";;
    esac
    return 0
}

wireless_powersave() {
    for dev in /sys/class/net/*; do
        get_wireless_params "${dev##*/}" "$1" || continue
	ret=0
	printf "Turning powersave for %s %s..." "${dev##*/}" "$1"
	if [ "$have_iwconfig" = true -a "$iwconfig" ]; then
	    iwconfig "${dev##*/}" $iwconfig || ret=1
	fi
        if [ "$have_iwpriv" = true -a "$iwpriv" ]; then
	    iwpriv "${dev##*/}" $iwpriv || ret=1
	fi
        if [ "$iwlevel" ]; then
	    echo "$iwlevel" > "$dev/device/power_level" || ret=1
	fi
	[ "$ret" -eq 0 ] && echo Done. || echo Failed.
    done
}

case $1 in
    true) wireless_powersave on ;;
    false) wireless_powersave off ;;
    *) exit $NA ;;
esac

exit 0
I think there is still a bug. If I execute
Quote:
sudo iwconfig eth1 power off
sudo iwconfig eth1

eth1 IEEE 802.11bg ESSID:"Luca$Electric"
Mode:Managed Frequency:2.412 GHz Access Point: 00:26:F2:7D:77:3C
Bit Rate=54 Mb/s Tx-Power:24 dBm
Retry min limit:7 RTS thr : off Fragment thr : off
Power Management : off
Link Quality=5/5 Signal level=-31 dBm Noise level=-57 dBm
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:0 Invalid misc:0 Missed beacon:0
I see that power management has been turned off. If I execute
Quote:
sudo iwconfig eth1 power on
sudo iwconfig eth1

eth1 IEEE 802.11bg ESSID:"Luca$Electric"
Mode:Managed Frequency:2.412 GHz Access Point: 00:26:F2:7D:77:3C
Bit Rate=54 Mb/s Tx-Power:24 dBm
Retry min limit:7 RTS thr : off Fragment thr : off
Power Managementmode : All packets received
Link Quality=5/5 Signal level=-30 dBm Noise level=-57 dBm
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:0 Invalid misc:0 Missed beacon:0
I see that it is back on. However, if I turn power management off then reboot the computer I find that power management is SHOWN to be off but by the action of the wireless NIC power management is still in effect. I have yet to track down the blame/fix.

Ken
 
Old 06-13-2012, 09:18 AM   #9
taylorkh
Senior Member
 
Registered: Jul 2006
Location: North Carolina
Distribution: CentOS 6 on my desktop, Ubuntu 12.04 LTS on my server, Ubuntu 12.04 on my netbook and the wife's PC
Posts: 1,170

Original Poster
Rep: Reputation: 95
For reasons not related to this thread I reinstalled Ubuntu 12.04 on the netbook. I applied the same fixes as described here. THE PROBLEM IS NOT FIXED. My script in /etc/pm/power.d is NOT running(?) I have also tried building an upstart job and that is not running.

Ken

p.s. How do I mark this thread [UNSOLVED] ?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
I cannot enable my wireless connection. I am running on Opensuse 11.2. Opportunity Linux - Newbie 3 02-08-2010 01:27 PM
Running Ubuntu 7.04, Wireless connection problems david@scipio Linux - Distributions 1 05-08-2007 01:07 PM
with APM I have no battery monitor, but with ACPI I lose my wireless connection mantis Linux - Laptop and Netbook 2 04-08-2005 06:11 PM
Wireless Connection on a pc card to a laptop running Fedora core 3 gets dropped often shanvo Linux - Wireless Networking 0 01-11-2005 01:56 PM
Battery doesn't keep charge after running BIOS Battery Discharge/Charge Utility dan.leonard Linux - Laptop and Netbook 0 09-28-2004 01:07 PM


All times are GMT -5. The time now is 08:38 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration