You are not logged in.

#1 2020-04-18 10:50:38

spiri
Member
Registered: 2016-12-31
Posts: 65

Connecting an Android device with mptfs not initialized

Hello,

I already tried to mount a lot of Android phones always resulting to the same error.

Now I bought a new one and I want to connect this phone using the MTP protocol on the command line.

When I connect and unlock my phone using USB it is mounted automatically by gvfs.

So first I unmount it using the following code

$ sudo umount /run/user/1000/gvfs

Next I try any of the MTP commands always getting an error the device is not initialized.

$ mtp-detect
libmtp version: 1.1.17

Listing raw device(s)
Device 0 (VID=2717 and PID=ff40) is a Xiaomi Mi-2s (id2) (MTP).
   Found 1 device(s):
   Xiaomi: Mi-2s (id2) (MTP) (2717:ff40) @ bus 1, dev 10
Attempting to connect device(s)
error returned by libusb_claim_interface() = -6LIBMTP PANIC: Unable to initialize device
Unable to open raw device 0
OK.

What can I do to solve this problem?

Offline

#2 2020-04-18 11:14:48

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 22,643

Re: Connecting an Android device with mptfs not initialized

Uninstall gvfs-mtp to ensure it doesn't automount, once anything has already taken control of an MTP device, all bets are off to get it working in another manner.

Is the phone unlocked and specifically put into transfer mode? that can often lead to issues. MTP is in general incredibly fickle, by design, save your sanity and use something network based for transferring files, there are many ftp servers for Android, or something like kdeconnect which will build up an sshfs tunnel, or enable developer mode so you can use adb directly

Offline

#3 2020-04-18 11:36:16

spiri
Member
Registered: 2016-12-31
Posts: 65

Re: Connecting an Android device with mptfs not initialized

Thank you for the fast reply!

I uninstalled gvfs-mtp, rebooted my system, connected my phone, did unlock and selected File Transfer.

Now I am able to mount the device but the file listing is set to (NULL). Getting "Transport endpoint is not connected" error:

$ mtpfs -o allow_other mnt
Listing raw device(s)
Device 0 (VID=2717 and PID=ff40) is a Xiaomi Mi-2s (id2) (MTP).
   Found 1 device(s):
   Xiaomi: Mi-2s (id2) (MTP) (2717:ff40) @ bus 1, dev 8
Attempting to connect device
Android device detected, assigning default bug flags
Listing File Information on Device with name: (NULL)
$ ls mnt
ls: cannot access 'mnt': Transport endpoint is not connected

Offline

#4 2020-04-18 12:28:50

spiri
Member
Registered: 2016-12-31
Posts: 65

Re: Connecting an Android device with mptfs not initialized

Using jmtpfs works for me.

Offline

Board footer

Powered by FluxBB