WalterH
Posts: 1
Joined: Tue Oct 31, 2017 4:01 pm

How do i disable micro-usb ports

Tue Oct 31, 2017 4:07 pm

Hello, i am currently hosting a vnc server on a raspberry pi zero w through an ssl tunnel and want to be able to power the unused micro-usb port (the 2nd is used to power the raspberry pi zero w on) through the ssh. I am familiar with python but not so much with raspbian. Googling also didn't work out for me and i would appreciate feedback. Thanks.

scotty101
Posts: 3958
Joined: Fri Jun 08, 2012 6:03 pm

Re: How do i disable micro-usb ports

Tue Oct 31, 2017 5:04 pm

You can't control the power to the USB port on the Pi Zero. It always has 5V on it if the Pi is running.
Electronic and Computer Engineer
Pi Interests: Home Automation, IOT, Python and Tkinter

User avatar
AllanGH
Posts: 29
Joined: Wed Oct 25, 2017 8:09 am
Location: 34.033909, -117.313616

Re: How do i disable micro-usb ports

Fri Nov 03, 2017 1:56 am

In theory, and I say that because I don't have a Zero in hand, one could cut the +5V trace to the MicroUSB port and bridge the gap with a very small SSR, and control said SSR via a GPIO pin; however, though I have done similarly with other development boards, and it's not a big deal, you may not want to get into doing that much.
##########################

http://www.catb.org/~esr/faqs/smart-questions.html

ali.soltani
Posts: 24
Joined: Sat Sep 02, 2017 10:33 pm

Re: How do i disable micro-usb ports

Fri Nov 03, 2017 8:11 am

can it disable power to a touch lcd that connected to it?
(using for backlight turning off or screen saver)

when we turn on the rpi first every usb isn't powered after loading they powered up so it can be controled! :P

drgeoff
Posts: 10676
Joined: Wed Jan 25, 2012 6:39 pm

Re: How do i disable micro-usb ports

Fri Nov 03, 2017 9:30 am

All the 5 volt points* on a Zero or ZeroW are directly connected together by the PCB tracks. There is no way that software alone can break the path between any of them.

(* The two micro-USB sockets, the relevant holes in the GPIO header area, the dc-dc converters etc)

User avatar
AllanGH
Posts: 29
Joined: Wed Oct 25, 2017 8:09 am
Location: 34.033909, -117.313616

Re: How do i disable micro-usb ports

Fri Nov 03, 2017 10:24 pm

This appears not to be the case with the Pi3, which is what I'm working with in the RPi pecking order, as the 5VDC at the GPIO header is supplying 5VDC any time the Pi3 is connected to the power supply, whereas the 5VDC at the USB ports goes dead when the board is halted at the console session, or shutdown via GPIO3 instruction.

Nevertheless, hardware modifications can solve this problem, as previously mentioned.
##########################

http://www.catb.org/~esr/faqs/smart-questions.html

User avatar
rpdom
Posts: 17029
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: How do i disable micro-usb ports

Sat Nov 04, 2017 6:02 am

AllanGH wrote:
Fri Nov 03, 2017 10:24 pm
This appears not to be the case with the Pi3, which is what I'm working with in the RPi pecking order, as the 5VDC at the GPIO header is supplying 5VDC any time the Pi3 is connected to the power supply, whereas the 5VDC at the USB ports goes dead when the board is halted at the console session, or shutdown via GPIO3 instruction.
The OP said
Hello, i am currently hosting a vnc server on a raspberry pi zero w
so mentioning the Pi3B is irrelevant.
Nevertheless, hardware modifications can solve this problem, as previously mentioned.
I would not like to attempt that modification to the board. It is most likely to end up with a dead Zero. If I was looking to do something that crazy I would be more likely to solder wires to the test points under the USB sockets and make an external microUSB (or full-size USB) socket with a mosfet or something to switch the power. Doing that or using an SSD will increase the costs and complexity.

User avatar
AllanGH
Posts: 29
Joined: Wed Oct 25, 2017 8:09 am
Location: 34.033909, -117.313616

Re: How do i disable micro-usb ports

Sat Nov 04, 2017 9:07 pm

This is why I pointed out that I was working with the Pi3. I was framing the context of the proposed hardware modification, in that it works quite well on the 3, yet further investigation would be required to see if the relevant +5VDC trace is accessible for cutting and shunting-off to the output contacts of an SSR.

Practically-speaking, there is a very good expectation that such an approach would be successful, if all you want to do is to kill the +5VDC to a particular output MicroUSB connector. The hurdle to be overcome is whether or not a given individual wants to be bothered to do it at all.
##########################

http://www.catb.org/~esr/faqs/smart-questions.html

Return to “Advanced users”