User avatar
pmj1979
Posts: 17
Joined: Tue Sep 04, 2012 12:06 pm

Connecting USB devices reboot the Pi

Mon Sep 17, 2012 1:20 pm

Hi all,

Ive had my Pi for a week or so now and one of the very first and recurring problems I had with it is that, when I first connected a USB WiFi dongle (Belkin F5D7050 [Ralink RT2571W] ), the Pi rebooted itself. Being a Linux newbie I assumed that I shouldnt have plugged it in while booted up, or that I should have set up the firmware and/or drivers etc first. I ignored the problem and I carried on with a wired connection and played with other things. It then happened when I connected a different usb WiFi dongle (Netgear WNDA3200 [Atheros AR7010+AR9280]). It happens when plugged directly into either of the two USB ports, even now after I have all the firmware etc set up and I can get a wireless internet connection. I just have to have the dongle plugged in while its booting.

It also happened when I tried an unpowered unbranded USB hub with only a mouse and KB attached. I assumed it wasnt supported as it wasnt on the list at http://elinux.org/RPi_VerifiedPeripherals . The KB and mouse do no cause the reboot on their own. Ive just tried a random usb camera and an iPod directly connected and this does not reboot. Also just tried a handful of usb sticks. Some do cause reboot, some dont. Buffalo Ministation (HD-PF32OU2) randomly does.

I now have a powered Belkin hub that is supported and seems to be working well (it doesnt reboot when i plug/unplug it). The hub can power the Pi with no micro usb attached (which confused me at first!) though I always run with power to the Micro usb. It allows me to connect K/b, mouse, bluetooth, both the original wifi dongles and a new ASUS (N10 [Realtek RTL8188SU] ). The Asus also reboots the Pi when connected directly (not through the hub).
Even with nothing attached and with the Pi sat at the terminal screen waiting for a log in, plugging in these devices forces the reboot.

What I'd like to know is:
1)
Should I be able to plug/unplug any usb devices while the Pi is on?
1a)
Id like to have the Pi headless with the Asus dongle straight into the Pi, should this be possible with the option to plug/unplug whenever I might need to?

2)
What are the possible causes for the reboot?

3)
How do I check each possible cause off the list?

4)
I seem to have various power combinations available:
Power from adapter to micro usb
Power from hub direct to usb A
Power from hub to micro but plugging the usb A also provides power

Are there any unsafe combinations to powering my Pi?


The Pi (rev2 code4) is powered from an Apple iPad charger 5.1V 2.1A.
Running official Raspbian wheezy.
Update/graded often.
Connected to: Wired Internet | Logitech Wired Mouse | Behavior Tech Wired KB | Belkin powered 7Port Hub | HDMI



Sorry for rambling!

