• Android device debug mode plug/unplug cycle


    My Huawei android device works ok in MTP mode.
    But recently I decided to update firmware and went to enabling development options and USB debug mode.
    Issuing adb devices command to check if device recognised caused my KDE installation to start infinitely connect/disconnect device with the following dmesg

    [  103.723849] sr 2:0:0:0: Attached scsi generic sg0 type 5
    [  140.664745] usb 1-1: USB disconnect, device number 6
    [  140.931067] usb 1-1: new high-speed USB device number 7 using xhci_hcd
    [  141.063665] usb-storage 1-1:1.1: USB Mass Storage device detected
    [  141.063932] scsi host2: usb-storage 1-1:1.1
    [  141.998313] usb 1-1: USB disconnect, device number 7
    [  142.251098] usb 1-1: new high-speed USB device number 8 using xhci_hcd
    [  142.386893] usb-storage 1-1:1.1: USB Mass Storage device detected
    [  142.387390] scsi host2: usb-storage 1-1:1.1
    [  143.318193] usb 1-1: USB disconnect, device number 8
    [  143.564548] usb 1-1: new high-speed USB device number 9 using xhci_hcd
    [  143.755373] usb-storage 1-1:1.1: USB Mass Storage device detected
    [  143.755577] scsi host2: usb-storage 1-1:1.1
    [  144.638105] usb 1-1: USB disconnect, device number 9
    [  144.891264] usb 1-1: new high-speed USB device number 10 using xhci_hcd
    [  145.025388] usb-storage 1-1:1.1: USB Mass Storage device detected
    [  145.025597] scsi host2: usb-storage 1-1:1.1
    [  145.965132] usb 1-1: USB disconnect, device number 10
    [  146.214631] usb 1-1: new high-speed USB device number 11 using xhci_hcd
    [  146.353503] usb-storage 1-1:1.1: USB Mass Storage device detected
    [  146.357299] scsi host2: usb-storage 1-1:1.1
    [  147.284951] usb 1-1: USB disconnect, device number 11
    [  147.538026] usb 1-1: new high-speed USB device number 12 using xhci_hcd
    [  147.732442] usb-storage 1-1:1.1: USB Mass Storage device detected
    [  147.732763] scsi host2: usb-storage 1-1:1.1
    [  148.608372] usb 1-1: USB disconnect, device number 12
    [  148.854709] usb 1-1: new high-speed USB device number 13 using xhci_hcd
    [  149.047087] usb-storage 1-1:1.1: USB Mass Storage device detected
    [  149.050658] scsi host2: usb-storage 1-1:1.1
    [  149.931659] usb 1-1: USB disconnect, device number 13
    [  150.178125] usb 1-1: new high-speed USB device number 14 using xhci_hcd
    [  150.312731] usb-storage 1-1:1.1: USB Mass Storage device detected
    [  150.313029] scsi host2: usb-storage 1-1:1.1
    [  151.255121] usb 1-1: USB disconnect, device number 14
    [  151.504769] usb 1-1: new high-speed USB device number 15 using xhci_hcd
    [  151.644243] usb-storage 1-1:1.1: USB Mass Storage device detected
    [  151.645258] scsi host2: usb-storage 1-1:1.1
    [  152.575128] usb 1-1: USB disconnect, device number 15
    [  152.821442] usb 1-1: new high-speed USB device number 16 using xhci_hcd
    [  152.957891] usb-storage 1-1:1.1: USB Mass Storage device detected
    [  152.958234] scsi host2: usb-storage 1-1:1.1
    [  153.895216] usb 1-1: USB disconnect, device number 16
    [  154.141475] usb 1-1: new high-speed USB device number 17 using xhci_hcd
    [  154.334945] usb-storage 1-1:1.1: USB Mass Storage device detected
    [  154.335229] scsi host2: usb-storage 1-1:1.1
    [  155.218548] usb 1-1: USB disconnect, device number 17
    [  155.464823] usb 1-1: new high-speed USB device number 18 using xhci_hcd
    [  155.602606] usb-storage 1-1:1.1: USB Mass Storage device detected
    [  155.602933] scsi host2: usb-storage 1-1:1.1
    
    

    It works ok for another Antergos installation with Gnome DE but KDE Plasma don’t

  • You can try to change the connection mode on rthe phone, it happens to me sometime that device do not connect correctly, then i change from “usb-drive” to “files” or “fotos” and back to “usb-drive” … And also the cable makes a difference… some of them do not work for data connection.

    But may you need KDE-Connect-Monitor kdeconnect installed?

    [updates once a week] = [90% less problems]
    http://gofccyourself.com
    my-blog#k
    how to add system logs
    i3 GNOME

  • @joekamprad said in Android device debug mode plug/unplug cycle:

    But may you need KDE-Connect-Monitor kdeconnect installed?

    Isn’t KDE Connect just to synchronize your DE with your cellphone(notifications, files)?
    It requires an installation of applications on your phone as well on DE.

  • Sep 21 16:35:38 empowered64 kernel: usb 1-3: new high-speed USB device number 16 using ehci-pci
    Sep 21 16:35:39 empowered64 kernel: usb-storage 1-3:1.0: USB Mass Storage device detected
    Sep 21 16:35:39 empowered64 kernel: scsi host8: usb-storage 1-3:1.0
    Sep 21 16:35:39 empowered64 mtp-probe[15816]: checking bus 1, device 16: "/sys/devices/pci0000:00/0000:00:1a.7/usb1/1-3"
    Sep 21 16:35:39 empowered64 mtp-probe[15816]: bus: 1, device: 16 was not an MTP device
    Sep 21 16:35:40 empowered64 kernel: scsi 8:0:0:0: CD-ROM            Linux    File-CD Gadget   0000 PQ: 0 ANSI: 2
    Sep 21 16:35:40 empowered64 kernel: sr 8:0:0:0: [sr1] scsi-1 drive
    Sep 21 16:35:40 empowered64 kernel: sr 8:0:0:0: Attached scsi CD-ROM sr1
    Sep 21 16:35:40 empowered64 kernel: sr 8:0:0:0: Attached scsi generic sg4 type 5
    
    

    This shows me a CD-gadged-device and Android with internal storage of my phone as mounts inside filebrowser (choosing files on debugging mode)

    If i choose usb-drive it shows like this and i get the sd-card as mountpoint inside Filebrowser:

    Sep 21 16:47:34 empowered64 kernel: sd 8:0:0:0: [sdd] 61896704 512-byte logical blocks: (31.7 GB/29.5 GiB)
    Sep 21 16:47:34 empowered64 kernel: sd 8:0:0:0: [sdd] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
    Sep 21 16:47:34 empowered64 kernel:  sdd: sdd1
    

    Huawei P7
    0_1506005800299_IMG_20170921_165302.png

    [updates once a week] = [90% less problems]
    http://gofccyourself.com
    my-blog#k
    how to add system logs
    i3 GNOME

  • @TaurohtaR said in Android device debug mode plug/unplug cycle:

    adb devices

    but it seems you need to clearify what you want to do… you want to flash a new firmware or you already do that and want to connect to storage of your phone ???

    [updates once a week] = [90% less problems]
    http://gofccyourself.com
    my-blog#k
    how to add system logs
    i3 GNOME

  • to use adb and fastboot to flash the phone you need to do the following:

    • plug in usb from phone to computer
    • enable MTP mode aka fotos on the phone
    adb devices
    adb reboot bootloader
    fastboot flash boot boot.img
    fastboot flash recovery recovery.img
    
    • Where most commands needs root permission to work (use sudo)

    [updates once a week] = [90% less problems]
    http://gofccyourself.com
    my-blog#k
    how to add system logs
    i3 GNOME

  • I need to boot into fastboot to unlock my device with adb reboot fastboot
    But as I said when I enabling USB debug mode I getting infinite cycle of connects-disconects so adb doesn’t see device.
    I don’t see such behavior under Gnome or WIndows.
    Here I’ve made gif of what I see in DE
    0_1506063313332_Peek 2017-09-22 09-51.gif
    What is happening at devices level was described in my first post.

  • You need to enable MTP on the phone (called photos) on the option popup when you plug the nusb to computer…
    and you can try to reset usb-debugging authorization in developer settings. phnone does not show up in filebrowser if it is plugged as MTP device…

    [updates once a week] = [90% less problems]
    http://gofccyourself.com
    my-blog#k
    how to add system logs
    i3 GNOME

  • It is enabled
    0_1506071181960_Screenshot_2017-09-22-12-04-54.png
    I can browse files in my phone till the moment I run adb command.
    But after I run adb devices in console with debug mode enable on the phone this connect-desconnect cycles starting.
    I thought it is problem of conflicts with some of my packages so I installed clean Antergos KDE installation from latest install media.
    Intalled 2 packages

    3 community/android-tools 8.0.0_r11-1 [installed]
        Android platform tools
    4 community/android-udev 20170910-1 [installed]
        Udev rules to connect Android devices to your linux box
    

    and getting the same behavior.

    As I said I don’t have such behavior under Gnome or Windows.
    I think I again wrong with selection of my daily Linux distribution and DE :(

  • It looks like general Plasma issue
    Intalled fedora 26 KDE and it shows the same behavior

  • what does the journal gives out while plugging the phone?
    journalctl -f in aterminal before plugging it in???

    [updates once a week] = [90% less problems]
    http://gofccyourself.com
    my-blog#k
    how to add system logs
    i3 GNOME

  • After plugging without adb

    Sep 22 15:08:36 DzirT-LT kube[1076]: mimetreeparser: Node UNprocessed:  0x564f69df0300
    Sep 22 15:08:36 DzirT-LT kube[1076]: mimetreeparser: Node processed:  "2" "Content-Type: text/html; charset=\"UTF-8\""
    Sep 22 15:08:36 DzirT-LT kube[1076]: mimetreeparser: Node processed:  "1" "Content-Type: text/plain; charset=\"UTF-8\""
    Sep 22 15:08:36 DzirT-LT kube[1076]: mimetreeparser: Node processed:  "" "Content-Type: multipart/alternative; boundary=\"498ba4da87bd83851a8c736f6305eff721dd9de9cfa6907d13a35f499eba\""
    Sep 22 15:08:36 DzirT-LT kube[1076]: file:///usr/lib/qt/qml/org/kube/framework/MailViewer.qml:453:35: Unable to assign [undefined] to QString
    Sep 22 15:08:36 DzirT-LT kube[1076]: QTextHtmlParser::applyAttributes: Unknown color name 'f0f0f0'
    Sep 22 15:08:36 DzirT-LT kube[1076]: file:///usr/lib/qt/qml/org/kube/components/mailviewer/TextContent.qml:43:9: QML QQuickTextEdit: Cannot open: file:///usr/lib/qt/qml/org/kube/components/mailviewer/url(https://appboy-images.com/appboy/communication/assets/image_assets/images/59bfca9e56ec31364529aabd/original.?1505741470)
    Sep 22 15:08:36 DzirT-LT kube[1076]: libpng warning: iCCP: known incorrect sRGB profile
    Sep 22 15:08:37 DzirT-LT kube[1076]: libpng warning: iCCP: known incorrect sRGB profile
    Sep 22 15:08:39 DzirT-LT kwin_x11[987]: QXcbConnection: XCB error: 3 (BadWindow), sequence: 5550, resource id: 58720282, major code: 15 (QueryTree), minor code: 0
    Sep 22 15:09:49 DzirT-LT kernel: usb 1-2: new high-speed USB device number 3 using xhci_hcd
    Sep 22 15:09:50 DzirT-LT baloo_file[988]: org.kde.baloo: "/org/kde/solid/udev/sys/devices/pci0000:00/0000:00:14.0/usb1/1-2"
    Sep 22 15:09:50 DzirT-LT baloo_file[988]: QObject::connect: invalid null parameter
    Sep 22 15:09:50 DzirT-LT kdeinit5[928]: QObject::connect: invalid null parameter
    Sep 22 15:09:50 DzirT-LT colord[467]: lib/colord/colord-sane: error while loading shared libraries: libsane.so.1: cannot open shared object file: No such file or directory
    Sep 22 15:09:50 DzirT-LT plasmashell[992]: file:///usr/lib/qt/qml/QtQuick/Controls/Button.qml:99: TypeError: Cannot read property 'width' of null
    Sep 22 15:09:50 DzirT-LT plasmashell[992]: file:///usr/share/plasma/plasmoids/org.kde.plasma.devicenotifier/contents/ui/FullRepresentation.qml:136:25: Unable to assign [undefined] to QString
    Sep 22 15:09:50 DzirT-LT plasmashell[992]: trying to show an empty dialog
    Sep 22 15:09:50 DzirT-LT plasmashell[992]: QFileInfo::absolutePath: Constructed with empty filename
    Sep 22 15:09:50 DzirT-LT plasmashell[992]: QFileInfo::absolutePath: Constructed with empty filename
    Sep 22 15:09:50 DzirT-LT plasmashell[992]: QFileInfo::absolutePath: Constructed with empty filename
    Sep 22 15:09:50 DzirT-LT plasmashell[992]: QFileInfo::absolutePath: Constructed with empty filename
    Sep 22 15:09:50 DzirT-LT plasmashell[992]: QFileInfo::absolutePath: Constructed with empty filename
    Sep 22 15:09:55 DzirT-LT plasmashell[992]: QFileInfo::absolutePath: Constructed with empty filename
    Sep 22 15:09:55 DzirT-LT plasmashell[992]: QFileInfo::absolutePath: Constructed with empty filename
    Sep 22 15:09:55 DzirT-LT plasmashell[992]: QFileInfo::absolutePath: Constructed with empty filename
    Sep 22 15:09:55 DzirT-LT plasmashell[992]: QFileInfo::absolutePath: Constructed with empty filename
    
  • This is after running adb devices when dead loop statring
    https://pastebin.com/RYB2Fcx7
    Sorry can’t post it right here because it says that is spam :(

  • baloo_file[988]: org.kde.baloo: Found removable storage volume for Baloo undocking:

    may try disable baloo indexing?

    there also https://www.archlinux.org/packages/extra/x86_64/kio-extras/

    may help with mtp

    [updates once a week] = [90% less problems]
    http://gofccyourself.com
    my-blog#k
    how to add system logs
    i3 GNOME

  • koi-extras already installed
    I think it was installed as dependency to some other package
    Also disable baloo indexing but it just decreased journalctl output but doesn’t have any impact on my problem

  • Ok eventually found what was a problem.
    I reverted
    android-tools-8.0.0_r11-1
    to
    android-tools-7.1.2_r27-1
    and adb started to work

    I was wrong with the assumption that it works in Gnome.
    I had little bit outdated installation without android-tools-8.0.0_r11-1 that is why it was working.
    After updating all packages it also stopped working under Gnome.

  • good to see!
    I have latest android-tools and it works under Gnome…

    [updates once a week] = [90% less problems]
    http://gofccyourself.com
    my-blog#k
    how to add system logs
    i3 GNOME

  • If someone interested here is opened issue for this
    https://bugs.archlinux.org/task/55576

  • what is suggested there is to use the git version or to downgrade, till it is fixed upstream… good to know!

    [updates once a week] = [90% less problems]
    http://gofccyourself.com
    my-blog#k
    how to add system logs
    i3 GNOME

Posts 19Views 526
Log in to reply