Cutting power by software - what device do i need?

Discussion of chess software programming and technical issues.

Moderators: hgm, Harvey Williamson, bob

Forum rules
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
bob
Posts: 20354
Joined: Mon Feb 27, 2006 6:30 pm
Location: Birmingham, AL

Re: Cutting power by software - what device do i need?

Post by bob » Mon Mar 19, 2012 11:36 pm

diep wrote:
jwes wrote:google usb relay.
Ah yes i see i can plug relays into the computer. That's good.
It can give a pulse. That's a good start :)

Any idea how to switch off power with such pulse? Probably need another device that i plug into the relay then?
A relay is an open-close device. It is either open or closed. You generally get two connections that bridge the relay contacts. Only question is, how many amps do you need to switch? The ones I saw were good for 10a, which is probably way more than enough. You just run the hot leg of A/C power to one side of the relay, the other side of the relay goes to the hot wire connection in the switch, and you will be set...

bob
Posts: 20354
Joined: Mon Feb 27, 2006 6:30 pm
Location: Birmingham, AL

Re: Cutting power by software - what device do i need?

Post by bob » Mon Mar 19, 2012 11:37 pm

syzygy wrote:
diep wrote:
bhlangonijr wrote: ... and what happens if you try issuing a "shutdown -h now" ?
That's not a problem as i'm there then. The real problem is when i'm asleep that the cheapo 12 volts adapter that runs fans of a precious Mellanox component, that it breaks.
I think the question is what happens if you let a script issue the "shutdown -h now" when the temperature gets too high?
Wrong machine. That would shut down his linux box, but not his switch...

diep
Posts: 1780
Joined: Thu Mar 09, 2006 10:54 pm
Location: The Netherlands
Contact:

Re: Cutting power by software - what device do i need?

Post by diep » Tue Mar 20, 2012 12:00 am

bob wrote:
diep wrote:
bob wrote:
diep wrote:hi,

My chessprogram runs on a box that uses a switch that doesn't have a 'power off' button.

This mellanox switch however, you can see from my facebook pictures there (my entire facebook is open to the entire world to browse), it produces 75 decibel or so and i sit a few meters away from it.

Now i got rid of the fans from the switch and replaced it by cardboard and big outside fans. Where the psu can give power to 1 fan that cools the psu (hopefully it'll go ok as the airpressure of the fans i use isn't that high), the other 3 fans from the case do not have this luxury solution. The easiest solution is use an external adapter.

This external adapter could break at which point a disaster might happen to the switch. From 1 of the motherboards of the box i can easily monitor the RPM of the external fans. If one of them drops to near zero, which would happen for example if the adapter breaks, then i want to give the controlling proces there the order to cut the power of the switch.

Writing the software i'll manage, but what device to use that i can control by software or maybe even a simpler solution is there.

Note that i do realize this is not a 100% solution, yet the odds that one day the 12 volt adapter breaks is there, so i want to catch THAT possibility.

I feel some cheapskate solution probably exists. Any thoughts on how to solve this i welcome.
This linux, windows, or some other custom o/s???

In linux it is pretty easy to write a shell script to access the lm_sensors info, and if a fan's rpm drops to some chosen value, shut the system down quickly...
Right lm_sensors it is. Problem is not the software. Problem is how to interrupt power of the switch. I need a device that can react onto the computer.

Now i can of course buy a legorobot that can do it using robot-OS - maybe there is something cheaper.

The switch doesn't have a 'turn off' button.

So i need to physical build something that can be steered by computer. Any thoughts on that?
OK, the switch is a separate box, completely. And you want to be able to turn it off from the computer?
Correct!

For a $100 switch you don't care of course but for a superior mellanox infiniband switch...

If I were going to try to build such a thing, I might "go simple here." Take one pin + ground from the parallel output port, and gate that to a simple darlington-pair power transistor that is used to ramp up the current to a level that will trip a relay. Then simply wire the spdt relay in series with the hot wire on the a/c power, and you are set. Output a 1, the relay closes, and power comes on. Output a 0, the relay opens, power goes away.

If you want it to "default on" you could toss in a "not" gate on the signal coming from the parallel port output, as it almost certainly powers on with an output of all zero bits. Notting that would give you a 1 which would start things off with the switch power enabled...
I have no idea what you're talking about Bob, but from what i understand you want to start getting from the mothballs some solder and other stuff and make your own electronics?

No easy to use ready to use solution from a store?

I see a relays is $23, can i plug into that something else?

