Failed to use adb command in Oneplus 5 through Fedora 34

@sampsonf @genodeftest Thanks for reaching out. But after a LOT of research, I think I need to create udev rules in order to use ADB. As mentioned in this post → [Guide] How to Use ADB and Fastboot From Any Directory : Fedora

Really painfully. I wish things were smooth.
I will try to clone that entire repo and do as the post suggests.
I wish I could write a udev for my phone only. There are a whole bunch of phone mentioned inside the rule.

2 Likes

Thanks for the updates.

Good to know connecting Android phones with Linux need udev rules …

This rule should be installed into /etc/udev/rules.d/51-android.rules on your computer. If it is not, you can create a symlink from /usr/share/doc/android-tools/51-android.rules.

Please note that the 51-android.rules shipped with Fedora 34 has a bug which has been fixed upstream (but the update/latest version cannot be installed in Fedora 34 because android-tools fails to compile for Fedora 34).

Or does this 51-android.rules file not contain your smartphone?

I see a bunch of rules in /lib/udev/rules.d folder. But not a single rule inside /etc/udev/rules.d folder. So, there is no 51-android.rules file in Fedora 34.

Unless if this counts:

pranav@fedora ~> locate 51-android.rules
/usr/share/doc/android-tools/51-android.rules
pranav@fedora ~> cd /usr/share/doc/android-tools/
pranav@fedora /usr/share/doc/android-tools> ls
51-android.rules  NOTICE  OVERVIEW.TXT  protocol.txt  SERVICES.TXT
pranav@fedora /usr/share/doc/android-tools>

I think we are reaching somewhere. Please do replay.

1 Like
$ locate 51-android.rules
/etc/udev/rules.d/51-android.rules
/usr/share/doc/android-tools/51-android.rules

The first file is a symlink to the second one.

Can you try creating the file, e.g. via symlink? Example (as root):

ln --symbolic /usr/share/doc/android-tools/51-android.rules /etc/udev/rules.d/51-android.rules

I don’t know what’s needed to apply that rule so it may be necessary to systemctl daemon-reload or systemctl restart systemd-udevd.service.

1 Like

Thanks for the update!

I did what you said. (Thank you. I really think, this time we will get somewhere).
Since there was no attribute/value mentioning about Oneplus 5, I modified 51-android.rules with these two lines:

pranav@fedora ~> cat /etc/udev/rules.d/51-android.rules | grep -A2 -i oneplus
#Oneplus
SUBSYSTEM=="usb", ATTR{idVendor}=="2a70", TAG+="systemd", ENV{SYSTEMD_WANTS}="adb.service"

I got the attribute from an article. Problem is, they’re still something we need to do because ADB command doesn’t recognize the phone, neither the phone recognizes pc. They are doing their best to not talk with each other. But I will make them.

As long as the device is not in lsusb's output, adb will be unable to find it, so this is where we should start imho.

The fact that it is not in lsusb's output may be a result of one of (or a combination of):

  • a configuration issue on the PC (we ruled out authorized_default and usbguard already, but there may be more I don’t know of)
  • a hardware issue (it seems like you tried different ports, cables and devices already)
  • a configuration issue on the Oneplus (from what you wrote above, we can probably rule that out)

I’m almost out of ideas, but maybe someone else can help.

One last idea:
After a fresh reboot, can you please attach the smartphone and then get the output of journalctl -k? If you search for usb, error, warning, failed or similar, does it show something which may be related to this issue?

Let me know what you can see in this log. I attached my phone to the laptop and shut down the distro and power on the distro using the power button.

