9

So I'm trying to share files between the Samsung Galaxy S5 with Android and my Debian9/KDE machine using MTP instead of KDE Connect.

The problem is that I keep getting:

The process for the mtp protocol died unexpectedly.

When trying to copy over files.

It also often says

No Storages found. Maybe you need to unlock your device?

I can view some of the phone's contents in dolphin after trying for a while: pressing "Allow" whenever the dialog on the phone asks for it while trying to open it in dolphin which correctly detects it as Samsung Galaxy S5.

I once could successfully copy over a bunch of images.

I already tried sudo apt-get install --reinstall libmtp-common. syslog has things like the following:

usb 1-5: usbfs: process 7907 (mtp.so) did not claim interface 0 before use
usb 1-5: reset high-speed USB device number 35 using xhci_hcd
usb 1-5: usbfs: process 7909 (mtp.so) did not claim interface 0 before use
colord-sane: io/hpmud/pp.c 627: unable to read device-id ret=-1
usb 1-5: USB disconnect, device number 35
usb 1-5: new high-speed USB device number 36 using xhci_hcd
usb 1-5: usbfs: process 7930 (mtp.so) did not claim interface 0 before use
usb 1-5: usbfs: process 7930 (mtp.so) did not claim interface 0 before use
usb 1-5: usbfs: process 7930 (mtp.so) did not claim interface 0 before use
mYnDstrEAm
  • 4,275
  • 14
  • 57
  • 118
  • 1
    The problem with MTP is that some phones, perhaps especially those from Samsung, implement MTP in incompatible ways. Some comments (and links) from another samsung-device-related question on this site may be useful. And GAD3R's answer is worth a try too (jmtpfs). – njsg Sep 03 '17 at 08:52
  • You can not forget: "the device's screen needs to be unlocked (for security reasons)". That's the point! – Gilberto Jun 28 '18 at 13:30

1 Answers1

6

Install the jmtpfs package

apt install jmtpfs

Edit your /etc/fuse.conf as follows

# Allow non-root users to specify the allow_other or allow_root mount options.

user_allow_other

Create an udev rule. Use lsusb or mtp-detect to get the ID of your device

nano /etc/udev/rules.d/51-android.rules

with the following line:

SUBSYSTEM=="usb", ATTR{idVendor}=="04e8", ATTR{idProduct}=="6860", MODE="0666", OWNER="[username]"

Replace 04e8 and 6860 with yours , then run:

udevadm control --reload

Reconnect your device , open the terminal and run:

mkdir ~/mtp
jmtpfs ~/mtp
ls ~/mtp

sample output:

Card  Phone

To unmount your device use the following command:

fusermount -u ~/mtp

Also you can use the go-mtpfs tool:

Mount MTP devices over FUSE

mkdir ~/mtp
go-mtpfs ~/mtp

A graphical tool to mount your device : gmtp:

simple file transfer program for MTP based devices

sudo apt install gmtp
gmtp

kio-mtp

access to MTP devices for applications using the KDE Platform

GAD3R
  • 66,769