Author Topic: Power Down in the event of a power outage  (Read 3294 times)

Techstyle

  • Addicted
  • *
  • Posts: 674
    • View Profile
    • Techstyle UK Ltd.
Power Down in the event of a power outage
« on: December 19, 2011, 07:44:24 pm »
My core is currently attached to a small UPS so that when there is a power outage the core remains live.  This solved the initial issue I had which was to stop my core going down during lighning storms in summer when the power would be out of under a few seconds.  However, if the power is out for over 10 minutes then my core abruptly shutsdown and bad things can happen.

I have thought of a few ways to overcome this:
1.  Hardware - buy a UPS with a USB port that will inform the PC if there is no Power (Some APC models do this)
2.  Software - is there a way LMCE can look at an 'appliance' (MD, TV, Reciever, externally powered Z-wave dongle, etc) that should alway be 'connected' (RS232, Ethernet, USB etc) and if it isn't there then wait 5 mins and then power down? with the MD it must send a wake up over LAN first, I guess. 

How are others approaching this?

merkur2k

  • Addicted
  • *
  • Posts: 513
    • View Profile
Re: Power Down in the event of a power outage
« Reply #1 on: December 19, 2011, 08:09:26 pm »
the UPS route is going to be easiest, and the tools already exist for it.
as you mention, APC is the best choice for this, and there is a daemon for linux to monitor it and respond appropriately.
I'm sure something else could be figured out given the flexibility of lmce, but thats gonna be your best bet to get going right away.

Techstyle

  • Addicted
  • *
  • Posts: 674
    • View Profile
    • Techstyle UK Ltd.
Re: Power Down in the event of a power outage
« Reply #2 on: December 19, 2011, 10:32:23 pm »
Problem is I already have the UPS and didn't think to get the one with this feature

Marie.O

  • Administrator
  • LinuxMCE God
  • *****
  • Posts: 3676
  • Wastes Life On LinuxMCE Since 2007
    • View Profile
    • My Home
Re: Power Down in the event of a power outage
« Reply #3 on: December 20, 2011, 06:38:12 am »
Run a cron process that tries to ping a device, and shutdown the core, if the ping does not succeed

Techstyle

  • Addicted
  • *
  • Posts: 674
    • View Profile
    • Techstyle UK Ltd.
Re: Power Down in the event of a power outage
« Reply #4 on: December 20, 2011, 08:36:23 pm »
I was thinking something along those lines.

Could a 'device' be added that had 2 variables - 'time' and 'pinged device number' where the the 'device' would split the 'time' variable into 3 and ping the 'pinged device number' (device that should always be there) and if 3 pings are missed in a row the core shutsdown.

the 3 consecutive pings would be to ensure the device wasn't just not busy for one of them.  You also want to establish that the power is down for a certain period and not just at one instance.