4

I have Ubuntu 10.04 based portable touchscreen computers at workplace and sometimes people would use USB data cable to charge their phones from the USB port.

Now I have usb storage access disabled ($sudo leafpad /etc/modprobe.d/blacklist.conf and entering blacklist usb_storage at the very end) but now we have a requirement to stop this USB-Phone-Charging also.

Any solutions to this bizarre requirement i.e. to power OFF usb ports completely ???

The same I posted on unix - exchange but did not get any favorable solutions other than using a stick of glue to shut off the port or to de-solder USB terminal from motherboard.

Kindly give me some ideas to achieve my target without creating an absolute mess out of the piece of hardware.

EDIT

Before testing on the actual touchscreen computers (ubuntu 10.04), I did some work on my laptop (ubuntu 12.04). It has 3 USB ports, I HAVE SUCCESSFULLY DISABLED ONE PORT USING;

echo '2-1' |sudo tee /sys/bus/usb/drivers/usb/unbind

so IT IS POSSIBLE TO TURN OFF USB. My kernel version -- 3.13.0-32-generic

Now I am looking how to disable the rest TWO.

3
  • 1
    Please don't cross post. The answers on unix&linux were correct; there is no way to shut off the power short of physically disconnecting it.
    – psusi
    Dec 11, 2014 at 14:26
  • requesting you to do some research first... echo '2-1' |sudo tee /sys/bus/usb/drivers/usb/unbind i used this to turn OFF one of my three ports. SO IT IS VERY MUCH POSSIBLE TO SHUT OFF POWER!!! Dec 11, 2014 at 19:04
  • You are lucky then; on many systems it does not. Whether that actually cuts the power or not is entirely up to the hardware vendor. Also what are you now asking? If you got it working on one port then do the same thing to the others.
    – psusi
    Dec 11, 2014 at 19:25

2 Answers 2

2

I thought your question was interesting so I decided to look into it myself. What I found was this answer, and it rather looks like it might apply to your question, while at the same time offering others such as myself an interesting capability I never knew I had!

https://stackoverflow.com/questions/4702216/controlling-a-usb-power-supply-on-off-with-linux

1
  • I did some testing on my acer laptop that runs on 12.04 and I used, echo '2-1' |sudo tee /sys/bus/usb/drivers/usb/unbind It turned OFF one of my three usb ports. So IT IS POSSIBLE TO TURN OFF USB PORTS completely. I used /bind to turn it ON again Dec 11, 2014 at 19:10
2

I've been using a programmable USB hub from a company called Acroname (I know... but they make good stuff). Their hub requires mains power but actually disconnects the power lines from USB devices. I find it useful for tests I am running at work where I have to automate attach/detach of USB modules. It's a little expensive, but has saved me a lot of time. I am also able to measure and log current/voltage from each port.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .