How to disable USB power via EN_USB_5V


dimag0g

Very Active Member
Joined
Jan 12, 2011
Messages
608
Location
Strasbourg, France
I want to connect an external hard drive to my Pandora and fetch files from this drive remotely. It seems wasteful to leave it spin all the time though, so I wish to disable the power on USB_HOST_5V line via EN_USB_5V pin (GPIO_164). Is it possible to do it in software? Will it be possible to re-enable it without rebooting?

PS. Disabling USB power is not the same as disabling USB host. In fact, the USB port of the pandora is powered up regardless of USB host state.
 
Last edited by a moderator:
There is some board (design?) flaw that causes current leakage and wild LCD flicker (on CC) if you disable EN_USB_5V, so kernel doesn't provide this functionality.It may be possible to export this GPIO over /sys/class/gpio/ , but I'm not sure if this will work when GPIO is taken by the kernel.

Maybe there is a proper command that can be sent through hdparm or smartctl instead of crudely killing the power?
 
hdparm -y /dev/sdx

Is the command to spin down a hd. Not sure if it works over usb.

Edit: no it does not.
 
Last edited by a moderator:
There is some board (design?) flaw that causes current leakage and wild LCD flicker (on CC) if you disable EN_USB_5V
Speaking of which, I have a similar phenomenon on my CC unit when I set the brightness to a minimum. Do you know if the flickering happens on LED+ / LED- lines (backlight) or on LCD_5V / LCD_-5V lines?

Maybe there is a proper command that can be sent through hdparm or smartctl instead of crudely killing the power?
I would not "crudely" kill the power, I'd disable USB host first. And I think it's good to have a universal solution which powers down disks, USB sticks, WIFI and Ethernet adapters etc.
 
hdparm -y /dev/sdx


Is the command to spin down a hd. Not sure if it works over usb.


Edit: no it does not.
Actually, it does with my disk (WD Elements USB 3). And "touch /dev/sdx" gently wakes it up =)
 
Last edited by a moderator:
Seeing that it wont work with any of my drives i assume the drive is not important at all, it seems the USB-HD case has to provide it.

Do you know what vendor the case is from? I might need that feature too.
 
Seeing that it wont work with any of my drives i assume the drive is not important at all, it seems the USB-HD case has to provide it.


Do you know what vendor the case is from? I might need that feature too.
Yeah, the USB SATA controller must implement SAT for hdparm to work. I have an original WD enclosure which doesn't really open, so I cannot check what's inside
 
I found a little OpenSource Software who should do spin down the HDD for you for USB and SCSI HDDs:

http://hd-idle.sourceforge.net/

Maybe you can compile it with CodeBlocks or the Cdevtools PNDs from the Repo ;)
I suppose it uses the same interface as hdparm, so what's the point? If hdparm is unable to spin down your disk, hd-idle won't either. Plus, it stays resident in memory for some reason (probably because it cannot set HDD spindown timeout, just issue actual spindown commands), while hdparm configures the disk as you like it and quits.

EDIT: I'll port it anyway, perhaps it will be useful for drives which understand the spindown command but cannot set spindown delay.
 
Last edited by a moderator:
Back
Top