Find the answer to your Linux question:
Results 1 to 3 of 3
Is it possible to turn off the power to the USB ports in Linux? If so, how? Let me put this into context: I'm still playing with this udev idea ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux User Agent-X's Avatar
    Join Date
    May 2005
    Location
    Dimension X
    Posts
    261

    Turn off power to USB port?


    Is it possible to turn off the power to the USB ports in Linux?
    If so, how?

    Let me put this into context:

    I'm still playing with this udev idea I had with another member on the forum. However, because of how digital cameras work (however they work), it seems the digital camera gets noticed each time it is hooked up to the USB port.

    My interest is in turning off the USB port temporarily with some key commands, which I would setup within xmacro or xnee and xbindkeys. Afterwards, when I want to activate the camera again, I will use some key commands.

    The idea behind this is that I won't have to attach, detach, and reattach the camera each time I want to upload images. That process gets annoying when you start becoming an intermediate photographer. Trust me, it's a serious annoyance when you do this maybe over 20 times in one day. It's all about getting the perfect shot.

    Also, I assume there could be more implementation to this, such as using an extended numberpad or keyboard to simply upload pictures. I mean, I've got a lot of ideas for a new way to manage images, I just need to know a couple simple things:

    1. How do I turn off the USB port?
    How do I make the computer and camera think the port is nonexistant?

    I was reading a way to do this is through the BIOS. And, of course, that's not going to be a solution when inside of an operating system. I don't remember being taught any way to reconfigure the BIOS settings once inside of the operating system.

    Another I read about was changing the kernel. This was just a comment on some website I saw, but I don't think I want to do that. I could do that. But if I have to restart the computer each time, then I don't think I'm going to like that.

    Anyone have ideas as to how to turn off the USB in Linux?

    Other than that, I found these threads on linuxquestions:

    1) HowDoI? Turn on/off usb light by time - LinuxQuestions.org
    2) Power off USB - LinuxQuestions.org

    Not the most mood lifting.

    I just plugged a digital camera into the USB right after the computer was turned off. It wasn't past BIOS, and it still believed it was connected to the computer and ready to transfer files. Hmm, perhaps this is a failed effort: It can't be done by software.

  2. #2
    Linux Guru Juan Pablo's Avatar
    Join Date
    Mar 2006
    Location
    /home/south_america/ecuador/quito
    Posts
    2,064
    Something I use on my iPod, the ipod won't notice it's attached to the computer.

    When I want to remove the iPod, I use the eject command and I can use the iPod normally although it's still attached to the computer, when I want to reattach it without disconnecting and connecting it again I use eject -p and the iPod is mounted again and with the "Do not disconnect" screen again.

    Don't know if it works with cameras but you should give it a try
    Put your hand in an oven for a minute and it will be like an hour, sit beside a beautiful woman for an hour and it will be like a minute, that is relativity. --Albert Einstein
    Linux User #425940

    Don't PM me with questions, instead post in the forums

  3. #3
    Just Joined!
    Join Date
    Jan 2011
    Posts
    1
    In ubuntu, to view what's connected:

    chris@chris-desktop:/sys/bus/usb/devices$ for device in $(ls /sys/bus/usb/devices/*/product); do echo $device;cat $device;done
    /sys/bus/usb/devices/3-2/product
    photosmart 7700 series
    /sys/bus/usb/devices/4-1/product
    Logitech Z-5 Speakers
    /sys/bus/usb/devices/usb1/product
    EHCI Host Controller
    /sys/bus/usb/devices/usb2/product
    EHCI Host Controller
    /sys/bus/usb/devices/usb3/product
    OHCI Host Controller
    /sys/bus/usb/devices/usb4/product
    OHCI Host Controller
    chris@chris-desktop:/sys/bus/usb/devices$

    In the case of my speakers I'd do the following:
    echo suspend | sudo tee /sys/bus/usb/devices/4-1/power/level

    TO turn back on:
    echo on | sudo tee /sys/bus/usb/devices/4-1/power/level

  4. $spacer_open
    $spacer_close

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •