On Fri, 28 Jan 2011 12:12:08 +0000 Martijn Koster mak-alug@greenhills.co.uk allegedly wrote:
On 26 Jan 2011, at 15:41, Chris G wrote:
I'm looking for the simplest possible way for a script (or any sort of program, can be C, Python, whatever you like within reason) to check whether mains power is on.
The computer which is going to check this is running off batteries so will still be running (I'm not quite that stupid!).
The easiest way I can think of at the moment is to have some sort of hardware with a presence on the LAN powered by mains so that one can ping it to check that mains power is there. However the 'simplest' device I have at the moment is an old router which seems rather overkill for such a simple requirement.
Anything mains powered with an IP address will do . So your router would be fine. Or any of a large range of "home automation" devices which are networkable (http://home-automation.org/) if you actually want to spend money on gadgets.
Mick ---------------------------------------------------------------------
The text file for RFC 854 contains exactly 854 lines. Do you think there is any cosmic significance in this?
Douglas E Comer - Internetworking with TCP/IP Volume 1
http://www.ietf.org/rfc/rfc854.txt ---------------------------------------------------------------------