Raspberry turn off usb ports


download this

https://github.com/codazoda/hub-ctrl.c

You can control the power on a port using the following command. (I installed it in user bin directory)

sudo $HOME/bin/hub-ctrl -h 1 -P 2 -p 1

That says to control hub 3 (-h 3) port 1 (-P 1) and to turn the power off (-p 0). You can also use ”-p 1” to turn the power back on.