Wireless slow on battery power [Solved]

Issues Related to Networking (Wired and Wireless)

Moderator: Moderators

Wireless slow on battery power [Solved]

Postby j_futurama » Fri Jan 21, 2011 23:13

Hi im using sabayon 5.4 G and im having some trouble with power saving on my broadcom BCM43225 802.11b/g/n (rev 01) wireless as when its on battery power it is at about a fifth of its speed plugged in. iwconfig eth0 power off fixes the problem but when i reboot i have to do it again, how would i save that?
j_futurama
Baby Hen
 
Posts: 3
Joined: Fri Jan 21, 2011 23:03

Re: Wireless slow on battery power

Postby Fitzcarraldo » Fri Jan 21, 2011 23:34

Open a Konsole/Terminal window, log in as root user, and use the nano editor to add that command to the file /etc/conf.d/local:

Code: Select all
$ su
Password: <--- Enter the root user's password
# nano /etc/conf.d/local
'
' Edit the file and exit from nano
(see the command menu that nano displays along the bottom of the console window)
'
'
# exit
$ exit

Here is what the file should look like:

Code: Select all
# Here is where you can put anything you need to start
# that there is not an init script for.

local_start() {
        # This is a good place to load any misc programs
        # on startup (use &>/dev/null to hide output)

        # The following line added by j_futurama on 21 Jan. 2011
        iwconfig eth0 power off

        # We should always return 0
        return 0
}

local_stop() {
        # This is a good place to unload any misc.
        # programs you started above.

        # We should always return 0
        return 0
}
User avatar
Fitzcarraldo
Sagely Hen
 
Posts: 7985
Joined: Sat Mar 10, 2007 5:40
Location: United Kingdom

Re: Wireless slow on battery power

Postby k4ph » Sat Jan 22, 2011 10:27

Thanks to both of you, j_futurama and Fitzcaraldo, the problem with my Broadcom 4313 on my Compaq Presario CQ56-103 is gone. I contacte directly broadcom before and didn't get an answer yet, why the hell on battery mode the wireless dropped from 780k to 7 k dataflow.
The hint for iwconfig eth1 power off (in my case it is eth1 not eth0) was the solution to the problem and the second hint for putting the command into the /etc/conf.d/local is the one and forever solution. :mrgreen:

A much happier

Karl
[email protected] | [email protected] | http://c4ph.tumblr.com
k4ph
Simple Hen
 
Posts: 55
Joined: Mon Nov 01, 2010 0:52
Location: Germany

Re: Wireless slow on battery power

Postby j_futurama » Sat Jan 22, 2011 14:15

Ok thanks but that hasnt worked unfortunately do i need to give extra permission or sudo or something? At the moment im just clicking a script on my desktop but that needs sudo would i be able to put a link to that in /etc/conf.d/local but without the needing the password.
j_futurama
Baby Hen
 
Posts: 3
Joined: Fri Jan 21, 2011 23:03

Re: Wireless slow on battery power

Postby Fitzcarraldo » Sat Jan 22, 2011 18:51

You don't need to use sudo, as /etc/conf.d/local is used by the root user. You also don't need any scripts; the exact command you enter in /etc/conf.d/local is run by root towards the end of the boot process. So it should work, as it does for k4ph. Please post here the contents of the file /etc/conf.d/local so we can double-check its contents.

It could be that, in your case, your network connection is not up by the time the commands in /etc/conf.d/local are executed. There is a simple hack to get around that: just tell the OS to delay running the command for a few seconds. The simplest way to do that is to use the sleep command. Edit the file /etc/conf.d/local as shown below:

Code: Select all
# Here is where you can put anything you need to start
# that there is not an init script for.

local_start() {
        # This is a good place to load any misc programs
        # on startup (use &>/dev/null to hide output)

        # The following line added by j_futurama on 22 Jan. 2011
        sleep 10s && iwconfig eth0 power off

        # We should always return 0
        return 0
}

local_stop() {
        # This is a good place to unload any misc.
        # programs you started above.

        # We should always return 0
        return 0
}
User avatar
Fitzcarraldo
Sagely Hen
 
Posts: 7985
Joined: Sat Mar 10, 2007 5:40
Location: United Kingdom

Re: Wireless slow on battery power

Postby j_futurama » Sat Jan 22, 2011 20:21

Yes thats working now although 10s still wasnt enough :? i've put 60s on for now just to make sure it would have time and will keep dropping it till i find the right time. Thank you.
j_futurama
Baby Hen
 
Posts: 3
Joined: Fri Jan 21, 2011 23:03

Re: Wireless slow on battery power [Solved]

Postby Joecanadian » Wed Jun 01, 2011 15:34

As an FYI, in light of the missing /etc/conf.d/local issue -- as discussed in http://forum.sabayon.org/viewtopic.php?t=23741 -- another workaround for slow wireless on battery is provided at http://www.hitxp.com/articles/software/ubuntu-fix-slow-wireless-internet-connection-speed-upgrading-11-04-natty-narwhal/

Long story made short:

in terminal, as superuser, nano /etc/pm/power.d/wireless

add following code, substituting actual wireless device (ie, eth0, eth1 etc) for wlan0 as appropriate
Code: Select all
#!/bin/sh

/sbin/iwconfig wlan0 power off


write out, confirm save and exit nano

reboot

retry connection on battery
User avatar
Joecanadian
Baby Hen
 
Posts: 19
Joined: Tue May 15, 2007 1:10


Return to Networking and Wireless

Who is online

Users browsing this forum: No registered users and 1 guest

cron