Switching on/off 5V power to a USB port

Ron McDowell rcm at fuzzwad.org
Wed Apr 4 01:16:53 UTC 2012

On 4/3/12 5:26 PM, Ian Lepore wrote:
> On Tue, 2012-04-03 at 17:13 -0500, Ron McDowell wrote:
>> I just got a little USB powered fan and it sure would be nice if I could
>> have cron on my FreeBSD box turn it on or off at certain times by
>> switching off the 5V line on a USB port.  Anyone know how I can do
>> that?  Thanks.
>> BTW this is a pretty decent fan for the money. :)
>> http://www.amazon.com/gp/product/B0033WSDOM/
> The usbconfig(8) command has power_on and power_off commands.  I've
> never used them so I can't say for sure they'll do what you want.
> -- Ian

The good news is that "usbconfig -u 4 -a 5 power_off|power_on" works fine.

Hardware is a Dell Latitude D-430 notebook running:
FreeBSD d430 10.0-CURRENT FreeBSD 10.0-CURRENT #0 r232714M: Fri Mar  9 
12:41:34 CST 2012     rcm at d430:/usr/obj/usr/src/sys/GENERIC  amd64

When booting up, the fan powers up just as:
uhub7: <vendor 0x413c product 0xa005, class 9/0, rev 2.00/25.07, addr 5> 
on usbus4
shows up, which was a pretty good clue to what device it is.

Automatically turning it on is pure laziness on my part... turning it 
off is more about forgetfulness though. :)

On 4/3/12 5:45 PM, Devin Teske wrote:
> Alternatively, you could just plug your USB fan into your monitor. A 
> fellow engineer and I discovered that most monitors power-down the USB 
> ports when entering power-save mode (with Dell, HP, and Viewsonic, 
> this is whenever the screen blanks due to inactivity; are you using 
> DPMS and/or greensaver?). Walking away from the PC will cause the fan 
> to [eventually] turn off, while waggling the mouse brings it back to 
> life. 

Devin, sorry, my monitor is too old to have USB ports on it...if it did 
that would be even a better solution.

Thanks for the help everyone!

Ron McDowell
San Antonio TX

More information about the freebsd-current mailing list