Server Watchdog - Reset PC/server if crashed

Hello,

I have a server sitting in a datacenter which is not managed. That means if the server crashed for any reason I have to send mails to the datacenter staff. They manually walk to my server, press and hold the power switch and turn the server back on. That's disgusting since it takes a long time until the staff responds...

Now I had the following idea: Have an Arduino Mini inside the server with wires attached to the power switch through an optocoupler. The Arduino is powered from USB inside the server and receiving signals through USB/serial from the operating system. If the Arduino does not receive the serial command for - let's say - 1 hour, then it will trigger the shut down and start process through the power button of the server. So far so good.

The problem is, that this Arduino has to be powered from the server itself by USB, I have no chance to get an additional power line. The server also does not have a reset jumper to simply bridge. There is only a power switch, which I have to press 5 seconds until the server is powered down, wait 1 sec., press the button again. But.... after turning the server off by Arduino, the Arduino itself looses power through USB because the server was turned off....

Do you have any ideas how to keep Arduino "alive" and also start the server again? A big capacitor is not a really good idea, right?

Thanks

Ah yes, this question yet again.

OK. Here we go. The server has an "ATX" power supply which has a "pilot" 5V supply provided even if you soft-switch it "off". Not infrequently there is a pilot LED on the PCB showing even if it is off.

Quite often nowadays, the pilot supply powers one or more of the USB ports so the USB does not shut off when the ATX supply is commanded off. You can test this easily using your Arduino.

If however, it does, you need to find another connection to the pilot supply. It is usually on the PCI bus, as it is used for the "wake on LAN" function. And it is of course, on the purple wire of the ATX power supply.

Clearly, you are going to have to hack into the machine anyway to connect to the "power" button. I presume that the button actually goes to ground when pushed - though I have never checked this myself.

Actually the server does not have an ATX power supply since it's no ATX standard. It's a 19" rack enclosure with proprietary power supplies and connectors. Nevertheless I also though about this topic to find a place to get a 5V rail internally.

If this is not possible I will use a 3V coin cell battery as a secondary power source for the Arduino connected in parallel two the USB power rail with two Schottky diodes. Schematics see below.

btw: I'm talking about an Arduino Pro Mini 8MHz which should be able to continue running with 3V.

This should be possible, right?

mexxle:
This should be possible, right?

Not quite! :astonished:

You show the Schottky diodes powering Vin, but they need to go directly to the “Vcc” terminal, not through the regulator. A Pro Mini (the obvious choice) does not have a 3.3V terminal as such other than Vcc.

mexxle:
Actually the server does not have an ATX power supply since it’s no ATX standard. It’s a 19" rack enclosure with proprietary power supplies and connectors. Nevertheless I also though about this topic to find a place to get a 5V rail internally.

I thought about that, but it makes little difference. The fact that it has a “soft switch” on the front, which will in normal operation cause the machine to correctly shut down (or sleep, depending on configuration) or forcibly shut down if held for five seconds, means that it uses the same “pilot” supply to implement this function (otherwise it could never turn itself on) and as you have to identify the connections to that switch (and determine whether it is active low as it should be, or active high), so you will also need to identify the “pilot” 5V supply along the way.

In fact, if the power switch was active-high, although an odd arrangement, your problem would be solved in one.

There will be a connector between the power supply (only one? For a server?) and the main board and I would be just a little surprised if it did not closely match the “ATX” convention.

Now I had the following idea: Have an Arduino Mini inside the server with wires attached to the power switch through an optocoupler

Are you sure that this would work? An opto coupler is not quite the same as a normal contact switch

Also. Running off button cells doesn't seem like a good idea to me. How often did you intend to go and replace the button cell.

Personally, I'd probably use a pack of NiMh (or other cells) and keep them trickle charged from the 5V.
You'd then have plenty of power to run the Arduino and even a relay if necessary to "push" the button for you.

Paul__B:
You show the Schottky diodes powering Vin, but they need to go directly to the “Vcc” terminal, not through the regulator. A Pro Mini (the obvious choice) does not have a 3.3V terminal as such other than Vcc.

There is a RAW input on the Pro Mini. So I can put the unregulated voltage directly into VCC? I was told to never put unregulated voltage to VCC?

Paul__B:
There will be a connector between the power supply (only one? For a server?) and the main board and I would be just a little surprised if it did not closely match the “ATX” convention.

There are two redundant power supplies. I don’t like the idea to get my power rail between the supplies and the mainboard since it would require to solder directly on the mainboard - there is no cable connection between the supplies and the mainboard :frowning:

rogerClark:
Also. Running off button cells doesn’t seem like a good idea to me. How often did you intend to go and replace the button cell.

Personally, I’d probably use a pack of NiMh (or other cells) and keep them trickle charged from the 5V.
You’d then have plenty of power to run the Arduino and even a relay if necessary to “push” the button for you.

I also though it would be a better idea to use a rechargable battery pack. I was thinking of a Li-Ion 18650 cell with a charging circuit. For the charging circuit I would use this module: http://www.ebay.de/itm/Lithium-Battery-Charging-Module-Charger-Board-mini-5v-USB-li-ion-charger-tp4056-/390566538252

