Difference between revisions of "Kernel-power"

From Bashlinux
Jump to: navigation, search
Line 2: Line 2:
 
= Power Management =
 
= Power Management =
 
== ACPI ==
 
== ACPI ==
==== Suspend ====
+
=== How to switch to standby mode ===
Issue the following command on the terminal to be suspended:
+
Issue the following command on the terminal to switch to suspend mode:
 
 
 
<pre><nowiki>
 
<pre><nowiki>
Line 10: Line 10:
   
   
==== Wake ====
+
=== How to perform a Wake-On-LAN (WoL) ===
 
From a remote terminal isue the following command:
 
From a remote terminal isue the following command:
 
 
Line 61: Line 61:
   
 
== dpms ==
 
== dpms ==
==== vbetool ====
+
=== How to manage the power on monitor with vbetool ===
 
The screen can be handled directly from command line by executing `vbetool` command.
 
The screen can be handled directly from command line by executing `vbetool` command.
   
Line 76: Line 76:
 
</nowiki></pre>
 
</nowiki></pre>
   
  +
==== xorg ====
 
  +
'''xorg'''
  +
 
Ensure the following line is present in `/etc/X11/xorg.conf` in order to let GUI handle the blank screen.
 
Ensure the following line is present in `/etc/X11/xorg.conf` in order to let GUI handle the blank screen.
 
 

Revision as of 17:10, 3 November 2012

Power Management

ACPI

How to switch to standby mode

Issue the following command on the terminal to switch to suspend mode:

 echo mem > /sys/power/state
 


How to perform a Wake-On-LAN (WoL)

From a remote terminal isue the following command:

 ether-wake 11:22:33:AA:BB:CC
 
where `11:22:33:AA:BB:CC` is the mac address of the terminal to be waked up.

Alternatively the following python code could be useful to wake up a terminal

 #!/usr/bin/python

 # Wake-On-LAN
 #
 # Copyright (C) 2002 by Micro Systems Marc Balmer
 # Written by Marc Balmer, [email protected], http://www.msys.ch/
 # This code is free software under the GPL

 import struct, socket

 def WakeOnLan(ethernet_address):

   # Construct a six-byte hardware address

   addr_byte = ethernet_address.split(':')
   hw_addr = struct.pack('BBBBBB', int(addr_byte[0], 16),
     int(addr_byte[1], 16),
     int(addr_byte[2], 16),
     int(addr_byte[3], 16),
     int(addr_byte[4], 16),
     int(addr_byte[5], 16))

   # Build the Wake-On-LAN "Magic Packet"...

   msg = '\xff' * 6 + hw_addr * 16

   # ...and send it to the broadcast address using UDP

   s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
   s.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1)
   s.sendto(msg, ('<broadcast>', 9))
   s.close()

 # Example use
 WakeOnLan('00:16:CB:A2:96:C4')
 


dpms

How to manage the power on monitor with vbetool

The screen can be handled directly from command line by executing `vbetool` command.

To power off screen run the following command:

 /usr/sbin/vbetool dpms off
 

To power on screen run the following command:

 /usr/sbin/vbetool dpms on
 


xorg

Ensure the following line is present in `/etc/X11/xorg.conf` in order to let GUI handle the blank screen.

 Option "DPMS"