pranav@fedora ~> journalctl -k | grep -i -e usb -e error -e warning -e failed
Jun 12 15:16:56 fedora kernel: ACPI: bus type USB registered
Jun 12 15:16:56 fedora kernel: usbcore: registered new interface driver usbfs
Jun 12 15:16:56 fedora kernel: usbcore: registered new interface driver hub
Jun 12 15:16:56 fedora kernel: usbcore: registered new device driver usb
Jun 12 15:16:56 fedora kernel: pci 0000:00:1d.0: quirk_usb_early_handoff+0x0/0x6d0 took 12377 usecs
Jun 12 15:16:56 fedora kernel: ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
Jun 12 15:16:56 fedora kernel: ehci-pci 0000:00:1d.0: new USB bus registered, assigned bus number 1
Jun 12 15:16:56 fedora kernel: ehci-pci 0000:00:1d.0: USB 2.0 started, EHCI 1.00
Jun 12 15:16:56 fedora kernel: usb usb1: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 5.12
Jun 12 15:16:56 fedora kernel: usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
Jun 12 15:16:56 fedora kernel: usb usb1: Product: EHCI Host Controller
Jun 12 15:16:56 fedora kernel: usb usb1: Manufacturer: Linux 5.12.9-300.fc34.x86_64 ehci_hcd
Jun 12 15:16:56 fedora kernel: usb usb1: SerialNumber: 0000:00:1d.0
Jun 12 15:16:56 fedora kernel: hub 1-0:1.0: USB hub found
Jun 12 15:16:56 fedora kernel: ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
Jun 12 15:16:56 fedora kernel: uhci_hcd: USB Universal Host Controller Interface driver
Jun 12 15:16:56 fedora kernel: xhci_hcd 0000:00:14.0: new USB bus registered, assigned bus number 2
Jun 12 15:16:56 fedora kernel: usb usb2: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 5.12
Jun 12 15:16:56 fedora kernel: usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
Jun 12 15:16:56 fedora kernel: usb usb2: Product: xHCI Host Controller
Jun 12 15:16:56 fedora kernel: usb usb2: Manufacturer: Linux 5.12.9-300.fc34.x86_64 xhci-hcd
Jun 12 15:16:56 fedora kernel: usb usb2: SerialNumber: 0000:00:14.0
Jun 12 15:16:56 fedora kernel: hub 2-0:1.0: USB hub found
Jun 12 15:16:56 fedora kernel: xhci_hcd 0000:00:14.0: new USB bus registered, assigned bus number 3
Jun 12 15:16:56 fedora kernel: xhci_hcd 0000:00:14.0: Host supports USB 3.0 SuperSpeed
Jun 12 15:16:56 fedora kernel: usb usb3: New USB device found, idVendor=1d6b, idProduct=0003, bcdDevice= 5.12
Jun 12 15:16:56 fedora kernel: usb usb3: New USB device strings: Mfr=3, Product=2, SerialNumber=1
Jun 12 15:16:56 fedora kernel: usb usb3: Product: xHCI Host Controller
Jun 12 15:16:56 fedora kernel: usb usb3: Manufacturer: Linux 5.12.9-300.fc34.x86_64 xhci-hcd
Jun 12 15:16:56 fedora kernel: usb usb3: SerialNumber: 0000:00:14.0
Jun 12 15:16:56 fedora kernel: hub 3-0:1.0: USB hub found
Jun 12 15:16:56 fedora kernel: usb: port power management may be unreliable
Jun 12 15:16:56 fedora kernel: usbcore: registered new interface driver usbserial_generic
Jun 12 15:16:56 fedora kernel: usbserial: USB Serial support registered for generic
Jun 12 15:16:56 fedora kernel: usbcore: registered new interface driver usbhid
Jun 12 15:16:56 fedora kernel: usbhid: USB HID core driver
Jun 12 15:16:56 fedora kernel: RAS: Correctable Errors collector initialized.
Jun 12 15:16:56 fedora kernel: usb 1-1: new high-speed USB device number 2 using ehci-pci
Jun 12 15:16:56 fedora kernel: usb 2-5: new full-speed USB device number 2 using xhci_hcd
Jun 12 15:16:56 fedora kernel: usb 2-5: New USB device found, idVendor=8087, idProduct=07dc, bcdDevice= 0.01
Jun 12 15:16:56 fedora kernel: usb 2-5: New USB device strings: Mfr=0, Product=0, SerialNumber=0
Jun 12 15:16:56 fedora kernel: usb 1-1: New USB device found, idVendor=8087, idProduct=8001, bcdDevice= 0.03
Jun 12 15:16:56 fedora kernel: usb 1-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
Jun 12 15:16:56 fedora kernel: hub 1-1:1.0: USB hub found
Jun 12 15:16:56 fedora kernel: usb 2-6: new full-speed USB device number 3 using xhci_hcd
Jun 12 15:16:56 fedora kernel: usb 2-6: New USB device found, idVendor=04f3, idProduct=2012, bcdDevice=11.12
Jun 12 15:16:56 fedora kernel: usb 2-6: New USB device strings: Mfr=4, Product=14, SerialNumber=0
Jun 12 15:16:56 fedora kernel: usb 2-6: Product: Touchscreen
Jun 12 15:16:56 fedora kernel: usb 2-6: Manufacturer: ELAN
Jun 12 15:16:56 fedora kernel: input: ELAN Touchscreen as /devices/pci0000:00/0000:00:14.0/usb2/2-6/2-6:1.0/0003:04F3:2012.0001/input/input7
Jun 12 15:16:56 fedora kernel: input: ELAN Touchscreen as /devices/pci0000:00/0000:00:14.0/usb2/2-6/2-6:1.0/0003:04F3:2012.0001/input/input8
Jun 12 15:16:56 fedora kernel: input: ELAN Touchscreen as /devices/pci0000:00/0000:00:14.0/usb2/2-6/2-6:1.0/0003:04F3:2012.0001/input/input9
Jun 12 15:16:56 fedora kernel: hid-generic 0003:04F3:2012.0001: input,hiddev96,hidraw0: USB HID v1.10 Device [ELAN Touchscreen] on usb-0000:00:14.0-6/input0
Jun 12 15:16:56 fedora kernel: usb 1-1-port7: over-current condition
Jun 12 15:16:56 fedora kernel: usb usb2-port7: over-current condition
Jun 12 15:16:56 fedora kernel: usb usb2-port8: over-current condition
Jun 12 15:16:56 fedora kernel: usb 1-1-port8: over-current condition
Jun 12 15:16:56 fedora kernel: input: ELAN Touchscreen as /devices/pci0000:00/0000:00:14.0/usb2/2-6/2-6:1.0/0003:04F3:2012.0001/input/input11
Jun 12 15:16:56 fedora kernel: input: ELAN Touchscreen UNKNOWN as /devices/pci0000:00/0000:00:14.0/usb2/2-6/2-6:1.0/0003:04F3:2012.0001/input/input12
Jun 12 15:16:56 fedora kernel: input: ELAN Touchscreen UNKNOWN as /devices/pci0000:00/0000:00:14.0/usb2/2-6/2-6:1.0/0003:04F3:2012.0001/input/input13
Jun 12 15:16:56 fedora kernel: hid-multitouch 0003:04F3:2012.0001: input,hiddev96,hidraw0: USB HID v1.10 Device [ELAN Touchscreen] on usb-0000:00:14.0-6/input0
Jun 12 15:17:00 fedora kernel: usbcore: registered new interface driver btusb
Jun 12 15:17:01 fedora kernel: psmouse serio1: Failed to enable mouse on isa0060/serio1