Could you please have a look at my wiring diagram if that makes sense?

Thank you so much!

A 5V pro mini will not run off a 3.7V batt pack, so you will need a dc to dc boost transformer/converter to get 5V from the batt pack, or use a charger that does that for you. There are usb battery packs on ebay that do that, and they are cheap.

magnetman:
A 5V pro mini will not run off a 3.7V batt pack, so you will need a dc to dc boost transformer/converter to get 5V from the batt pack, or use a charger that does that for you. There are usb battery packs on ebay that do that, and they are cheap.

I wrote above that I'm going to use a 8MHz version of the Pro Mini which should work starting with 3.3V.

Sorry, I missed that. Then you should use the Raw input pin, not Vcc.

magnetman:
Sorry, I missed that. Then you should use the Raw input pin, not Vcc.

Err, no!

You didn’t look at his diagram!

I think you ought to look for the pilot 5V source that Robin2 described. If you find it, the issue of switching power sources goes away. Also consider whether you may be able to leech enough power from the soft power switch and LED to run a standalone Arduino - the microcontroller itself draws negligible current. If you decide you do need to switch power sources, all your sources will need to supply the same voltage so you would need a regulator to drop the 5V USB down to 3.3V.

PeterH:
... If you decide you do need to switch power sources, all your sources will need to supply the same voltage so you would need a regulator to drop the 5V USB down to 3.3V.

Why do all my sources need the same voltage? The users above and also in this thread (http://forum.arduino.cc/index.php?topic=174247.msg1293814#msg1293814) are telling me this is fine with two schottky diodes.

You don't want to alter the logic voltage of your microprocessor while it's running, do you? I think that would lead to unpredictable behaviour.

I agree. But what about the simple idea of just passing the voltage through RAW pin instead of VCC pin? because there is a voltage regulator, regulating the voltage down to 3.3V?

mexxle:
I agree. But what about the simple idea of just passing the voltage through RAW pin instead of VCC pin? because there is a voltage regulator, regulating the voltage down to 3.3V?

I don't know what the specs say about the acceptable voltage range on the raw input. I wouldn't be surprised if it will run from 5V on the raw input, since 5V->3.3V conversion seems quite common on other Arduinos, but I wouldn't take that for granted unless you have seen it confirmed somewhere. Were you proposing to supply the 3.7V supply directly to Vcc or via the raw input? I don't know what the drop-out voltage is for the 3.3V voltage regulator, but I wouldn't be confident it'll run as low as 3.7V unless you've seen that confirmed. Is it safe to apply 3.7V to the Vcc pin of an 3.3V mini? It probably is, but again not something I'd want to assume.

PeterH:
You don’t want to alter the logic voltage of your microprocessor while it’s running, do you? I think that would lead to unpredictable behaviour.

Why? :astonished:

{Hint: It’s digital CMOS!}

mexxle:
But what about the simple idea of just passing the voltage through RAW pin instead of VCC pin? because there is a voltage regulator, regulating the voltage down to 3.3V?

Regulating what voltage? 5V input will probably be sufficient to regulate to 3.3V in the 3.3V/ 8 MHz Pro Mini, but there is a problem with the regulator in that it conducts as a diode in the reverse direction, so your battery connected to Vcc will feed current back to the USB adapter and anything else connected to it (like - the computer) which is powered down!

Paul__B:
Regulating what voltage? 5V input will probably be sufficient to regulate to 3.3V in the 3.3V/ 8 MHz Pro Mini, but there is a problem with the regulator in that it conducts as a diode in the reverse direction, so your battery connected to Vcc will feed current back to the USB adapter and anything else connected to it (like - the computer) which is powered down!

Is the 3.3V version of the Pro Mini fine with 5V input at VCC pin? The datasheet of ATMega328 is telling me that up to 5.5V is accepted, right?
Or what else can I do to prevent using the voltage regulator? Use another diode to stop current flow back to the USB adapter?

Thanks

Now I supplied the voltage through Vcc pin instead of Raw pin. It's working but if I unplug the USB cable from my computer, current and voltage is flowing back to USB direction from TX pin.... I'm getting frustrated on that topic =(

Please help me :~

See here my schematics
http://s7.directupload.net/images/140721/3ofopgb2.png

Ahh, yes, well there is that problem. An obvious answer is to disconnect the TX pin as you are not using it.

Of course I still favour simply powering this from the "pilot" supply in the server - much easier and more reliable. Have you actually investigated the connections to the power button yet?

If the power button is active-high, your power problem is solved already. If it is active low, you do not need an optocoupler to trip it as a NPN transistor will do just fine. (If it is in fact, active high, you only need a PNP transistor anyway.)

Just to let you know I'll cancel this project since there is absolutely no way to get a 5V directly from the PSU inside the server. There are only HP-specific connectors and no cables where to easily get a 5V rail. I don't want to solder directly on the mainboard which is far too expensive if I waste it. I'll also trash the idea of having multiple power sources since thats too complicated with all the exceptions you have to think off.

Anyway, thanks for all your hints and tricks.