# Auto on/off PC. Is that possible?



## cynosure (Jun 10, 2007)

Recently a friend of mine told me that if I connect the serial port of my PC to the serial port of my UPS, then by configuring some windows scheduling services my PC will shut down after only 5% of the battery power remains in case of any power failure!
I dont know if that is possible in windows but if it then I wanna ask whether it is possible in ubuntu too??? If yes, then please either tell me or provide me with any link to do it.

And is there any way to automatic start the PC if the current comes in the socket in which I have plugged in the UPS.

The latter query is kinda absurd but even if the former works then please tell me how to do that.


----------



## praka123 (Jun 11, 2007)

yes,it seems ur too lazy with computers 
for ups walla system,there is a software called apcupsd.yes the same which uses usb connector,right? 

*Apcupsd a daemon for controlling APC UPSes*

*Apcupsd *can be used for power mangement and controlling most of APC's UPS models on Unix and Windows machines. Apcupsd works with most of APC's Smart-UPS models as well as most simple signalling models such a Back-UPS, and BackUPS-Office. During a power failure, *apcupsd* will inform the users about the power failure and that a shutdown may occur. If power is not restored, a system shutdown will follow when the battery is exhausted, a timeout (seconds) expires, or runtime expires based on internal APC calculations determined by power consumption rates. Apcupsd is licensed under the GPL version 2. 

**www.apcupsd.org/*

these packages may be available already in synaptic(apt) so dont go compiling from source.also it may need to run some cron jobs too.
if with Ubuntu,i found a nice howto:  and GIYF

*ubuntuforums.org/showthread.php?t=114748
*linuxappfinder.com/package/apcupsd


----------



## cynosure (Jun 11, 2007)

^^Thanks man.
But there's a little problem. I think my ups has only a serial port (no usb)

Hey but can anybody help me with my UPS. It came with my Compaq PC and has "UPS AVR 500" written on the front.

In the rear part the model # is written as CQ500 (I think CQ means compaq).
I even tried searching APC's site but doesnt show any UPS like I have

So is their any way I can find what type is my UPS (BackUPS or USB thingy)


----------



## Lucky_star (Jun 11, 2007)

You cannot turn on a computer automatically from Shutdown state.
But if you keep the system in hibernation mode, then its posible to wake up or shutdown/hibernate the system automatically at a scheduled time. There are softwares available for it(its or Windows, I don't know for linux).

You can design a device which senses the power availability and automatically presses the power button by a mechanical hand.


----------



## akshaykapoor_3 (Jun 11, 2007)

But for that your motherboard should support the feature (Auto Startup from hibernation)....i have 810e chipset...mine doesnt


----------



## praka123 (Jun 11, 2007)

@dynosure:
ur wanted program is upsd
*www.boutell.com/lsm/lsmbyid.cgi/001767


> *upsd*: UPS Monitor Program Upsd is a UPS monitor program. It supports both local monitoring of a UPS that is directly connected to the computer's serial port and remote monitoring over a network. Remote monitoring is done by polling the master upsd (the one with the direct serial connection to the UPS). There are a number of options to control the poll interval and the delay before shutdown.


another one is powstatd:


> Description: Configurable UPS monitoring daemon
> Assuming you have a relay-based "dumb" UPS that corresponds with your
> machine via a serial connection, you should be able to configure powstatd
> in just a few minutes. It is easily configured, and can be expected to
> ...






			
				Lucky_star said:
			
		

> You cannot turn on a computer automatically from Shutdown state.
> But if you keep the system in hibernation mode, then its posible to wake up or shutdown/hibernate the system automatically at a scheduled time. There are softwares available for it(its or Windows, I don't know for linux).
> 
> You can design a device which senses the power availability and automatically presses the power button by a mechanical hand.


 supported in GNU/Linux already.in Ubuntu too.u can refer *ubuntuforums.org


----------



## cynosure (Jun 11, 2007)

Thanks guys.
Will try this and then I'll let you know.

@praka123: Man youre a hero!!


----------



## nileshgr (Jun 11, 2007)

You can connect Serial Port (9 pin) to USB using Serial-USB converter available in the market costing Rs. 800. I have one but i used it for something which i don't remember that too in XP. But i have never tried in Linux.


----------



## cynosure (Jun 11, 2007)

^^ No bro, I am not getting it.
800 bucks
And what will happen if my PC does not shut down even after all these thingies


----------



## xbonez (Jun 11, 2007)

^^nothing, just ur ups battery will drain out. its not gud for the ups though. it'll charge but it mustn't happen often or ur batt will konk out


----------



## nileshgr (Jun 12, 2007)

cynosure said:
			
		

> ^^ No bro, I am not getting it.
> 800 bucks
> And what will happen if my PC does not shut down even after all these thingies



That converter converts RS-232 to USB interface. 
See this connector:

*www.satmonkey.com/images/satmonkey/RS232.jpg

and

This is what the cable i meant:

*img.alibaba.com/photo/51343029/USB_to_RS232_Cable.jpg


----------

