dRbiG
Posts: 6
Joined: Thu Aug 09, 2012 9:31 am
Location: Europe, Earth
Contact: Website

Power over USB.

Thu Aug 09, 2012 9:46 am

Hello,

I have a feeling I'm not the first to ask about it, but still...

Is powering a RPi by attaching a powered USB hub a design feature?
In other words - is it okay and the hardware is design for it or is it rather a side-effect/consequence of cost cutting/lack of proper separation/etc.

My main concern here is longevity of the RPi, and first time I realised that my powered hub is actually bleeding current and powering the whole setup I wasn't all that happy.

Though I'd rather have one PSU than two, so if it is actually designed to be powered this way I'm all for it.
But all's one level plain he hunts for flowers.
http://www.drbig.one.pl

User avatar
RaTTuS
Posts: 10484
Joined: Tue Nov 29, 2011 11:12 am
Location: North West UK

Re: Power over USB.

Thu Aug 09, 2012 9:54 am

if you mean your cheep powered hub is back powering the RPi then no,
this is because your cheep hub is not doing what it's should, and you will not be able ti run your RPi like that very well.
this is where the "Cut the red lead" - comes in .
you can
take your hub and use a USB -> micro usb lead and power the RPi from that and then take a
USB a to USB B [probably] lead and use the hub as a power source for your other items.
if you switch off the hub then the RPI will power off also.

does this help?
How To ask Questions :- http://www.catb.org/esr/faqs/smart-questions.html
WARNING - some parts of this post may be erroneous YMMV

1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX
Covfefe

User avatar
Burngate
Posts: 6046
Joined: Thu Sep 29, 2011 4:34 pm
Location: Berkshire UK Tralfamadore
Contact: Website

Re: Power over USB.

Thu Aug 09, 2012 9:58 am

It's a feature that wasn't designed in.
The USB ports have low current (high resistance) fuses. Some (but not all) powered hubs do not prevent power to go back through their inputs.
So when the Pi is unpowered and is connected to one of those hubs, enough power can get back to partially power the Pi.
But because of those fuses, not enough power will get back to do the job properly.
And properly designed hubs won't do it al all.

User avatar
mahjongg
Forum Moderator
Forum Moderator
Posts: 12332
Joined: Sun Mar 11, 2012 12:19 am
Location: South Holland, The Netherlands

Re: Power over USB.

Thu Aug 09, 2012 10:02 am

I'm not quite sure there is a question in your post somewhere, but here are the pertinent facts.

* Current trough the PI's USB port is limited by polyfuses, which will "blow" onwards from about 140mA (depending on several factors, such as temperature and/or whether the fuse has "blown" before.
* Because of the polyfuses the USB ports are not suitable to power the PI through them
* The PI will not be damaged, when you apply unsuitable (too low) power, but it might behave erratically, and the contents and even the SD-card itself might become damaged if you do for an extended period.
* Some, but not all powered HUB's simply connect their internal 5V also to the input port, in the hope that this will also enable them to behave as unpowered hub's (which is against USB spec).
* if you power the hub, but not the PI the PI may get unsuitable low power from the hub, because of the polyfuses that are "in the way".
* One solution is to simply turn on hub an PI at the same time.
* The other solution is to power the PI from the hub, thereby "bypassing" the polyfuses, the hub must be able to deliver enough current to the PI, the PI normally needs 700mA of which 200mA is reserved for USB devices, so if you do not use USB devices on the PI (other than the hub, obviously) then 500mA should be enough, and most hubs should be able to deliver this from a single port.

dRbiG
Posts: 6
Joined: Thu Aug 09, 2012 9:31 am
Location: Europe, Earth
Contact: Website

Re: Power over USB.

Thu Aug 09, 2012 1:06 pm

Sorry for any unclear issues in the first post.

So what I gather now is that this 'reverse bleed-through current' is not a good way to power a RPi, especially in the long run. This is actually what I was thinking, but thanks for confirming.

I have a 3.5A rated hub, so I assume it should be enough to power my RPi (via the 'loop' configuration as described by RaTTuS) and some additional devices. I'll certainly try that :)

And thanks for prompt replies!
But all's one level plain he hunts for flowers.
http://www.drbig.one.pl

User avatar
Lob0426
Posts: 2198
Joined: Fri Aug 05, 2011 4:30 pm
Location: Susanville CA.
Contact: Website

Re: Power over USB.

Fri Aug 10, 2012 7:09 pm

mahjongg wrote:I'm not quite sure there is a question in your post somewhere, but here are the pertinent facts.