The switch is a 36 ports managed QDR switch from Mellanox.
They upgraded a supercomputer to FDR somewhere and i got the QDR switch from it.

now QDR is a great network to use of course. the new FDR for your info (sponsor talk) is of course the superior new network. I'm gonna write a proggie to measure the hashtable latency you can expect and will ask mellanox to also run it at a FDR setup of them.

expectation is FDR is 2x faster in latency (it's quite a tad faster in bandwidth as well, but that's no big deal for us).

I heard timings of 0.85 us for a RDMA (remote dma read from other motherboards RAM). QDR is not even remotely in the same league.

Mellanox has FDR, Qlogic doesn't have QDR and won't have that any soon, also their statements reflect that. They're busy improving latency of QDR a tad, but that will never be even in the same league of the FDR latencies.

Around a 0.5 us worse.

Now all that is single core latencies of course, i'll make a test for all cores to all cores, which is what we want to know of course; expect way worse latencies there than the good weather ones from all manufacturers we saw so far; probably FDR is gonna own everything there. Yet i am very happy wth this QDR switch of course. Many supercomputers aren't even in the same league of those bandwidths :)

it's 2 x 40 gigabit both sides.
there is no way the mainboards i got can handle that bandwidth :)

On paper it can do 8GB /s (pci-e 2.0) but i really doubt it will do it :)

bob
Posts: 20354
Joined: Mon Feb 27, 2006 6:30 pm
Location: Birmingham, AL

Re: Cutting power by software - what device do i need?

Post by bob » Tue Mar 20, 2012 12:22 am

diep wrote:
bob wrote:
diep wrote:
bob wrote:
diep wrote:hi,

My chessprogram runs on a box that uses a switch that doesn't have a 'power off' button.

This mellanox switch however, you can see from my facebook pictures there (my entire facebook is open to the entire world to browse), it produces 75 decibel or so and i sit a few meters away from it.

Now i got rid of the fans from the switch and replaced it by cardboard and big outside fans. Where the psu can give power to 1 fan that cools the psu (hopefully it'll go ok as the airpressure of the fans i use isn't that high), the other 3 fans from the case do not have this luxury solution. The easiest solution is use an external adapter.

This external adapter could break at which point a disaster might happen to the switch. From 1 of the motherboards of the box i can easily monitor the RPM of the external fans. If one of them drops to near zero, which would happen for example if the adapter breaks, then i want to give the controlling proces there the order to cut the power of the switch.

Writing the software i'll manage, but what device to use that i can control by software or maybe even a simpler solution is there.

Note that i do realize this is not a 100% solution, yet the odds that one day the 12 volt adapter breaks is there, so i want to catch THAT possibility.

I feel some cheapskate solution probably exists. Any thoughts on how to solve this i welcome.
This linux, windows, or some other custom o/s???

In linux it is pretty easy to write a shell script to access the lm_sensors info, and if a fan's rpm drops to some chosen value, shut the system down quickly...
Right lm_sensors it is. Problem is not the software. Problem is how to interrupt power of the switch. I need a device that can react onto the computer.

Now i can of course buy a legorobot that can do it using robot-OS - maybe there is something cheaper.

The switch doesn't have a 'turn off' button.

So i need to physical build something that can be steered by computer. Any thoughts on that?
OK, the switch is a separate box, completely. And you want to be able to turn it off from the computer?
Correct!

For a $100 switch you don't care of course but for a superior mellanox infiniband switch...

If I were going to try to build such a thing, I might "go simple here." Take one pin + ground from the parallel output port, and gate that to a simple darlington-pair power transistor that is used to ramp up the current to a level that will trip a relay. Then simply wire the spdt relay in series with the hot wire on the a/c power, and you are set. Output a 1, the relay closes, and power comes on. Output a 0, the relay opens, power goes away.

If you want it to "default on" you could toss in a "not" gate on the signal coming from the parallel port output, as it almost certainly powers on with an output of all zero bits. Notting that would give you a 1 which would start things off with the switch power enabled...
I have no idea what you're talking about Bob, but from what i understand you want to start getting from the mothballs some solder and other stuff and make your own electronics?

No easy to use ready to use solution from a store?

I see a relays is $23, can i plug into that something else?

The switch is a 36 ports managed QDR switch from Mellanox.
They upgraded a supercomputer to FDR somewhere and i got the QDR switch from it.

now QDR is a great network to use of course. the new FDR for your info (sponsor talk) is of course the superior new network. I'm gonna write a proggie to measure the hashtable latency you can expect and will ask mellanox to also run it at a FDR setup of them.

