4 ms·
I have better than UPS. I have watchdog on my server. It is a reprogrammed wifi-plug, which turns power off&on if it cannot see the server, or does not get ping
by timonoko 4y ago
I have better than UPS. I have watchdog on my server. It is a reprogrammed wifi-plug, which turns power off&on if it cannot see the server, or does not get ping every 5 minutes.
And the server can also restart wifi-router and cable modem if cannot ping the selfsame watchdog (and 8.8.8.8) at reasonable intervals.
Yes. They are watching each other.
- jmacd 4y agoUbiquiti sells a nice piece of hardware that is a WAN reboot plug. Unfortunately there is zero configurability in terms of how it determines if WAN is working or not. I haven't been able to find another purpose made piece of kit.
- timonoko 4y agoMy server is so old (2012) it has parallel port. If you connect all pins together it has enough power to operate 220V relay and thus modem and router can be turned on and off without any fancy hardware.
- spicybright 4y agoThat's scary but amazing. Did you do this and have any write ups about it? Sounds interesting!
- timonoko 4y agoThis is all you need to know. Connect all parport data pins together and connect it to suitable relay. Preferably 3-pin relay, so the Wifi-power-on is the default state. $ cat wifi-off #! /usr/bin/python2 import parallel,time p = parallel.Parallel() # open LPT1 or /dev/parport0 p.setData(0xFF) $ cat wifi-on #! /usr/bin/python2 import parallel,time p = parallel.Parallel() # open LPT1 or /dev/parport0 p.setData(0x0)
- spicybright 4y agoWow, that makes complete sense. What an elegant hack!
- BugWatch 4y agoIf you are ever to pursue such a project, please pay close attention to proper electronic circuit design and safeguards when it comes to relays. Otherwise, you risk burning out the controlling pins or the whole system, due to reverse voltage (measured in hundreds) that is generated by the relay's coil when the relay is turned off. The easiest approach is to just use a commonly available relay modules used with Arduino or similar platforms/microcontrollers, as they already contain minimum or all protection mechanisms. So, the module will contain the reversed diode in parallel with the relay, while additional transistor and optocoupler will allow you a complete galvanic isolation of the controlling- from the and relay circuit. YouTube has plenty of user-friendly resources with schematics and functional overviews, just search for "relay module" or "relay arduino".
- spicybright 4y agoOh, absolutely. Even though it's just a simple (mostly) isolated relay, driving outlet power through anything but a PSU sketches me out. Great overview though, thank you for posting that.
- moffkalast 4y agoDo you ever get any outages or was that just a fun project to set up? I'm always thinking I should buy an UPS but realistically I'd need it once every 5 years at best, and even then I'm usually lucky.
- timonoko 4y agoHappens twice a month, reasons vary. Mostly because Wifi is too congested in middle of Helsinki. At one time it happened every day. This was because of open Telnet port. Crooks, mostly Russians, caused so many Telnet-open processes that machine choked up.
- hddherman 4y agoYou'd think so, but lately I've found it to be quite handy. Over the last couple of days, the UPS has notified me that the voltage coming from the wall is a bit off, oddly high (250-256V). netdata is nice and even graphs it out to me so I can pinpoint exactly when and how much the voltage deviated from normal.
- timonoko 4y agoThis Watchdog (aka "Vahtikoira") is already on Github. https://github.com/timonoko/Tokmannin-ESP8266-Wifi-topseli/blob/master/vahtikoira.ino https://github.com/timonoko/Tokmannin-ESP8266-Wifi-topseli/b... The server causes the Blue Led (aka "Sininen Ledi") to blink, so that I immediately know Watchdog is watching and gets nourishment. Sometimes I boot to some other distro and forget to turn off the Watchdog, which is annoying.
- idonotknowwhy 4y agoThat's cool. I used to have a raspberry pi hooked up to the reset switch pins via gpio on a mining rig in 2013. Back then, the mining software was all buggy and would crash the rig every couple of days. When the pi couldn't ping the rig for 30 seconds, it rebooted it.