* Current trough the PI's USB port is limited by polyfuses, which will "blow" onwards from about 140mA (depending on several factors, such as temperature and/or whether the fuse has "blown" before.
* Because of the polyfuses the USB ports are not suitable to power the PI through them
* The PI will not be damaged, when you apply unsuitable (too low) power, but it might behave erratically, and the contents and even the SD-card itself might become damaged if you do for an extended period.
* Some, but not all powered HUB's simply connect their internal 5V also to the input port, in the hope that this will also enable them to behave as unpowered hub's (which is against USB spec).
* if you power the hub, but not the PI the PI may get unsuitable low power from the hub, because of the polyfuses that are "in the way".
* One solution is to simply turn on hub an PI at the same time.
* The other solution is to power the PI from the hub, thereby "bypassing" the polyfuses, the hub must be able to deliver enough current to the PI, the PI normally needs 700mA of which 200mA is reserved for USB devices, so if you do not use USB devices on the PI (other than the hub, obviously) then 500mA should be enough, and most hubs should be able to deliver this from a single port.
@ mahjongg: I replaced the F2 fuse with a 500ma and it indeed will run a RasPi back-powered without problems.
The problem with the hub back-powering your RasPi is that it will start to boot then reset. It will continue to do this until you unplug the hub. This will corrupt your SD card boot sooner or later. Many people are powering their RasPii from a hub by using a USB to MicroB cable from one of the hub ports. So you have a Data only cable from your RasPI to the hub and a Power only from the hub to the RasPi.
512MB version 2.0 as WordPress Server
Motorola Lapdock with Pi2B
Modded Rev 1.0 with pin headers at USB

http://rich1.dyndns.tv/
(RS)Allied ships old stock to reward its Customers for long wait!

vinntec
Posts: 145
Joined: Thu Aug 02, 2012 9:37 am
Location: Basingstoke, UK

Re: Power over USB.

Mon Aug 13, 2012 4:25 pm

I am still totally confused about this topic, so apologies about that!
I have a powered hub which caused problems when connected (keyboard and/or mouse and/network stopped working) which I would like to use.

If I understand correctly, if I connect one of the output ports from the powered hub to the RPI power connection via a mini-USB adapter, I can then also use the input cable of the hub to connect to the RPi and use the other ports on the hub it as it was intended without any problem?

The bit I don't understand is what stops the hub causing trouble on its USB connection with the RPi - or does this need to have the cables cut as described elsewhere? If so, I can't find the photos that showed this very clearly anywhere - does anyone have a link if this mod is needed? If not, why not and is this an official RPi recommendation, or just current thoughts?

Thanks to all - Peter

nijhawank
Posts: 23
Joined: Sat Aug 04, 2012 8:26 am

Re: Power over USB.

Wed Aug 15, 2012 6:14 am

vinntec wrote:The bit I don't understand is what stops the hub causing trouble on its USB connection with the RPi - or does this need to have the cables cut as described elsewhere? If so, I can't find the photos that showed this very clearly anywhere - does anyone have a link if this mod is needed? If not, why not and is this an official RPi recommendation, or just current thoughts?

Thanks to all - Peter
I think you need to cut the red wire in the connection from RPi to USB hub so that USB hub does not attemp to back-power RPi.

User avatar
RaTTuS
Posts: 10484
Joined: Tue Nov 29, 2011 11:12 am
Location: North West UK

Re: Power over USB.

Wed Aug 15, 2012 7:36 am

How To ask Questions :- http://www.catb.org/esr/faqs/smart-questions.html
WARNING - some parts of this post may be erroneous YMMV

1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX
Covfefe

rilski
Posts: 12
Joined: Wed Aug 15, 2012 9:33 am

Re: Power over USB.

Wed Aug 15, 2012 9:54 am

Yes I think it can run via USB providing that it can supply the amount of power it requires.

Aside from USB powering for 5v source, a simple ATX psu mod would suffice also.

dRbiG
Posts: 6
Joined: Thu Aug 09, 2012 9:31 am
Location: Europe, Earth
Contact: Website

Re: Power over USB.

Fri Aug 31, 2012 2:33 pm

(Information repeated for better coherence)

Approach one:
1. The hub is unplugged from the mains
2. Connect the hub data cable to RPi USB port
3. Use a cable to connect RPi power input to the hub
4. Power on the hub
==> Endless reboots

Questions:
The wire cutting does sound reasonable, the question is do I have to do both:
1) Cut the power wires on the usb hub data to rpi usb port cable
2) Cut data wires on the usb hub port to rpi power input
I'd say that 1) should be enough, but then if someone experimented with that already...
Also there is the problem of actually cutting the wires. All cables I have have machine-sealed plugs, and I'm betting that the cable inside will be some thin-wired mesh that is close to impossible to operate on without breaking everything.

Approach two:
1. The hub is unplugged from the mains
2. Use a cable to connect RPi power input to the hub
3. Power on the hub
4. Connect the hub data cable to RPi USB port
==> Works fine

Pros: Works and you can use generic cables
Cons: You can't switch on the whole setup but mere button press
But all's one level plain he hunts for flowers.
http://www.drbig.one.pl

User avatar
Burngate
Posts: 6046
Joined: Thu Sep 29, 2011 4:34 pm
Location: Berkshire UK Tralfamadore
Contact: Website