The only thing that looks weird to me are these lines above, although I’m not entirely sure about the meaning. It looks like your PC has 2 USB device attached, which were not listed in your lsusb output, this may hint to the issue. “over-current condition” may mean that the port is draining too much power, i.e. something like a short-circuit. In this case, _modern_¹ hardware is often able to disable the USB port, rendering the attached hardware useless.
Without a look at the hardware I can only guess about why that is. Maybe some conducting material (e.g. salty water, little pieces of metal, …) got into your USB port on the PC? Maybe it got into the PC’s casing and you have the short-circuit there? It may be in the USB port of the smartphone or the cable too.

¹ modern: I don’t really know when this started to be common. My old 2010 hardware does not have that feature :stuck_out_tongue:

We can probably rule out the cable.

Did you mean you connected your sister’s phone to the same PC (same USB port) or only using the same cable? This way we could rule out the USB port on your PC.

Can you try

  • your own smartphone with the same cable on a different USB port?
  • your own smartphone with the same cable on a different modern PC?

Anyway, if you are really unlucky, the issue is only present in your hardware combination. For example, a different cable may limit the current due to its limited thickness…

It looks like it is not only one port, but maybe two?

lsusb -v will show each device and their power draws. That should find it for you.help you track it down!

If that lists your device, it may (or may not) help you track down details (it is very verbose though…).

Source: https://unix.stackexchange.com/a/78830

No 2 USB are attached. It might represent USB ports. That warning stays there even if there is no USB device. I see that all the time.

1 of the USB port is out of use. I CANNOT use that ONE port because it doesn’t respond when I insert pendrive or cable. The other 2 ports are fine as far as I can tell because they respond to me when I insert the pendrive and also I have connected & use it with other the phones with the same able or different cable.

I just connect my Dad’s phone [Samsung Galaxy A10] with a different cable since his phone has micro-USB 2.0 (since I have a USB C 2.0 cable). He phone also responds well in both 2 ports.

