Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Sun 14 Sep 2014, 22:24
All times are UTC - 4
 Forum index » House Training » Users ( For the regulars )
Power saving trick for laptops - BETA
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [12 Posts]  
Author Message
Shel

Joined: 11 Apr 2009
Posts: 103
Location: Seattle, WA, USA, or Southern France

PostPosted: Sun 30 May 2010, 21:05    Post subject:  Power saving trick for laptops - BETA
Subject description: If your laptop battery runs down while the machine is "off" ....
 

Folks-

Linux has a long-standing problem with running down the battery of certain laptop machines when the machine is "off."

This affects many Toshibas, but has been reported with other brands. It affects many, maybe all, recent versions of Linux, Puppy and Ubuntu included. It certainly affected Puppy 4.3.1 on my Toshiba Portege R100.

After some investigation, I discovered that the machine's internal Ethernet card was still running after Puppy shut down the machine. Since "Wake-on-LAN" was disabled in the machines BIOS, I thought this a bit bizarre.

Solving the problem turned out to be fairly simple; unload the driver module (e100 for the R100) before shutting down.

To see if this problem affects your computer, check the lights on either the machine's Ethernet port or the hub/switch/router it is plugged into. If the lights are on after Puppy shuts down the box, you have the problem.

The following script attempts to unload all the networking modules:
Code:

#!/bin/sh
#
# Unload the Ethernet drivers on shutdown to prevent battery drain.
# STH 28 May 2010, after the rc.pcmcia script by BK.
# For Puppy Linux 4.3.1

case "$1" in
   start)      # Puppy loads the drivers at bootup, we don't have to!
      ;;
   stop)
       echo -n "Shutting down Ethernet services: " > /dev/console
      for i in `/sbin/lsmod | cut -d' ' -f1` ; do
         if grep -q "^$i " /etc/networkmodules; then
            /sbin/modprobe -r "$i" && echo -n "$i " > /dev/console
         fi
      done
      echo > /dev/console
                sleep 2 # take this out once testing complete
      ;;
   restart)
      ;;
esac

# END


Drop this script into /etc/init.d (for Puppy 4.3.1) or whatever directory has its scripts run on shutdown, make it executable, and watch the screen on your next shutdown. If you see a quick message about unloading, and if a repeat of the port test shows the port is now inactive when the machine has been shut down, you're on velvet.

-Shel
Back to top
View user's profile Send private message 
abushcrafter


Joined: 30 Oct 2009
Posts: 1447
Location: England

PostPosted: Mon 31 May 2010, 14:48    Post subject:  

I have put the contents of your post in Shell script form. So others don't have too when they use it and want the info in the script.

Code:
#!/bin/sh
#Puppy Linux Discussion Forum :: View topic - Power saving trick for laptops - BETA - http://www.murga-linux.com/puppy/viewtopic.php?t=56238
#Post subject:  Power saving trick for laptops - BETA
#Subject description: If your laptop battery runs down while the machine is "off"
#
#Linux has a long-standing problem with running down the battery of certain laptop machines when the machine is "off."
#
#This affects many Toshibas, but has been reported with other brands. It affects many, maybe all, recent versions of Linux, Puppy and Ubuntu included. It certainly affected Puppy 4.3.1 on my Toshiba Portege R100.
#
#After some investigation, I discovered that the machine's internal Ethernet card was still running after Puppy shut down the machine. Since "Wake-on-LAN" was disabled in the machines BIOS, I thought this a bit bizarre.
#
#Solving the problem turned out to be fairly simple; unload the driver module (e100 for the R100) before shutting down.
#
#To see if this problem affects your computer, check the lights on either the machine's Ethernet port or the hub/switch/router it is plugged into. If the lights are on after Puppy shuts down the box, you have the problem.
#
#The following script attempts to unload all the networking modules:
#
# Unload the Ethernet drivers on shutdown to prevent battery drain.
# STH 28 May 2010, after the rc.pcmcia script by BK.
# For Puppy Linux 4.3.1