Re: Power over USB.

Fri Aug 31, 2012 3:46 pm

The situation just got more complicated. The latest RPi has jumpers (0 ohm resistors) instead of the fuses I mentioned earlier, so back-powering from a hub might now work better than it did.

Wire cutting. The power input socket doesn't have the data pins connected, so it's not necessary to cut the data wires.

Depending on the hub, since it's not to the USB spec (since it does what it shouldn't - feed power back to the RPi) it's entirely possible that it can't feed enough power back to run the RPi successfully.
It's also possible that even it's proper output ports can't quite give the RPi enough power on start-up, but getting the RPi up and running then connecting the data gives just enough leeway for everything to work. As always, YMMV

dRbiG
Posts: 6
Joined: Thu Aug 09, 2012 9:31 am
Location: Europe, Earth
Contact: Website

Re: Power over USB.

Fri Aug 31, 2012 7:51 pm

Wire cutting. The power input socket doesn't have the data pins connected, so it's not necessary to cut the data wires.
That's very good to know, thank you!
What's left is to somehow try and see if disconnecting the power pins on the hub data <-> RPi usb port will make it boot okay.
The situation just got more complicated. The latest RPi has jumpers [...]
Any better indication of how to tell if my RPi is that 'latest'? A photo would be best. In my current setup I can't see the bottom side of the pcb without powering everything down and doing some disassembly :)

Also, I believe I have never been near a usb hub that fully conforms to the specs. My current choice are chinese 'LogiLink' hubs as they are the only ones that have 3.5A power adapters and are able to power my external hdd (and RPi at the same time, hopefully they have enough power left to make a usb wifi card work...).
But all's one level plain he hunts for flowers.
http://www.drbig.one.pl

dRbiG
Posts: 6
Joined: Thu Aug 09, 2012 9:31 am
Location: Europe, Earth
Contact: Website

Re: Power over USB.

Sun Sep 02, 2012 10:54 am

Solved! So to say :)

I disconnected the power pins on the usb data <-> RPi usb port and the whole setup behaves as expected - that is I can power it on by just pressing the power switch on the hub.

As for disconnecting pins, this might be useful:
If you happen to have a usb hub with usb data plug that has the power pins (they are the rightmost and leftmost pins) protruding slightly more than the data pins (this is in accordance to the standard I believe, but we all know how standards are in practice...) you can easily disconnect them without ever touching the cable by cutting out an U shape from a piece of paper (or preferably from some thin and stiff plastic foil) - the U shape should cover the power pins but leave the data pins open. You place the paper/plastic in the plug and insert it gently into the socket and presto! No need to cut cables.
But all's one level plain he hunts for flowers.
http://www.drbig.one.pl

User avatar
Dyfatty
Posts: 7
Joined: Thu Aug 09, 2012 11:13 am

Re: Power over USB.

Mon Sep 10, 2012 7:25 am

I have been running my Rpi via a Belking 7 port powered hub (rated at 2.5amp) back feeding continuously for about a week. I accidentally discovered the ability when attempting to power down by disconnecting the psu and it kept working!

I am pleased to say that leaving it powered up this way and not powering down every day has proved the Rpi completely stable running Raspbmc quite heavily.

I am running a Model B Revision 1.0 + ECN0001 (no fuses, D14 removed)

You can determine which board revision you have by typing sudo cat /proc/cpuinfo at the command line and looking up the hardware revision code in the following table:

MODEL AND REVISION CODE(S)
Model B Revision 1.0 2
Model B Revision 1.0 + ECN0001 (no fuses, D14 removed) 3
Model B Revision 2.0 4, 5, 6


Anyone tried the Revision 3 addon ? I am still laughing at the severed head gag.

User avatar
Lob0426
Posts: 2198
Joined: Fri Aug 05, 2011 4:30 pm
Location: Susanville CA.
Contact: Website

Re: Power over USB.

Mon Sep 10, 2012 4:33 pm

With the new version 2.0 PCB and a non-compliant hub the RasPi will power from the hub, with no problems except maybe hot plug issues. We will have to see. A non-compliant hub means a hub that applies power throught the uplink port, they are not supposed too.

The only real problem might be resistance from cable length and the connectors on the uplink port. Use a short 18" (under .5 meter) cable to get the best results. You need to have at least 4.7v at TP1/TP2. This will depend on the quality of power supply your USB hub has.

Before you comment about the voltage I just quoted, remember I ran mine fine at as low as 4.25v at the test points. The test points are at the wrong end of the board when you back-power and do not always read correctly.

My setup is running just fine at an average of 4.73v.
512MB version 2.0 as WordPress Server
Motorola Lapdock with Pi2B
Modded Rev 1.0 with pin headers at USB

http://rich1.dyndns.tv/
(RS)Allied ships old stock to reward its Customers for long wait!

Return to “Advanced users”