expectation is FDR is 2x faster in latency (it's quite a tad faster in bandwidth as well, but that's no big deal for us).

I heard timings of 0.85 us for a RDMA (remote dma read from other motherboards RAM). QDR is not even remotely in the same league.

Mellanox has FDR, Qlogic doesn't have QDR and won't have that any soon, also their statements reflect that. They're busy improving latency of QDR a tad, but that will never be even in the same league of the FDR latencies.

Around a 0.5 us worse.

Now all that is single core latencies of course, i'll make a test for all cores to all cores, which is what we want to know of course; expect way worse latencies there than the good weather ones from all manufacturers we saw so far; probably FDR is gonna own everything there. Yet i am very happy wth this QDR switch of course. Many supercomputers aren't even in the same league of those bandwidths :)

it's 2 x 40 gigabit both sides.
there is no way the mainboards i got can handle that bandwidth :)

On paper it can do 8GB /s (pci-e 2.0) but i really doubt it will do it :)
The USB relay solution looks workable, although not real cheap...

diep
Posts: 1780
Joined: Thu Mar 09, 2006 10:54 pm
Location: The Netherlands
Contact:

Re: Cutting power by software - what device do i need?

Post by diep » Tue Mar 20, 2012 12:40 am

that usb relay is just a relay thing that works with usb. it doesn't turn off the actual power of the switch. the relay can give a signal basically to undertake action for a number of milliseconds; what device do i want to give the job of undertaking the action to cut the power?

there should be something cheap out there that i can get ready to use for a store isn't it?

cutting the power should be something that's a pretty much common thing to build isn't it?

bob
Posts: 20354
Joined: Mon Feb 27, 2006 6:30 pm
Location: Birmingham, AL

Re: Cutting power by software - what device do i need?

Post by bob » Tue Mar 20, 2012 1:15 am

diep wrote:that usb relay is just a relay thing that works with usb. it doesn't turn off the actual power of the switch. the relay can give a signal basically to undertake action for a number of milliseconds; what device do i want to give the job of undertaking the action to cut the power?

there should be something cheap out there that i can get ready to use for a store isn't it?

cutting the power should be something that's a pretty much common thing to build isn't it?
A relay is an electromagnetic device that you can basically open or close under computer control. The basic device looks something like this:

Code: Select all


(b)-------------------------------------{}

                                                       {}----------------------------------------(a)

When you send the signal to "close the relay" the electromagnet is turned on, and it pulls the top contact down into contact with the bottom contact.  This closes the circuit from (a) to (b).  If you hook the 120vac hot side (black wire) to A, and you hook the 120vac hot input (black wire) to the switch, then when you close the relay, power is connected, when you open the relay power is interrupted.  Most will take up to 10a at 125vac, I can't imagine a switch pulling that much...

If you want to wire it in to your switch, here's what I would do:

(1) carefully cut the outer insulation off of the power cable for about 4" or so.  Inside you should find 3 wires.  Usually 1 is black, one is white (neutral) and one might be green, or it might be uninsulated (bare copper) (this is the earth ground.)  Leave the white and ground wires alone.  Cut the black wire.  Connect one end to (a) on the relay, the other end you just cut to the other side.  With the relay open, the circuit is open and the switch is off.  Send the command to close the relay and the switch will power up and stay powered up until you once again tell the relay to open...

I don't see why you would need anything else at all.

If you want to do a neater installation, but a 3' extension cord, a metal power box, a standard wall receptacle, and a cover.  Cut the female end off the cord, and wire the three wires in the cord to the wall receptacle.  Run a second pair of wires to the relay, one on pole A, one on B.  Inside that metal box, you work your magic.  White wire goes to receptacle neutral post.  Ground goes to ground.  Take the black (hot) wire from the extension cord and tie it to a wire that goes to relay pole (a).  Take the other wire, hook it to relay pole (b) on one end, and on the other end, hook it to the receptacle "hot" pole.  Now just plug your switch into that 3' modified extension cord, plug the cord into the wall outlet, and the USB relay will turn power on or off, without cutting your switch power cord if you had rather not do that...

I would assume that any relay can be opened or closed for a period of time, including "forever".  So close the relay "forever" via a USB command and when you detect a problem, open it "forever"...

Adam Hair
Posts: 3187
Joined: Wed May 06, 2009 8:31 pm
Location: Fuquay-Varina, North Carolina

Re: Cutting power by software - what device do i need?