That’s why I asked in this community, to find a way to block that one USB port that is damaged.

pranav@fedora ~> sudo lsusb -v
[sudo] password for pranav:

Bus 001 Device 002: ID 8087:8001 Intel Corp. Integrated Hub
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            9 Hub
  bDeviceSubClass         0
  bDeviceProtocol         1 Single TT
  bMaxPacketSize0        64
  idVendor           0x8087 Intel Corp.
  idProduct          0x8001 Integrated Hub
  bcdDevice            0.03
  iManufacturer           0
  iProduct                0
  iSerial                 0
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength       0x0019
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0
    bmAttributes         0xe0
      Self Powered
      Remote Wakeup
    MaxPower                0mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         9 Hub
      bInterfaceSubClass      0
      bInterfaceProtocol      0 Full speed (or root) hub
      iInterface              0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0002  1x 2 bytes
        bInterval              12
Hub Descriptor:
  bLength              11
  bDescriptorType      41
  nNbrPorts             8
  wHubCharacteristic 0x0009
    Per-port power switching
    Per-port overcurrent protection
    TT think time 8 FS bits
  bPwrOn2PwrGood        0 * 2 milli seconds
  bHubContrCurrent      0 milli Ampere
  DeviceRemovable    0x00 0x00
  PortPwrCtrlMask    0xff 0xff
 Hub Port Status:
   Port 1: 0000.0100 power
   Port 2: 0000.0100 power
   Port 3: 0000.0100 power
   Port 4: 0000.0100 power
   Port 5: 0000.0100 power
   Port 6: 0000.0100 power
   Port 7: 0000.0008 oc
   Port 8: 0000.0008 oc
Device Qualifier (for other device speed):
  bLength                10
  bDescriptorType         6
  bcdUSB               2.00
  bDeviceClass            9 Hub
  bDeviceSubClass         0
  bDeviceProtocol         0 Full speed (or root) hub
  bMaxPacketSize0        64
  bNumConfigurations      1
can't get debug descriptor: Resource temporarily unavailable
Device Status:     0x0001
  Self Powered

Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            9 Hub
  bDeviceSubClass         0
  bDeviceProtocol         0 Full speed (or root) hub
  bMaxPacketSize0        64
  idVendor           0x1d6b Linux Foundation
  idProduct          0x0002 2.0 root hub
  bcdDevice            5.12
  iManufacturer           3 Linux 5.12.9-300.fc34.x86_64 ehci_hcd
  iProduct                2 EHCI Host Controller
  iSerial                 1 0000:00:1d.0
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength       0x0019
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0
    bmAttributes         0xe0
      Self Powered
      Remote Wakeup
    MaxPower                0mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         9 Hub
      bInterfaceSubClass      0
      bInterfaceProtocol      0 Full speed (or root) hub
      iInterface              0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0004  1x 4 bytes
        bInterval              12
Hub Descriptor:
  bLength               9
  bDescriptorType      41
  nNbrPorts             2
  wHubCharacteristic 0x000a
    No power switching (usb 1.0)
    Per-port overcurrent protection
  bPwrOn2PwrGood       10 * 2 milli seconds
  bHubContrCurrent      0 milli Ampere
  DeviceRemovable    0x02
  PortPwrCtrlMask    0xff
 Hub Port Status:
   Port 1: 0000.0507 highspeed power suspend enable connect
   Port 2: 0000.0100 power
can't get device qualifier: Resource temporarily unavailable
can't get debug descriptor: Resource temporarily unavailable
Device Status:     0x0001
  Self Powered

Bus 003 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               3.00
  bDeviceClass            9 Hub
  bDeviceSubClass         0
  bDeviceProtocol         3
  bMaxPacketSize0         9
  idVendor           0x1d6b Linux Foundation
  idProduct          0x0003 3.0 root hub
  bcdDevice            5.12
  iManufacturer           3 Linux 5.12.9-300.fc34.x86_64 xhci-hcd
  iProduct                2 xHCI Host Controller
  iSerial                 1 0000:00:14.0
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength       0x001f
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0
    bmAttributes         0xe0
      Self Powered
      Remote Wakeup
    MaxPower                0mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         9 Hub
      bInterfaceSubClass      0
      bInterfaceProtocol      0 Full speed (or root) hub
      iInterface              0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0004  1x 4 bytes
        bInterval              12
        bMaxBurst               0
