faceofbo
Posts: 2
Joined: Tue Oct 11, 2016 8:23 pm
Location: Colorado

Pi 3 Model B+ USB Power Disable

Tue Oct 11, 2016 8:56 pm

I have something of a conundrum with the Pi 3 Model B. A late requirement in my project needs me to disable power on the USB ports, and enable power later at a particular point with a script.

I have a separate system connected via a USB cable which powers the system. When the raspberry begins to boot up, it takes about 3 seconds from when the boot up begins until the other system sees power form the USB. Further, when I reboot the raspberry with sudo reboot, power from the other system is cut off for a few seconds, then switches back on during the boot (at about the same time). This heavily implies that there should be some software/firmware level control for power on the USB-ports, but for the life of me I can't find it.

I have tried sudo sh -c 'echo 0x0 > /sys/devices/platform/soc/3f980000.usb/buspower, but all that seems to do is completely disable communication on the ports. Power is still being applied afterwards.

faceofbo
Posts: 2
Joined: Tue Oct 11, 2016 8:23 pm
Location: Colorado

Re: Pi 3 Model B+ USB Power Disable

Wed Oct 12, 2016 2:22 pm

I was actually able to find the driver setting to shut it of, so I'll post my solution here so that others can see it.

To shut off power on USB ports (this shuts power on ethernet as well):
echo '1-1' |sudo tee /sys/bus/usb/drivers/usb/unbind

To turn power back on
echo '1-1' |sudo tee /sys/bus/usb/drivers/usb/bind

Network functions and USB drivers appear to recover just fine after turning power back on.

smoneck
Posts: 5
Joined: Mon Oct 02, 2017 11:53 am

Re: Pi 3 Model B+ USB Power Disable

Tue Oct 03, 2017 6:49 am

I just found: On at least RPi3b power of all [USB-ports] and [Ethernet+WiFi] can be switched separately. There is a tool called uhubctl doing this using libusb (port 1 for Ethernet+Wifi, port 2 for USB).

RobW77
Posts: 2
Joined: Sun Dec 17, 2017 1:39 pm

Re: Pi 3 Model B+ USB Power Disable

Tue Dec 19, 2017 5:24 pm

Hi smoneck,

can you please describe what you´ve done?
I tried it. But it dosen´t work.
Thanks.
Robert

Return to “Advanced users”