Post by Adam Hair » Tue Mar 20, 2012 2:05 am

bob wrote:
diep wrote:that usb relay is just a relay thing that works with usb. it doesn't turn off the actual power of the switch. the relay can give a signal basically to undertake action for a number of milliseconds; what device do i want to give the job of undertaking the action to cut the power?

there should be something cheap out there that i can get ready to use for a store isn't it?

cutting the power should be something that's a pretty much common thing to build isn't it?
A relay is an electromagnetic device that you can basically open or close under computer control. The basic device looks something like this:

Code: Select all


(b)-------------------------------------{}

                                                       {}----------------------------------------(a)

When you send the signal to "close the relay" the electromagnet is turned on, and it pulls the top contact down into contact with the bottom contact.  This closes the circuit from (a) to (b).  If you hook the 120vac hot side (black wire) to A, and you hook the 120vac hot input (black wire) to the switch, then when you close the relay, power is connected, when you open the relay power is interrupted.  Most will take up to 10a at 125vac, I can't imagine a switch pulling that much...

If you want to wire it in to your switch, here's what I would do:

(1) carefully cut the outer insulation off of the power cable for about 4" or so.  Inside you should find 3 wires.  Usually 1 is black, one is white (neutral) and one might be green, or it might be uninsulated (bare copper) (this is the earth ground.)  Leave the white and ground wires alone.  Cut the black wire.  Connect one end to (a) on the relay, the other end you just cut to the other side.  With the relay open, the circuit is open and the switch is off.  Send the command to close the relay and the switch will power up and stay powered up until you once again tell the relay to open...

I don't see why you would need anything else at all.

If you want to do a neater installation, but a 3' extension cord, a metal power box, a standard wall receptacle, and a cover.  Cut the female end off the cord, and wire the three wires in the cord to the wall receptacle.  Run a second pair of wires to the relay, one on pole A, one on B.  Inside that metal box, you work your magic.  White wire goes to receptacle neutral post.  Ground goes to ground.  Take the black (hot) wire from the extension cord and tie it to a wire that goes to relay pole (a).  Take the other wire, hook it to relay pole (b) on one end, and on the other end, hook it to the receptacle "hot" pole.  Now just plug your switch into that 3' modified extension cord, plug the cord into the wall outlet, and the USB relay will turn power on or off, without cutting your switch power cord if you had rather not do that...

I would assume that any relay can be opened or closed for a period of time, including "forever".  So close the relay "forever" via a USB command and when you detect a problem, open it "forever"...[/quote]

I would be cautious about giving electrical wiring instructions to anybody outside North America. I am a licensed electrician, and I would never do that. There is a definite lack of uniformity in regards to wiring practices and standards. For example, in Australia the neutral conductor could be black, while in the US a black conductor will always be hot.

Adam Hair
Posts: 3187
Joined: Wed May 06, 2009 8:31 pm
Location: Fuquay-Varina, North Carolina

Re: Cutting power by software - what device do i need?

Post by Adam Hair » Tue Mar 20, 2012 2:22 am

Is it possible to control an individual usb port? If so, then you could use a usb controlled power strip. It monitors the 5 volt usb output and shuts down when the voltage ceases.

If not, then you might have to do what Bob suggested. Get a usb relay, and use that to control the power to an intermediate receptacle outlet which you plug the switch into. I found one here that is not too expensive:
http://www.pencomdesign.com/1ch_usb_relay.htm

diep
Posts: 1780
Joined: Thu Mar 09, 2006 10:54 pm
Location: The Netherlands
Contact:

Re: Cutting power by software - what device do i need?

Post by diep » Tue Mar 20, 2012 2:39 am

Adam Hair wrote:
I would be cautious about giving electrical wiring instructions to anybody outside North America. I am a licensed electrician, and I would never do that. There is a definite lack of uniformity in regards to wiring practices and standards. For example, in Australia the neutral conductor could be black, while in the US a black conductor will always be hot.
Doesn't matter - it's all made in China

diep
Posts: 1780
Joined: Thu Mar 09, 2006 10:54 pm
Location: The Netherlands
Contact:

Re: Cutting power by software - what device do i need?

Post by diep » Tue Mar 20, 2012 2:40 am

Thanks for your extensive explanations Bob, i'll look into all this and will try to get it to work!

Switch is rated 300 watt or so, but when i measured it eats around a 100.
It's putting a 300 volt at each infiniband wire or so, yet very low amps.

The voltage here is a 240 or so, so 10 amps woud be 2400 watt...

Post Reply