Hub Descriptor:
  bLength              12
  bDescriptorType      42
  nNbrPorts             4
  wHubCharacteristic 0x000a
    No power switching (usb 1.0)
    Per-port overcurrent protection
  bPwrOn2PwrGood       10 * 2 milli seconds
  bHubContrCurrent      0 milli Ampere
  bHubDecLat          0.0 micro seconds
  wHubDelay             0 nano seconds
  DeviceRemovable    0x10
 Hub Port Status:
   Port 1: 0000.02a0 5Gbps power Rx.Detect
   Port 2: 0000.02a0 5Gbps power Rx.Detect
   Port 3: 0000.02a0 5Gbps power Rx.Detect
   Port 4: 0000.02a0 5Gbps power Rx.Detect
Binary Object Store Descriptor:
  bLength                 5
  bDescriptorType        15
  wTotalLength       0x000f
  bNumDeviceCaps          1
  SuperSpeed USB Device Capability:
    bLength                10
    bDescriptorType        16
    bDevCapabilityType      3
    bmAttributes         0x02
      Latency Tolerance Messages (LTM) Supported
    wSpeedsSupported   0x0008
      Device can operate at SuperSpeed (5Gbps)
    bFunctionalitySupport   3
      Lowest fully-functional device speed is SuperSpeed (5Gbps)
    bU1DevExitLat          10 micro seconds
    bU2DevExitLat         512 micro seconds
can't get debug descriptor: Resource temporarily unavailable
Device Status:     0x0001
  Self Powered

Bus 002 Device 003: ID 04f3:2012 Elan Microelectronics Corp. Touchscreen
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            0
  bDeviceSubClass         0
  bDeviceProtocol         0
  bMaxPacketSize0         8
  idVendor           0x04f3 Elan Microelectronics Corp.
  idProduct          0x2012
  bcdDevice           11.12
  iManufacturer           4 ELAN
  iProduct               14 Touchscreen
  iSerial                 0
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength       0x0029
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0
    bmAttributes         0xe0
      Self Powered
      Remote Wakeup
    MaxPower              100mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass         3 Human Interface Device
      bInterfaceSubClass      0
      bInterfaceProtocol      0
      iInterface              0
        HID Device Descriptor:
          bLength                 9
          bDescriptorType        33
          bcdHID               1.10
          bCountryCode            0 Not supported
          bNumDescriptors         1
          bDescriptorType        34 Report
          wDescriptorLength     945
         Report Descriptors:
           ** UNAVAILABLE **
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x02  EP 2 OUT
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0020  1x 32 bytes
        bInterval              10
can't get device qualifier: Resource temporarily unavailable
can't get debug descriptor: Resource temporarily unavailable
Device Status:     0x0001
  Self Powered

