Turn power OFF of USB Ports - Ubuntu 10.04 machine
Solution 1
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
Solution 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.
Related videos on Youtube
RicoRicochet
Hye fellow coders, I am AJ, I mainly work on QT with C++ for linux based systems. Well I am still a greenhorn in this field so I really appreciate the entire structure of stackoverflow and how it helps people like me. Thanks to all, and keep helping each other.
Updated on September 18, 2022Comments
-
RicoRicochet over 1 year
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.
-
RicoRicochet over 9 yearsI 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