Difference between revisions of "Amahi Energy Saver"

From Amahi Wiki
Jump to: navigation, search
Line 38: Line 38:
  
 
==Command Line Interface==
 
==Command Line Interface==
*Note: Currently, you need to be root and navigate to /usr/share/aes to use the CLI correctly
+
*Note: Currently root priviledges are required to execute the CLI command. Navigate to /usr/share/aes to use the CLI correctly.
  
<code>./aes.rb --showmonitoredhosts</code>
+
<code>./aes.rb --showmonitoredhosts</code><br>
 
Show a list of all hosts which are monitored by AES, and also allows to delete hosts from the list. If these hosts are up and running (and respond to ping), the server does not suspend.
 
Show a list of all hosts which are monitored by AES, and also allows to delete hosts from the list. If these hosts are up and running (and respond to ping), the server does not suspend.
  
<code>./aes.rb --shownetworkhosts</code>
+
<code>./aes.rb --shownetworkhosts</code><br>
 
Lists the hosts found in the network and gives the user the choice to add them. This is useful to quickly fill the list of monitored hosts.
 
Lists the hosts found in the network and gives the user the choice to add them. This is useful to quickly fill the list of monitored hosts.
  
<code>./aes.rb --addhost macadress</code>
+
<code>./aes.rb --addhost macadress</code><br>
Manually add a host to the list of monitores hosts. Observe the MAC address format, which has to be XX:XX:XX:XX:XX:XX. Example is 12:34:56:78:90:ab
+
Manually add a host to the list of monitores hosts. Observe the MAC address format, which has to be XX:XX:XX:XX:XX:XX. Example is <br> <code>./aes.rb --addhost 12:34:56:78:90:ab</code>
  
<code>./aes.rb --showcalendar</code>
+
<code>./aes.rb --showcalendar</code><br>
 
Lists the current calendar entries. Calendar entries define times when the server does not suspend. Also, the server will be woken up at the beginning of a calendar entry.
 
Lists the current calendar entries. Calendar entries define times when the server does not suspend. Also, the server will be woken up at the beginning of a calendar entry.
  
<code>./aes.rb --addcalendar startdate starttime stopdate stoptime</code>
+
<code>./aes.rb --addcalendar startdate starttime stopdate stoptime</code><br>
Use this command to add an entry to the calendar. Format of stardate/stopdate: YYYY-MM-DD Format of starttime/stoptime: hhm:mm. Eg. amahienergysaver --addcalendar 2010-12-20 15:00 2010-12-20 16:00 will keep the server awake on Dec 20th, 2010 from 15 to 16 hrs (3 to 4 pm). The server will also wake up at 15 hrs if it is suspended.
+
Use this command to add an entry to the calendar. Format of startdate/stopdate: YYYY-MM-DD Format of starttime/stoptime: hhm:mm. Eg.  
 +
<br><code>./aes.rb  --addcalendar 2010-12-20 15:00 2010-12-20 16:00</code> <br>
 +
will keep the server awake on Dec 20th, 2010 from 15 to 16 hrs (3 to 4 pm). The server will also wake up at 15 hrs if it is suspended.
  
<code>./aes.rb --shutdowntype</code>
+
<code>./aes.rb --shutdowntype</code><br>
 
Show and modifiy the type of shutdown. NOTE: Not all shutdown types may be supported on your system, or may work correctly. Therefore, test that your machine is suspending and coming up correctly before deciding for a setting. Poweroff is safest type.
 
Show and modifiy the type of shutdown. NOTE: Not all shutdown types may be supported on your system, or may work correctly. Therefore, test that your machine is suspending and coming up correctly before deciding for a setting. Poweroff is safest type.
  
<code>./aes.rb --sbs [on|off|debug]</code>
+
<code>./aes.rb --sbs [on|off|debug]</code><br>
--sbs alone shows the current setting of aes. The parameters on and of switch monitoring of Squeezeboxserver on or off, respectively. The debug option displays diagnostic information
+
<code>./aes.rb --sbs</code> shows the current setting of aes. <code>./aes.rb --sbs on</code> and <code>./aes.rb --sbs off</code> switch monitoring of Squeezeboxserver on or off, respectively. The command <code>./aes.rb --sbs debug</code> displays diagnostic information
  
<code>./aes.rb --help</code>
+
<code>./aes.rb --help</code><br>
 
Displays command line help
 
Displays command line help
  

Revision as of 13:33, 11 January 2011

General

This project is in alpha stage. It runs fine on my machine, however I need more feedback from the community to be sure that it's stable enough for the general public. So, please test and report your experience!


Introduction

Running servers when they are not needed can waste a considerable amount of energy. This project aims at sending Amahi server to suspend or poweroff when not needed.

To do so, Amahi Energy Saver regularly scans for connected clients. If no client is connected, the system suspends after a configurable period.

Amahi Energy Saver also checks shares. As long as shares are accessed, the server does not suspend. If set up to do so, Squeezeboxserver is monitored to prevent suspend while Squeezeboxes are turned on.

When the system is to be used again, simply wake it up with WOL (ref. http://en.wikipedia.org/wiki/Wake-on-LAN). There are many tools to generate WOL packets, and it is even possible to wake your server over the internet (good link: http://www.wakeonlan.me/).

One can also define scheduled wake ups and periods during which the server shall stay awake no matter what.


Download

Download the latest version here: http://code.google.com/p/amahienergysaver/downloads/list


Initial setup

1. Copy the tar.gz file from the download page to some folder and unpack it with tar -zxf filename.

2. Open a terminal, change to that folder and get superuser rights by running su

3. As root, run ./aes-install.sh

4. Navigate to /usr/bin/aes and run ./aes.rb --shownetworkhosts to show and select to add any currently active network host to the list of monitored hosts. Run ./aes.rb --showmonitoredhosts to check the monitored hosts and delete the ones you want to remove.

5. As root, run service aes start to start the service, and chkconfig aes on to make the service start on boot. Be careful, when you start the service the sytem MAY go to sleep when you don't expect it.

Logs

Logs are located in /usr/share/aes and named aes.log.*


Command Line Interface

  • Note: Currently root priviledges are required to execute the CLI command. Navigate to /usr/share/aes to use the CLI correctly.

./aes.rb --showmonitoredhosts
Show a list of all hosts which are monitored by AES, and also allows to delete hosts from the list. If these hosts are up and running (and respond to ping), the server does not suspend.

./aes.rb --shownetworkhosts
Lists the hosts found in the network and gives the user the choice to add them. This is useful to quickly fill the list of monitored hosts.

./aes.rb --addhost macadress
Manually add a host to the list of monitores hosts. Observe the MAC address format, which has to be XX:XX:XX:XX:XX:XX. Example is
./aes.rb --addhost 12:34:56:78:90:ab

./aes.rb --showcalendar
Lists the current calendar entries. Calendar entries define times when the server does not suspend. Also, the server will be woken up at the beginning of a calendar entry.

./aes.rb --addcalendar startdate starttime stopdate stoptime
Use this command to add an entry to the calendar. Format of startdate/stopdate: YYYY-MM-DD Format of starttime/stoptime: hhm:mm. Eg.
./aes.rb --addcalendar 2010-12-20 15:00 2010-12-20 16:00
will keep the server awake on Dec 20th, 2010 from 15 to 16 hrs (3 to 4 pm). The server will also wake up at 15 hrs if it is suspended.

./aes.rb --shutdowntype
Show and modifiy the type of shutdown. NOTE: Not all shutdown types may be supported on your system, or may work correctly. Therefore, test that your machine is suspending and coming up correctly before deciding for a setting. Poweroff is safest type.

./aes.rb --sbs [on|off|debug]
./aes.rb --sbs shows the current setting of aes. ./aes.rb --sbs on and ./aes.rb --sbs off switch monitoring of Squeezeboxserver on or off, respectively. The command ./aes.rb --sbs debug displays diagnostic information

./aes.rb --help
Displays command line help


Windows client

On the download page there is a Windows client for automatic or manual wakeup of the HDA.

  • Installation

Just run the msi file found on the download page. The client will be included in the startup folder.

  • Configuration

1. Form the start menu, run AmahiEnergySaver -> AES Client

2. Right click on the icon that will appear in symbol bar, and select "Show config"

3. To get started, make sure that you set "Host MAC" and "Host name" to your HDA configuration. Set port if required, the default "9" should work in mos cases. Set "Subnet LAN" to your subnet, the default value should work if you network is configured as 192.168.0.

4. Hit the "OK" butten, then right click on the symbol again and restart the program according to 1.

5. Done! You should now be able to start your HDA by right clicking on the icon in the symbol bar and select "Wake now"