5

A whole line of tablets don't show at ADB devices anymore (they worked just fine one week ago). Other Android devices do work (like my Nexus 5 phone). This is first time I face this problem. I've read and tried most solutions I've found at SO and other sites to no avail. Here's the situation:

  • They show in lsusb as Bus 010 Device 004: ID 18d1:dddd Google Inc..
  • Created/edited /etc/udev/rules.d/51-android.rules and added SUBSYSTEM=="usb", ATTRS{idVendor}=="18d1", MODE="0666" (and several other attribute combinations here).
  • Restarted udev via sudo service udev restart.
  • Restarted ADB server via adb kill-server; adb start-server`.
  • Tried all USB ports on PC.
  • Tried another USB cable.
  • Restarted PC and tablet.

A strange thing is that even if I empty /etc/udev/rules.d/51-android.rules file and restart the udev daemon, adb still detects my Nexus 5 phone.

Changes I remember I did before this problem started to happen:

  • Started using Android Studio instead of Eclipse (although I'm using the same ADK) and tools)
  • Upgraded Ubuntu to latest version 14.04 (maybe some udev changes/problem here?)

Any further suggestions are welcome, thanks in advance.


EDIT: When running lsusb -v as suggested in the comments, I can see this description:

  bInterfaceClass         8 Mass Storage
  bInterfaceSubClass      6 SCSI
  bInterfaceProtocol     80 Bulk-Only
  iInterface              1 Mass Storage

while the Nexus 5 shows as

  bInterfaceClass       255 Vendor Specific Class
  bInterfaceSubClass    255 Vendor Specific Subclass
  bInterfaceProtocol      0
  iInterface              4 MTP

EDIT: The tablets are working perfectly through ADB in other computers (Windows and Linux). So it must be a problem with my box.


EDIT: As suggested in the comments, I tried ADB in TCP mode and works fine. After running dmesg I can see the system is trying to load the Windows driver for ADB using ndiswrapper

[277701.803751] usb 1-4: reset high-speed USB device number 48 using ehci-pci
[277701.952803] ndiswrapper (load_wrap_driver:103): couldn't load driver android_winusb; check system log for messages from 'loadndisdriver'

This message doesn't show on the other Linux boxes where ADB works fine through USB.

m0skit0
  • 25,268
  • 11
  • 79
  • 127
  • 4
    About the close vote: please read the [FAQ](http://stackoverflow.com/help/on-topic). Question is perfectly valid for StackOverflow. – m0skit0 Oct 13 '14 at 13:55
  • I had this yesterday and fixed it by switching from USB to Camera and back (The notice appears in the status bar when You connect it). It was the only problem and happened suddenly too. – Opiatefuchs Oct 13 '14 at 14:05
  • check out http://ktnr74.blogspot.com/2014/09/the-most-comprehensive-write-up-on-how.html – Alex P. Oct 13 '14 at 14:42
  • @AlexP. That link is full of wrong info. I will try anyway. – m0skit0 Oct 13 '14 at 14:55
  • you missed the point. when running `lsusb -v` for the device - do you see the 255/66/1 interface or not? if you do not see it - there's a problem with the device itself. and no changes on the PC side would change that. – Alex P. Oct 13 '14 at 15:08
  • @AlexP. In fact, Nexus 5 doesn't show those numbers (as you can see in the edit) but still it is recognized as valid a ADB device, so obviously that statement is wrong. – m0skit0 Oct 13 '14 at 15:14
  • I don't know what the ubantu equivilent is but I'm thinking maybe I back things up first. Then I would try a reboot. on the device there is an option to load the drivers on to the pc try that. Then if all else fails try the ubanutu eqivilent of device manager and delete/reinstall usb drivers. – danny117 Oct 15 '14 at 21:15
  • To be sure that you've got USB-permissions configured correctly, you could try to run adb as root (it forks a server process, so kill all user instances beforehand): `pkill adb; sudo adb devices`. Does that display anything on the device? Did you check the developer options on the devices for authorization settings? Maybe the tablets have an extended variant in place, where the debug bridge isn't even exposed to non-authorized PCs. Also, as a temporary workaround, you could check if adb over TCP does work. (That's also an option in the dev options, and see the manual on `adb connect`.) – Phillip Oct 16 '14 at 07:07
  • @danny117 In Linux (and Mac) you don't need any drivers for ADB to recognize the devices. The drivers are for Windows only. – m0skit0 Oct 16 '14 at 08:16
  • @Phillip `pkill adb; sudo adb devices` didn't work, still nothing shows on the list. Device has USB debugging on, and doesn't need any authorization (all these devices worked just fine with my adb a couple of weeks ago). I didn't consider ADB TCP, good idea, will try, thanks. – m0skit0 Oct 16 '14 at 08:37
  • @Phillip ADB works perfectly over TCP, so it's actually a USB problem (as I suspected). Any ideas on why ADB through USB stopped working and/or how to fix it? – m0skit0 Oct 16 '14 at 09:42
  • What does `dmesg` show if you plug in the tablets, and how does the output differ if you use different android devices? Maybe there is a driver (for something that is only present in the tablets) interfering with the debug bridge. – Phillip Oct 16 '14 at 12:30
  • @Phillip I updated the question with the `dmesg` info. Looks like the kernel is trying to use the Windows driver for adb. I ignore why, but how to fix this? Thanks for you patience :) – m0skit0 Oct 16 '14 at 14:34
  • @Philip Ok, uninstalling `ndiswrapper` solved the problem. I assume the distro upgrade installed this new package since I wasn't using it before. If you write an answer resuming the above steps I will mark it as accepted. Thanks again for your time and patience ;) – m0skit0 Oct 16 '14 at 14:40
  • Great, glad I could help. Answer's below. – Phillip Oct 16 '14 at 15:12

2 Answers2

1

Since the same devices work on other PCs, you can already rule out hardware issues on the tablets' side. Further things to check are:

  • USB permissions on the PC: Though other devices work, you might still have insufficient permissions to access the tablets using adb. The udev rules you've mentioned are vendor-specific, and sometimes also device-specific. The only way to rule permissions out as a problem is to start adb as the root user. adb forks a daemon, so you've got to kill any instances of adb before attempting to do that:
    $ pkill adb
    $ sudo adb devices
    If the device does show up in the list, you've got to adjust the udev rules. Temporarily, you can continue to use adb normally - it will connect to the service that is now running as root and therefore working as expected.
  • Driver issues: In the developer menu on your tablet, you can select "adb over tcp" as an option. Enable it and then connect to it from your PC. If this works, the debug bridge itself is fine and the USB connection must therefore be the source of the issue. We can already rule out a defective cable, because the device does show up in lsusb and other functionality works as expected. Running dmesg should give you the required information to solve your problem, likely it's an interfering device driver. Try unloading it using rmmod/modprobe.
Community
  • 1
  • 1
Phillip
  • 13,448
  • 29
  • 41
0

A difference since 12.10+ is MTP support. I know 14.04 uses it automatically as soon as a phone is plugged in. This is supposed to be a faster and more simpler than "Mass Storage". Perhaps it's getting in your way and you should find a way to disable it either from the PC end or on the device?

Humpity
  • 152
  • 1
  • 9
  • Thanks, already tried that. MTP doesn't work correctly in these tablets. When I activate it, it doesn't even show on the USB bus. – m0skit0 Oct 16 '14 at 18:18