11

I have a remote server (running far, far away), which has a very important USB device plugged in (call T). Sometimes this device simply dies. If this happens, a simple plug out - plug in solves the problem on the spot. But to do that, somebody must be there physically, and do the plug out - plugin back with his own hands.

This is what I would like to automate.

My idea is to have another (USB or not) device, which can control the power line of another device, so:

  1. it stays between T and my server
  2. can control the power of another USB device
  3. from the server I can control it remotely (ideal would be a char device, but any other solution is also acceptable).
6
  • 1
    To clarify, could you cycle power for the USB power converter itself? Or does it need to be after the power is converted into USB?
    – enderland
    Sep 9, 2015 at 17:28
  • I've had to deal with this exact problem involving a Raspberry Pi and a USB 3G modem. The solution was to power cycle the USB port on a low software level using an automated bash script. I think that would be more practical than a hardware solution.
    – JohnB
    Sep 9, 2015 at 19:38
  • @enderland I don't know what you understand on "cycle power for the USB power converter". I want to power off and on an 5V DC of an USB line programmatically, from a linux server.
    – peterh
    Sep 10, 2015 at 9:16
  • @derobert Some of the answers are quite usable there, but not all. Actually, the most usable is imho the "hub-ctrl" command. Anyways, my main problem with a such software-centric attitude that I won't ever know if the power of the device is really off, or it got only a "suspend yourself" or similar command.
    – peterh
    Sep 10, 2015 at 9:19

3 Answers 3

7

There are essentially two options:

  1. A USB hub with power control, such as this one, which was designed for this purpose. It seems like some other USB hubs can do this too, check this question over at StackOverflow for specifics and possibly other methods of doing this.

  2. DIY, with a USB-controlled relay to switch the power to the usb device on and off, see this blog post for an illustration of how someone did it.

  3. Maybe fix the problem with your usb device ?

1
  • 1: Wonderful idea, I will try it! 2: Can be done, but if I can buy a such, cheap device this is what I will do. 3. In my case it is impossible, this is not a "buy another usb stick for $5" thing.
    – peterh
    Sep 10, 2015 at 9:56
2

There are some more options (added to JonasCZ's answer):

  1. KVM - generally a good option to control servers remotely.
  2. Raspberry Pi or Arduino (etc) - easy and cheap. In case of Raspberry Pi you can connect it to the necessary ports, connect to the net and that's it. They also have pins which are easily programmable.
1
  • 1. Afaik most KVM control only usb hids, and from the usb slave side (so, I could select which master controller I want the slave to see). I need exactly the opposite. 2. Good idea, I will try it - unfortunately I can pipe only one answer, but yours also deserved it.
    – peterh
    Sep 10, 2015 at 9:57
1

At work, in my lab, I am using a programmable USB hub from Acroname (https://acroname.com/store/s77-usbhub-2x4?sku=S77-USBHUB-2X4). If you have this attached to your server, you can reach through (remotely) and have the hub disable/enable any port on it's output. Pretty elegant and has saved me a bunch of time and space.

I think they have a USB 3.0 hub out now too.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.