case "$1" in
   start)      # Puppy loads the drivers at bootup, we don't have to!
      ;;
   stop)
       echo -n "Shutting down Ethernet services: " > /dev/console
      for i in `/sbin/lsmod | cut -d' ' -f1` ; do
         if grep -q "^$i " /etc/networkmodules; then
            /sbin/modprobe -r "$i" && echo -n "$i " > /dev/console
         fi
      done
      echo > /dev/console
                sleep 2 # take this out once testing complete
      ;;
   restart)
      ;;
esac

# END

#Drop this script into /etc/init.d (for Puppy 4.3.1) or whatever directory has its scripts run on shutdown, make it executable, and watch the screen on your next shutdown. If you see a quick message about unloading, and if a repeat of the port test shows the port is now inactive when the machine has been shut down, you're on velvet.
#
#-Shel
Back to top
View user's profile Send private message Visit poster's website 
Flapdoodle

Joined: 03 Jul 2008
Posts: 32

PostPosted: Thu 03 Jun 2010, 08:52    Post subject: Re: Power saving trick for laptops - BETA
Subject description: If your laptop battery runs down while the machine is "off" ....
 

Quote:
If your laptop battery runs down while the machine is "off"


Is this a problem whether LAN is used or not?

In other words, is the LAN turned on by probing when Puppy boot then left on?
Back to top
View user's profile Send private message 
BarryK
Puppy Master


Joined: 09 May 2005
Posts: 7047
Location: Perth, Western Australia

PostPosted: Thu 03 Jun 2010, 22:40    Post subject:  

Very interesting, shel thanks for that.
I have incorporated it into /etc/rc.d/rc.shutdown in Woof.

_________________
http://bkhome.org/news/
Back to top
View user's profile Send private message Visit poster's website 
Shel

Joined: 11 Apr 2009
Posts: 103
Location: Seattle, WA, USA, or Southern France

PostPosted: Fri 04 Jun 2010, 00:18    Post subject: Re: Power saving trick for laptops - BETA
Subject description: If your laptop battery runs down while the machine is "off" ....
 

Flapdoodle wrote:
Is this a problem whether LAN is used or not?

It is on my laptop.

Quote:
In other words, is the LAN turned on by probing when Puppy boot then left on?

I think it's turned on by loading the driver module (e100 in my case).

-Shel
Back to top
View user's profile Send private message 
Shel

Joined: 11 Apr 2009
Posts: 103
Location: Seattle, WA, USA, or Southern France

PostPosted: Fri 04 Jun 2010, 00:19    Post subject:  

BarryK wrote:
Very interesting, shel thanks for that.
I have incorporated it into /etc/rc.d/rc.shutdown in Woof.

My pleasure, sir!

-Shel
Back to top
View user's profile Send private message 
ferikenagy

Joined: 20 Nov 2006
Posts: 53

PostPosted: Fri 04 Jun 2010, 02:22    Post subject: wake on lan
Subject description: testing Wake On Lan before getting network down
 

before unloading network module it should be made an test that Wake On Lan (WOL) is disabled. by command:


# ethtool eth0
Settings for eth0:
Supported ports: [ TP MII ]
Supported link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
Supports auto-negotiation: Yes
Advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
Advertised pause frame use: No
Advertised auto-negotiation: Yes
Link partner advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
Link partner advertised pause frame use: No
Link partner advertised auto-negotiation: Yes
Speed: 100Mb/s
Duplex: Full
Port: MII
PHYAD: 32
Transceiver: internal
Auto-negotiation: on
Supports Wake-on: pumbg
Wake-on: d
Current message level: 0x00000007 (7)
Link detected: yes
#
if " Wake-on: d " , then WOL is d-isabled and the network module should be unload from memory, network card pushed down, but instead of 'd' parameter is anything else from "Supports Wake-on:pumbg" (g,p,s,u,b) putting down the network card should be skipped because it means the user want to use the WOL .
At hardware reset the WOL is disabled so "Wake-on: d " parameter is guaranteed.

in almost modern laptops this function (WOL) is not available when is running from battery, only from the main power supply because the hardware periferials (network card, USB...) are unpowered in battery mode.
Back to top
View user's profile Send private message Yahoo Messenger 
Shel

Joined: 11 Apr 2009
Posts: 103
Location: Seattle, WA, USA, or Southern France

PostPosted: Fri 04 Jun 2010, 11:40    Post subject: Re: wake on lan
Subject description: testing Wake On Lan before getting network down
 