Bus 002 Device 002: ID 8087:07dc Intel Corp. Bluetooth wireless interface
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass          224 Wireless
  bDeviceSubClass         1 Radio Frequency
  bDeviceProtocol         1 Bluetooth
  bMaxPacketSize0        64
  idVendor           0x8087 Intel Corp.
  idProduct          0x07dc Bluetooth wireless interface
  bcdDevice            0.01
  iManufacturer           0
  iProduct                0
  iSerial                 0
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength       0x00b1
    bNumInterfaces          2
    bConfigurationValue     1
    iConfiguration          0
    bmAttributes         0xe0
      Self Powered
      Remote Wakeup
    MaxPower              100mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           3
      bInterfaceClass       224 Wireless
      bInterfaceSubClass      1 Radio Frequency
      bInterfaceProtocol      1 Bluetooth
      iInterface              0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x02  EP 2 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x82  EP 2 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               1
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass       224 Wireless
      bInterfaceSubClass      1 Radio Frequency
      bInterfaceProtocol      1 Bluetooth
      iInterface              0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x03  EP 3 OUT
        bmAttributes            1
          Transfer Type            Isochronous
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0000  1x 0 bytes
        bInterval               1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x83  EP 3 IN
        bmAttributes            1
          Transfer Type            Isochronous
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0000  1x 0 bytes
        bInterval               1
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       1
      bNumEndpoints           2
      bInterfaceClass       224 Wireless
      bInterfaceSubClass      1 Radio Frequency
      bInterfaceProtocol      1 Bluetooth
      iInterface              0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x03  EP 3 OUT
        bmAttributes            1
          Transfer Type            Isochronous
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0009  1x 9 bytes
        bInterval               1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x83  EP 3 IN
        bmAttributes            1
          Transfer Type            Isochronous
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0009  1x 9 bytes
        bInterval               1
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       2
      bNumEndpoints           2
      bInterfaceClass       224 Wireless
      bInterfaceSubClass      1 Radio Frequency
      bInterfaceProtocol      1 Bluetooth
      iInterface              0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x03  EP 3 OUT
        bmAttributes            1
          Transfer Type            Isochronous
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0011  1x 17 bytes
        bInterval               1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x83  EP 3 IN
        bmAttributes            1
          Transfer Type            Isochronous
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0011  1x 17 bytes
        bInterval               1
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       3
      bNumEndpoints           2
      bInterfaceClass       224 Wireless
      bInterfaceSubClass      1 Radio Frequency
      bInterfaceProtocol      1 Bluetooth
      iInterface              0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x03  EP 3 OUT
        bmAttributes            1
          Transfer Type            Isochronous
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0019  1x 25 bytes
        bInterval               1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x83  EP 3 IN
        bmAttributes            1
          Transfer Type            Isochronous
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0019  1x 25 bytes
        bInterval               1
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       4
      bNumEndpoints           2
      bInterfaceClass       224 Wireless
      bInterfaceSubClass      1 Radio Frequency
      bInterfaceProtocol      1 Bluetooth
      iInterface              0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x03  EP 3 OUT
        bmAttributes            1
          Transfer Type            Isochronous
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0021  1x 33 bytes
        bInterval               1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x83  EP 3 IN
        bmAttributes            1
          Transfer Type            Isochronous
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0021  1x 33 bytes
        bInterval               1
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       5
      bNumEndpoints           2
      bInterfaceClass       224 Wireless
      bInterfaceSubClass      1 Radio Frequency
      bInterfaceProtocol      1 Bluetooth
      iInterface              0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x03  EP 3 OUT
        bmAttributes            1
          Transfer Type            Isochronous
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0031  1x 49 bytes
        bInterval               1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x83  EP 3 IN
        bmAttributes            1
          Transfer Type            Isochronous
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0031  1x 49 bytes
        bInterval               1
can't get device qualifier: Resource temporarily unavailable
Device Status:     0x0001
  Self Powered

Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            9 Hub
  bDeviceSubClass         0
  bDeviceProtocol         1 Single TT
  bMaxPacketSize0        64
  idVendor           0x1d6b Linux Foundation
  idProduct          0x0002 2.0 root hub
  bcdDevice            5.12
  iManufacturer           3 Linux 5.12.9-300.fc34.x86_64 xhci-hcd
  iProduct                2 xHCI Host Controller
  iSerial                 1 0000:00:14.0
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength       0x0019
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0
    bmAttributes         0xe0
      Self Powered
      Remote Wakeup
    MaxPower                0mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         9 Hub
      bInterfaceSubClass      0
      bInterfaceProtocol      0 Full speed (or root) hub
      iInterface              0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0004  1x 4 bytes
        bInterval              12
Hub Descriptor:
  bLength              11
  bDescriptorType      41
  nNbrPorts            11
  wHubCharacteristic 0x000a
    No power switching (usb 1.0)
    Per-port overcurrent protection
    TT think time 8 FS bits
  bPwrOn2PwrGood       10 * 2 milli seconds
  bHubContrCurrent      0 milli Ampere
  DeviceRemovable    0xf0 0x01
  PortPwrCtrlMask    0xff 0xff
 Hub Port Status:
   Port 1: 0000.0100 power
   Port 2: 0000.0100 power
   Port 3: 0000.0100 power
   Port 4: 0000.0100 power
   Port 5: 0000.0103 power enable connect
   Port 6: 0000.0103 power enable connect
   Port 7: 0000.0008 oc
   Port 8: 0000.0008 oc
   Port 9: 0000.0100 power
   Port 10: 0000.0100 power
   Port 11: 0000.0100 power
can't get device qualifier: Resource temporarily unavailable
can't get debug descriptor: Resource temporarily unavailable
Device Status:     0x0001
  Self Powered
pranav@fedora ~>