Peter
Pi from Element14 (still not got the first Pi from RS :( )
Rev2 board | Belkin 7Port powered hub | ASUS N10 WiFi | Logitech Wired Mouse | Behavior Tech Wired KB

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

Re: Connecting USB devices reboot the Pi

Mon Sep 17, 2012 1:39 pm

what is the power measured from tp1 tp2
you are probably running at right on the edge of good power and the dongle is pushing it over when plugged in -
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

thsBavR10
Posts: 233
Joined: Sat Jul 21, 2012 3:11 pm

Re: Connecting USB devices reboot the Pi

Mon Sep 17, 2012 1:55 pm

Sounds like the power surge problem, which is discussed elsewhere.
(for example http://www.raspberrypi.org/phpBB3/viewt ... 28&t=16582, http://www.raspberrypi.org/phpBB3/viewtopic.php?t=8591)
Some USB devices need a current above 100 ma during startup. Some wifi adapters do.
This causes an transient voltage slump, what the Pi causes to boot.
I suspect you have a Pi rev1 board with 0000R populated near the LEDs, or a rev2 board.
You could the dongle always let plugged in, or use a powered USB hub.

User avatar
malakai
Posts: 1382
Joined: Sat Sep 15, 2012 10:35 am
Contact: Website

Re: Connecting USB devices reboot the Pi

Mon Sep 17, 2012 2:05 pm

2.6 kernels had a power feature that was removed in later versions is it possible in the build we have to issue power off or the equivalent?
http://www.raspians.com - always looking for content feel free to ask to have it posted. Or sign up and message me to become a contributor to the site. Raspians is not affiliated with the Raspberry Pi Foundation. (RPi's + You = Raspians)

User avatar
pmj1979
Posts: 17
Joined: Tue Sep 04, 2012 12:06 pm

Re: Connecting USB devices reboot the Pi

Mon Sep 17, 2012 4:06 pm

The voltage hovers around 4.88 and I didnt see it going any higher than 5.08 while booting.

I tried to record it while plugging the asus adapter in but sods law, it didnt reboot. I switched to plugging it in the other port and it started again. 99 times out of 100 it will reboot, though occasionally it would seem to be ok.

Voltage during power and reboot...
http://www.youtube.com/watch?v=mDzcD7M2IkY

The adapter powering the hub is rated at 2.5A
This is what I ordered but not exactly what showed up (mine has part number F4U018-BLK) http://www.amazon.co.uk/gp/product/B003CJ6EGK
Whats the best way to test how much current the pi is using and how much each device is pulling?

The Pi is definitely the rev 2, made in the UK printed by the card slot plus mounting holes.
Last edited by pmj1979 on Mon Sep 17, 2012 4:17 pm, edited 1 time in total.
Pi from Element14 (still not got the first Pi from RS :( )
Rev2 board | Belkin 7Port powered hub | ASUS N10 WiFi | Logitech Wired Mouse | Behavior Tech Wired KB

User avatar
Dweeber
Posts: 606
Joined: Fri Aug 17, 2012 3:35 am
Location: Mesa, AZ
Contact: Website

Re: Connecting USB devices reboot the Pi

Mon Sep 17, 2012 4:12 pm

As a reference...

My second RPi (an ECN0003) does this when removing or adding the WiFi USB dongle (Edimax or Airlink). My first RPi (an ECN0002) does not. Makes no difference if I interchange the WiFI dongles, power supplies even the OS between the two.

The automatic WiFi install script by MrEngman had to be modified due to this issue.

Haven't gotten an ECN0004 yet, so I don't know if that hardware change still causes this.
Dweeber A.K.A. Kevin...
My RPI Info Pages including Current Setup - http://rpi.tnet.com

Genius23008
Posts: 54
Joined: Sun Jun 03, 2012 6:50 am

Re: Connecting USB devices reboot the Pi

Wed Sep 19, 2012 4:26 pm

I cannot seem to get the Texet Wifi dongle (Realtek RTL8188SU) to work. Plugging it into a powered hub seems to make the RPi pick it up, and lsusb and lsmod seem to detect it too. However, it won't work at all! I can't see any menu to select a network, neither through command line! Can anybody help me? By the way, lsmod says that it's a R8712U, which is wrong.

Joe Schmoe
Posts: 4277
Joined: Sun Jan 15, 2012 1:11 pm

Re: Connecting USB devices reboot the Pi

Tue Dec 18, 2012 8:31 pm

Genius23008 wrote:I cannot seem to get the Texet Wifi dongle (Realtek RTL8188SU) to work. Plugging it into a powered hub seems to make the RPi pick it up, and lsusb and lsmod seem to detect it too. However, it won't work at all! I can't see any menu to select a network, neither through command line! Can anybody help me? By the way, lsmod says that it's a R8712U, which is wrong.
This just happened to me today. I had my Pi running just fine, then I decided to try plugging in a USB Wifi dongle - and the machine rebooted. When it came back up (with, obviously, the dongle still in the socket), everything seemed to be fine (lsmod showed the 8192cu module loaded, iwconfig and ifconfig both showed the wlan0 device). I didn't go the full test of making sure that the wifi could actually go and connect to a network - didn't see the need.

But anyway, is this the state of the art? Is it just something we have to live with? It is, like everything else (or so it seems) a power supply problem at the base of it? I assume that the problem is that when you "hot-plug" it, it draws more current (momentarily) than it does if the thing is plugged in before booting. Have I got this right?
And some folks need to stop being fanboys and see the forest behind the trees.

(One of the best lines I've seen on this board lately)

obcd
Posts: 917
Joined: Sun Jul 29, 2012 9:06 pm

Re: Connecting USB devices reboot the Pi

Wed Dec 19, 2012 7:53 am

Yes, you have it right. Most devices have capacitors on their power lines. Those are used to keep the supply voltage stable. At plugin, they need to charge to the supply voltage. This forms a temporary heavy load on the supply and causes a small dip in the supply voltage. A good design uses a special chip to prevent this. Those prevent the excessive surge current at plugin so that everything keeps working. The first rev. of raspberry pi's had the polyfuses which also limited the plugin current. Some of them had a 2 high resistance, so they were removed. Nobody had expected this would cause the reboot issues.

Joe Schmoe
Posts: 4277
Joined: Sun Jan 15, 2012 1:11 pm

Re: Connecting USB devices reboot the Pi

Wed Dec 19, 2012 10:39 am

But why is it different between the case of "hot plugging" it (plugging it in after boot) vs. having it plugged in from the start? Wouldn't the "high draw" (to charge the caps) be there in either case?

Anyway, why the reboot? What's the theory behind that? Is it that when the high current pull happens, the Pi board (i.e., the rest of it - and maybe specifically the CPU) gets a low-voltage condition and responds by rebooting? Or is it that the power supply responds to the high current pull by shutting down (momentarily) causing the board to experience zero-voltage (momentarily) - which obviously results in a reboot?

I suspect it is not the later, because then it would only happen when using a power supply that can't supply a lot of current - and I redid the test with a PSU rated 1.8 A and the same thing happened.

But anyway, is this "just the way it is"? Why does it happen on the Pi, but not on "regular" computers?
And some folks need to stop being fanboys and see the forest behind the trees.

(One of the best lines I've seen on this board lately)

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

Re: Connecting USB devices reboot the Pi

Wed Dec 19, 2012 5:16 pm

Starting with it already plugged in:
The PSU has to provide current to charge all the capacitors on the 5v rail including the ones in USB devices. This means that the '5v' ramps up from zero
At some point there's enough voltage for the Pi to start (on Rev 2 boards there's a cap C97 that holds the reset line low for a time, so that the 5v can settle) and then it starts to boot

Hot Pugging:
the 5v rail is stable, and the Pi running. You plug in the device. Current has to pass from the Pi's 5v rail to the caps on the device. Initially this will come from the caps on the Pi, and only after their voltage has begun to drop will the PSU react by driving extra current in.
But the poly-fuse has a non-zero resistance, so that current cannot instantaneously refill the caps, and the 5v may drop sufficently for the SoC to stop working, and may trigger a reset.

On a desktop PC there isn't usually a poly-fuse to limit the current, and in fact you probably have a very large capacitor backing the 5v rail, so any drop will be minimal

Joe Schmoe
Posts: 4277
Joined: Sun Jan 15, 2012 1:11 pm

Re: Connecting USB devices reboot the Pi

Wed Dec 19, 2012 5:29 pm

Good explanation. Thanks. BTW, my board is the latest revision (AFAIK) - that doesn't have the bad polyfuses. I don't know if this is relevant to your comments re: polyfuses - or not.

By the way, what do you think of the suggestion made by some other poster (on this or a related thread) that there should be a polyfuse between the +5 rail and the USB +5 input - to keep it from sucking up all the power. He (the other poster) says that this would solve the problem of the Pi rebooting on USB insertion.
And some folks need to stop being fanboys and see the forest behind the trees.

(One of the best lines I've seen on this board lately)

lassepi1lis
Posts: 6
Joined: Fri Nov 23, 2012 5:12 pm

Re: Connecting USB devices reboot the Pi

Wed Dec 19, 2012 5:45 pm

My RasPi from RS (Made in China) hade a 0.45 voltage drop over Polyfuse F3 with a USB kb+mouse at 130mA. Solder a jumper over the fuse was the fix. No problem with RasPi Made in the UK.

thsBavR10
Posts: 233
Joined: Sat Jul 21, 2012 3:11 pm

Re: Connecting USB devices reboot the Pi

Wed Dec 19, 2012 5:47 pm

But also in the newest revision of the Pi there is a polyfuse 'F3' for the mains voltage,
located under the board, neer to the micro usb.

User avatar
howroyd
Posts: 39
Joined: Thu Aug 02, 2012 1:41 pm
Location: Loughborough
Contact: Website

Re: Connecting USB devices reboot the Pi

Wed Jul 09, 2014 11:12 am

Same issue here. Pretty convinced it is a power surge which brwns out the rPi.

Has anyone tried soldering a decent sized capacitor onto the 5v rail to handle the surge?

Return to “Troubleshooting”