ferikenagy wrote:
before unloading network module it should be made an test that Wake On Lan (WOL) is disabled. by command:

# ethtool eth0.

In my experience, ethtool is not a reliable indicator of WOL status.

On my Toshiba Portege R100, WOL is reported by the BIOS as disabled, but ethtool reports it as "g" or enabled.

I discovered this as part of my investigation into the battery drain problem. I had already checked the BIOS settings for likely candidates, but when I discovered that the Ethernet port was active when the machine was off, I double-checked. Yep, WOL disabled in BIOS, but reported as active by ethtool.

Just FWIW, I was professionally involved in IT since the days it was known as "DP"; I've never had occasion to use WOL, nor, in fact, seen it used on any site where I've worked. I'd say the benefit of turning off the card will accrue to many more users than will the inconvenience of disabling WOL.

You are correct, however, in that unloading the module will hose WOL, and it's good to have that brought up. I expect that the Puppy user base won't care, and that anyone who does will be clever enough to fix the shutdown script.

-Shel
Back to top
View user's profile Send private message 
ferikenagy

Joined: 20 Nov 2006
Posts: 53

PostPosted: Mon 14 Jun 2010, 14:21    Post subject: unloading eth module onpower off with WOL active  

thanks for your answer. The fact is am using Wake On Lan on puppy,in a very simple way, one of my puppy computer is the LAN printer server too (CUPS does a good job as LAN printer server ), and my brother who is in different location wakes up the computer before printing, and after some inactivity time it automaticaly shut down.
I can imagine other uses of WOL, for example if puppy computer is the gateway for internet in LAN, and after inactivity it power off, but any physical lan activity could power up the puppy computer, or it could be power up from the internet if puppy has an ftp or http server on it , it could be one of my future project to test, so the aproach is to stay green to turn of computer when not needed , that why WOL is for!. So even if you had right that nobody use it (exept solely) me, in the future it should be use to save energy to be more enviroment friendly. I presume it could be an good question what will decide the future of WOL in puppy: some quinky defective bios or hardware example like in your computer or on of the future philosophy of saveing green the planet?
Maybe we can find an middle aproach for this problem. I have not tested but the WOL is implemented at hardware level on the ethernet card, and it wakes the computer on an hardware intrerupt signal, the computer is powered down, so if the WOL is activated and computer is power down it should not neded the module. The problem is I supose to unload the module without afecting WOL state of the card and without making before power of an software disable of the card: "ifconfig eth0 down". Maybe it should work.
So maybe it worth to make a litle more efort not to simply eradicate the WOL from puppy, and try to unload the module on defective computer...
Back to top
View user's profile Send private message Yahoo Messenger 
8-bit


Joined: 03 Apr 2007
Posts: 3368
Location: Oregon

PostPosted: Mon 14 Jun 2010, 20:52    Post subject:  

I have a Toshiba Satellite L550 series laptop and I have had no problem with the lan, but if I have a USB digital mouse plugged in when I shut down the PC, sometimes the led in the mouse fails to shut off.
But it is NOT just a linux problem as I have had it happen with Win 7 64bit also.
Back to top
View user's profile Send private message 
Shel

Joined: 11 Apr 2009
Posts: 103
Location: Seattle, WA, USA, or Southern France

PostPosted: Mon 05 Jul 2010, 17:27    Post subject:  

Maybe it's keeping the USB ports "hot" so you can use them to recharge your cellphone or something.

I wish that sort of stuff were more configurable!

-Shel
Back to top
View user's profile Send private message 
Cranky-9

Joined: 05 Sep 2011
Posts: 1

PostPosted: Mon 05 Sep 2011, 05:01    Post subject:  

Great program which I use on my laptop with Arch Linux.
But I wonder where “However, laptop mode is disabled by default in Ubuntu Edgy (6.10)” came from. Very Happy Is anyone still using that version of Ubuntu? Is wasn’t even LTS. travel guide
Back to top
View user's profile Send private message Visit poster's website 
Display posts from previous:   Sort by:   
Page 1 of 1 [12 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » House Training » Users ( For the regulars )
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0897s ][ Queries: 12 (0.0042s) ][ GZIP on ]