Hi pranav - you asked for some help in M0Rf30 on github.
Reading through this subject and problems encountered, start with the USB cable. There are two types of cable, 2-wire cable only transfers power, and is also limited to a small amount of power (this is why you cannot get rapid charge, but at the same time prevents your phone getting hacked by a hacked charger - example free airport or bus terminal charging stations that were hacked). You cannot connect/communicate using this cable.
Then there are 4-wire USB cables, these actually carry data back-n-forth, plus allows you to rapid charge from a smart charger. Newer fancier USB cables have more wires.
Assuming you have a USB cable that carries data, you should be able to see your phone when you run lsusb.
To do this correctly, if your phone is in some sort of sleep mode, first you need to wake it up, and log into your phone first - if you phone goes to sleep, wake it up again.
You also want to try this with developer mode off and once again with developer mode on (some phones change productID# when developer mode is off or on - we should know both values if they change). Other phones stay the same.

Here is an example using an older phone:

[joe@genesis ~]$ su
Password: 
[root@genesis joe]# lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

Above has no phone plugged-in, so you do not see it listed above.
Next, make sure your phone is awake, then plug it in and try again
(this is old phone with debug==off):

[root@genesis joe]# lsusb
Bus 001 Device 014: ID 0bb4:0c01 HTC (High Tech Computer Corp.) Dream / ADP1 / G1 / Magic / Tattoo / FP1
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
[root@genesis joe]#

Enable debug mode. Reboot the phone if necessary, make sure your phone is awake,
then plug it in and try again (this is old phone with debug==on):

[root@genesis joe]# lsusb
Bus 001 Device 014: ID 0bb4:0c02 High Tech Computer Corp. Magic (Debug)
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
[root@genesis joe]# 
[root@genesis joe]# exit
[joe@genesis ~]$

Start with the above test to see if you can see your phone first.

1 Like

Did not worked… Meanwhile, the other phone does work.

Hello, try sudoing it:
$ sudo ./adb start-server
Then use adb as you wish, no need to sudo again while the service is running.

IMHO No you don’t need set anything when connected android smartphone in linux or fedora 34, you just stop and start adb server.First Unplugged and plugged your android device then type this in the terminal
sudo adb kill-server
then
sudo adb start-server
then
adb devices

in your android will appear pop-up message, just granted that permission.
Done.

I’ve only skimmed through this thread, so might have missed something. If different phone works fine on this PC with same cable and PC’s USB port, it looks like an issue on phone’s end. Either a broken phone’s USB port (rare for USB type C) or a software issue. Go to recovery (try ADB or MTP file transfer) and fastboot mode (try fastboot tool) and check whether it will work there (that might help rule out software problem).

1 Like

After looking through all the posts, I didn’t see if you mentioned, @bond, if the original cable was USB-C on both ends or USB-A on the one and USB-C on the other; although that might be irrelevant, I was wondering…

It also seems as though the issue may lay with the phone, since you’ve been able to connect two different phones with the cable you’re trying to use and with another one…

Have you updated the phone recently?

Yes, I update the phone once a month. It’s a custom ROM called DotOS.

No custom kernel is involved here. I use Lineage kernel 4.4.068 with comes with the ROM.

if the original cable was USB-C on both ends or USB-A on the one and USB-C on the other; although that might be irrelevant, I was wondering…

Both are type USB C at one end, and USB A at other ends to connect with laptop/desktop and charger.

I have now 2 USB cables.
Ist : Oneplus 5 original cable which came with the phone.
2nd: Oppo original cable made for other phone but voltage/ampere matches mine.

Even connecting on Windows 10, doesn’t have any effect on the phone. I mean, the phone can’t use for data-related work (like adb).

So, in the end, I think there can three possibilities:

  • Maybe firmware doesn’t support it. (But I have flashed latest firmware patch.)
  • Maybe ROM doesn’t support it. (But the ROM maintainer denies this because ADB works fine in his computer.)
  • Maybe Twrp latest version doesn’t it. (Does Twrp has this sort of power!?)

Well, the fact that the phone isn’t even recognized by Windows suggests to me that it’s a phone-based issue.

Just verifying that the version of DotOS you’re running is 5.1.1; correct?

Let’s try this, without being connected to your Fedora machine:

  1. Head into Developer Options and scroll down to DEBUGGING; here USB debugging should be toggled “on” because you’ve previously enabled it.
  2. Tap Revoke USB debugging authorizations, which should be two lines below the USB debugging setting.
  3. Tap OK.
  4. Now, connect your phone to Fedora and execute $ adb shell at the command prompt.
  5. There should be a pop-up on the phone asking you to confirm you’re okay with allowing the computer to access the phone.

If none of that works, we can try to troubleshoot from there.