openstf / stf

Control and manage Android devices from your browser.
https://openstf.io
Other
13.17k stars 2.71k forks source link

USB devices randomly disconnecting themselves every few seconds #677

Closed Rabusek closed 6 years ago

Rabusek commented 6 years ago

What is the issue or idea you have? USB devices randomly disconnecting themselves

Does it only happen on a specific device? Please run adb devices -l and paste the corresponding row. No matter the devices, it was working well on 3-4 devices, then suddenly when I plugged two more it started to constantly restart - even unplugging the other ones does not fix the issue

Please provide the steps to reproduce the issue.

  1. Plug 3-4 devices
  2. Start STF
  3. Plug two more

What is the expected behavior? They should work

Do you see errors or warnings in the stf local output? If so, please paste them or the full log here. https://pastebin.com/fj02PxEy

Please run stf doctor and paste the output here. N/A, using docker, and while doing that it throws errors that are unrelated (like "adb is missing" while I'm able to fully use the devices)

chrome_2017-08-17_13-02-20 chrome_2017-08-17_13-02-09

sorccu commented 6 years ago

This is in the README. Hardware issues are no joke. Get better hardware.

On Thu, Aug 17, 2017 at 20:08 Patryk notifications@github.com wrote:

What is the issue or idea you have? USB devices randomly disconnecting themselves

Does it only happen on a specific device? Please run adb devices -l and paste the corresponding row. No matter the devices, it was working well on 3-4 devices, then suddenly when I plugged two more it started to constantly restart - even unplugging the other ones does not fix the issue

Please provide the steps to reproduce the issue.

  1. Plug 3-4 devices
  2. Start STF
  3. Plug two more

What is the expected behavior? They should work

Do you see errors or warnings in the stf local output? If so, please paste them or the full log here. https://pastebin.com/fj02PxEy

Please run stf doctor and paste the output here. N/A, using docker, and while doing that it throws errors that are unrelated (like "adb is missing" while I'm able to fully use the devices)

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/openstf/stf/issues/677, or mute the thread https://github.com/notifications/unsubscribe-auth/AAB-_QfC1rncT-L7sHZS0C7Yho4RO2dGks5sZB8mgaJpZM4O6HCz .

Rabusek commented 6 years ago

I bought hardware specifically following the README. G4560 (so newest gen CPU) and B250M motherboard, along with SSD and 8gb of rams. Also top-end usb hubs, active, powered from power outlet.

sorccu commented 6 years ago

And what's the exact model of the hub?

On Thu, Aug 17, 2017 at 20:11 Patryk notifications@github.com wrote:

I bought hardware specifically following the README. G4560 (so newest gen CPU) and B250M motherboard, along with SSD and 8gb of rams. Also top-end usb hubs, active, powered from power outlet.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/openstf/stf/issues/677#issuecomment-323039932, or mute the thread https://github.com/notifications/unsubscribe-auth/AAB-_ciFuYjiyWW6XK9V3g8cHqoaaeeuks5sZB_egaJpZM4O6HCz .

Rabusek commented 6 years ago

http://www.tp-link.com.pl/products/details/cat-5688_UH700.html - UH700 TP Link, you can't even get a more expensive one in here. Also, I've been playing with STF a year or two ago, and it worked up to 10 devices on mac (!), so should work here too I guess?

One more thing - I'm still waiting for the StarTech usb controller, but I think 6 devices should not restart themselves

sorccu commented 6 years ago

That hub is no good. It comes with a power adapter that's able to provide 12V2A=24W. Even if the hub supported battery charging spec 1.1 or 1.2, a device may use up to 5V1.5A=7.5W, though usually 1A would be closer. As you can see it's impossible for the hub to provide enough power. In the manual, it even says: For best performance, the connected devices should not exceed a combined current of 8A for UH720 (5A for UH700).

It's also highly unlikely that the hub actually supports BC, so even in that sense it's just no good. Even ignoring the total output issue, it may be unable to provide enough power for even a single power hungry device.

It's not about the price... it's about specs. You should return the hub or throw it away.

On Thu, Aug 17, 2017 at 20:15 Patryk notifications@github.com wrote:

http://www.tp-link.com.pl/products/details/cat-5688_UH700.html - UH700 TP Link, you can't even get a more expensive one in here. Also, I've been playing with STF a year or two ago, and it worked up to 10 devices on mac (!), so should work here too I guess?

One more thing - I'm still waiting for the StarTech usb controller, but I think 6 devices should not restart themselves

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/openstf/stf/issues/677#issuecomment-323040852, or mute the thread https://github.com/notifications/unsubscribe-auth/AAB-_SH7PgqVtsWW5ATGi_tzBmBdqewUks5sZCDIgaJpZM4O6HCz .

Rabusek commented 6 years ago

@sorccu big thanks for this support that you didn't even had to provide - I have a few of those hubs already unfortunately (they did work with mac up to 12 devices), so for now I'll just plug less devices per hub and then import the pluggable from US.

Thanks!

sorccu commented 6 years ago

That's the thing with USB hardware issues - sometimes things work for a while but aren't stable long term. I'm not sure where you're located but you should have other options than buying from the US, see http://plugable.com/products/usb2-hub7bc/. Also, it doesn't have to be that exact hub, but it needs to have similar specs.

Do note that you could also have issues with your other components. Right now the hub is the only component that's obviously bad but who knows? Having the latest and greatest isn't necessarily a guarantee of anything either - older Intel processors used to have enough resources to support 50+ phones connected simultaneously, but now you're limited to 8-12 without a PCIE card. It's a huge pain honestly as soon as you try to connect more devices than an average consumer would.

Your motherboard could also have a USB chipset that has quirks in Linux. That's why it would be best to get the PCIE card to minimize the variables. And again, note that there are differences between PCIE cards, you have to choose one with the right specs.

Rabusek commented 6 years ago

Sure, but who has the resources to test out all the USB Hubs and usb extension cards out there? ;) You guys (or just you?) did a great job handpicking two best options for both hubs and extension cards.

My StarTech PCIe card should arrive next week, and I just ordered the pluggable usb 2.0 hub, so hopefully it'll sort out at least those problems I face now.

Thanks!

Rabusek commented 6 years ago

Just in case someone has similiar issue - I was making a research what's wrong with UH700/720. Turns out, for some reason, in some cases, it tends to restart every 30 seconds (rough estimate of how often my devices were kicked off stf):

https://ubuntuforums.org/showthread.php?t=2201564

Removing extension cord should help. Also, it's basically 4 port device with... another hub plugged into one of its ports. Nice engineering TP-Link ;)

One more thing: It fixed itself (disconnecting) when I connected the hub to 2.0 port in front of the PC panel rather than 3.0 port.

Rabusek commented 6 years ago

One (really) last tip, that could help someone - I wasn't able to fix the 3.0 ports, BUT, after turning off ALL USB options in bios and, using powertop, in tunables, selecting autosupsend as "bad" resolved the issue completely. Even with the mentioned hubs, I was able to connect 24 devices (3x7 + 3 ports) and everything is super stable. I have no idea how I managed to get to this point, because no one mentioned fiddling with that option, but it helped me. 2017-08-21_00-49-53

sorccu commented 6 years ago

Yes, BIOS settings can help sometimes. However, the settings themselves depend heavily on the motherboard and they can be labelled in various ways, or more commonly not be present at all. We will therefore under no circumstance provide BIOS advice as that would be a complete nightmare.

However, if you have the skills to look into the settings by yourself, then it can sometimes work out. Glad you found a way.

Do keep in mind that the stability could only be temporary, though.

On Mon, Aug 21, 2017 at 7:50 Patryk notifications@github.com wrote:

One (really) last tip, that could help someone - I wasn't able to fix the 3.0 ports, BUT, after turning off ALL USB options in bios and, using powertop, in tunables, selecting autosupsend as "bad" resolved the issue completely. Even with the mentioned hubs, I was able to connect 24 devices (3x7 + 3 ports) and everything is super stable.

[image: 2017-08-21_00-49-53] https://user-images.githubusercontent.com/10826482/29499140-b5606574-860a-11e7-9a57-a364c6f58eca.png

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/openstf/stf/issues/677#issuecomment-323617121, or mute the thread https://github.com/notifications/unsubscribe-auth/AAB-_Zzy2m-qV3B8vfhSXILoxnRNBgyaks5saLg0gaJpZM4O6HCz .

Rabusek commented 6 years ago

@sorccu sure, that's why I'm setting up the proper USB controller and using the pluggable hub, which is much more capable, for more power consuming devices (like tablets and bigger phones). I've left this info here also in case someone will have similiar problem - so you can always reroute him (or he can find this in google or STF issues listing)

sorccu commented 6 years ago

Yes, thank you :)

entomber commented 4 years ago

Thank you @Rabusek. I had a somewhat similar issue with the Plugable USB3-HUB7BC. All connected devices would disconnect and reconnect every few minutes. Disabling autosuspend resolved it for me.

direc85 commented 3 years ago

One (really) last tip, that could help someone - I wasn't able to fix the 3.0 ports, BUT, after (...) using powertop, in tunables, selecting autosupsend as "bad" resolved the issue completely.

Thank you so much!

I'm trying to flash my Sony Xperia XA2 Ultra and having used powertop the device does not disconnect after I run flashboot devices. I'm going to spread this tip, thanks again!

Rabusek commented 3 years ago

Glad it still helps someone after 3 years! That reminds me i need to set my STF up again after i moved out 2 times since 2017.

Wokir commented 2 years ago

Hello everyone. I have 2 questions about connecting multiple android devices to a PC at the same time.

  1. Can 20, 30 or more devices be connected to a PC via Wi-Fi and identified by adb? If so, please tell me the way.
  2. If the wireless connection does not work out how to solve the problem for me using USB hubs. What active USB hubs will solve the problem of unstable connection of devices to a PC? If I need to configure the system, please explain me how to do it. Thanks in advance.