Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have a D-Link DUB-H7 powered USB 2.0 hub connected to my computer. Occasionally when I reboot the system, I've noticed that some of the ports on the hub get powered down: the green light next to the port is turned off, and the device attached to that port is not visible to lsusb or similar commands. Devices attached to the other ports on the hub function as normal.

I am able to restore the ports by disconnecting power to the hub temporarily (from the computer, AC adapter and any devices that might provide any power such as my phone), but this is a bit of a hassle.

It seems like something that might be related to power management, so is there some way you can tell the USB hub to power up through software?

share|improve this question
    
Is this a desktop or laptop? What brand/model? Have you looked for firmware updates for the D-Link device? –  david6 Jun 11 '12 at 3:36
    
It is a desktop system built from parts. Looking at the D-Link website, it doesn't look like the device has upgradeable firmware. –  James Henstridge Jun 11 '12 at 3:48
    
Is it a DUB-H7 or DUB-H7 REV B? –  david6 Jun 11 '12 at 4:01
    
On the bottom, it says H/W Ver.: A2, so it probably isn't revision B. –  James Henstridge Jun 11 '12 at 4:05
add comment

2 Answers 2

up vote 2 down vote accepted

hub-ctrl will do what you need.

apt-get install libusb-dev
cc -o hub-ctrl hub-ctrl.c -l usb
./hub-ctrl -v
./hub-ctrl -P 2 -p 1 # turn on port 2
./hub-ctrl -P 2 -p 0 # turn off port 2

Disclaimer: although I have tested it on Ubuntu 12.04 (precise), I did not write this utility. It does require a hub with built in power control, but given that your hub is powering down certain ports it is a good bet your hub has it.

share|improve this answer
    
This is promising. I had to patch it to specify my hub correctly (paste.ubuntu.com/5694890), but it does seem to be able to turn the hub LEDs on and off. I'll have to give it a go when I next see the system boot up with some hub ports disabled. –  James Henstridge Apr 10 '13 at 9:47
    
I got around to testing this on the weekend. While I was able to toggle the power setting of ports when the hub is behaving itself, it does not work when the hub goes into this weird state. So this sounds like a hardware bug and can't be reset from software. Still, this is the closest answer I'm going to get, so I'll accept it. –  James Henstridge Apr 15 '13 at 3:47
add comment

USB power has nothing to do with the OS. It depends on the device itself. Some hubs are self powered, in which case they get their power from the system; others require more power, and those have their own power supply.

A bus-powered hub is a hub that draws all its power from the host computer's USB interface. It does not need a separate power connection. However, many devices require more power than this method can provide, and will not work in this type of hub.
-- http://en.wikipedia.org/wiki/USB_hub#Power

Under Linux, you can use hwinfo --usb or for more detail try lsusb -v -t if hwinfo --usb is not installed you can install it.

Just press Ctrl+Alt+T on your keyboard to open Terminal. When it opens, run the command below.

sudo aptitude install hwinfo usbutils

Note:

Some self-powered hubs do not supply enough power to drive a 500mA load on every port. For example, many seven port hubs have a 1A power supply, when in fact seven ports could draw a maximum of 7 x 0.5 = 3.5A, plus power for the hub itself. Designers assume the user will most likely connect many low power devices and only one or two requiring a full 500mA. On the other hand, the packaging for some self-powered hubs states explicitly how many of the ports ports can drive a 500 mA full load at once. For example the packaging on a 7 port hub might claim to support a maximum of 4 full load devices ". So I would check with D-Link.

Most portable media devices sync data to a desktop or laptop computer via the USB port. The batteries in these devices can also be charged by that same powered USB connection. There may be situations, however, when you may need to change the default power settings of a particular USB port so the device connected to it does not interfere with the your computer's performance. For example, some types of devices connected to a computer's USB port can prevent the computer from going into its power-saving "sleep" mode. In Ubuntu Linux, there is a way to modify the power settings for the USB ports.1

Click Here

1Source: Wikipedia

share|improve this answer
    
As I mentioned in the question, I am not relying on the host to power the hub: I have a power adapter attached, and it remains powered up when I shut down my computer. The problem is that occasionally some ports on the hub (not all) get powered down. –  James Henstridge Jun 11 '12 at 4:23
    
The power adapter for the hub says it has 3A at 5V output. I don't think I'd class the hub as heavily loaded. The last time I saw this, the only devices connected were my phone, a headset and a bluetooth adapter. –  James Henstridge Jun 11 '12 at 5:43
    
Anyway, the reason I asked the question was that I know that the operating system has some control over the power use of connected USB devices (e.g. it can put them into suspend mode). I was wondering if this behaviour I've observed was related to that power management function and whether I could control it from the computer. –  James Henstridge Jun 11 '12 at 5:45
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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