Subject: Re: mount MTP phone

From: Joe Pfeiffer <[email-masked]>
Date: Tue, 06 Sep 2016 09:19:47 -0600

Curt Howland <[email-masked]> writes:

> I've never been able to mount any MTP phone to Linux. Different 
> phones, different Android versions, different Linux installations, 
> nada.

I've only been able to do it using jmtpfs (I don't have it set up to
automount using that).
-- 
"Erwin, have you seen the cat?" -- Mrs. Shrödinger

---

From: Ivan Petrov <[email-masked]>
Date: Wed, 7 Sep 2016 23:29:06 +0700

> I've only been able to do it using jmtpfs (I don't have it set up to

Why I have this messages, when I'm using it?

$ jmtpfs /media/exfat
Device 0 (VID=19d2 and PID=ffce) is UNKNOWN.
Please report this VID/PID and the device model to the libmtp 
development team
Android device detected, assigning default bug flags

?

---

From: Joe Pfeiffer <[email-masked]>
Date: Wed, 07 Sep 2016 10:58:42 -0600

> Android device detected, assigning default bug flags

First question:  when you plugged the phone in, did you turn on USB for
file transfers?  Without that I get almost exactly the same behavior you
see:

snowball:501$ jmtpfs /home/joseph/mnt
Device 0 (VID=18d1 and PID=4ee1) is a Google Inc (for LG Electronics/Samsung) Nexus 4/5/7/10 (MTP).
Android device detected, assigning default bug flags
snowball:502$ ls mnt
/bin/ls: cannot access 'mnt': Input/output error

If I click the notification on my phone and then select "File transfers"
I get

snowball:507$ jmtpfs /home/joseph/mnt
Device 0 (VID=18d1 and PID=4ee1) is a Google Inc (for LG Electronics/Samsung) Nexus 4/5/7/10 (MTP).
Android device detected, assigning default bug flags
snowball:508$ ls mnt
Internal storage/

which is of course what I want.

I'm not sure whether the actual error message you're getting

> Please report this VID/PID and the device model to the libmtp

is relevant; that's telling you that the vendor ID and product ID your
phone is using to identify itself aren't in libmtp's database.  If I
search for them at http://www.the-sz.com/ it tells me the vendor is ZTE
(which looking at the table appears to be a chipset manufacturer, not
the manufacturer of your phone) but it can't find your device.  On the
other hand, jmtpfs is seeing that your device is an Android device, so
it seems to have gotten around that somehow.

---

From: Nicolas George <[email-masked]>
Date: Mon, 5 Sep 2016 17:09:38 +0200

> phones, different Android versions, different Linux installations, 

I have. With FUSE and gvfs, something like (the computer where I did it and
kept notes is current shut down):

gvfs-mount 'mtp://[usb:001,002]'

You need to have gvfs-fuse already running, then it appears under
/run/users/$UID/gvfs/.

libmtp has a few tools to manipulate MTP devices without mounting them, but
they have 0 documentation. Furthermore, MTP it awfully slow at startup for
some tasks, so individual commands without a process to keep the library
open will give awful results. I have started working on a tool with a
script-friendly FTP-like interface, but not got very far yet due to other
more pressing projects.

Regards,

-- 
  Nicolas George

---

From: Celejar <[email-masked]>
Date: Mon, 5 Sep 2016 20:53:45 -0400

On Mon, 5 Sep 2016 17:09:38 +0200

> script-friendly FTP-like interface, but not got very far yet due to other

My Android Moto G and E both mount fine with jmtpfs:

~$ jmtpfs ~/mnt

Basic copying and moving files (that's all I have tried) then works
fine.

Umounting works fine with:

~$ fusermount -u ~/mnt

Celejar

---

From: Tony Baldwin <[email-masked]>
Date: Mon, 5 Sep 2016 12:47:02 -0400

> script-friendly FTP-like interface, but not got very far yet due to other

Something has changed since yesterday (IN which I installeed jmtpfs).
Now when I do ls usb, I see this:
Bus 005 Device 012: ID 22b8:2ea4 Motorola PCS
I'm also seeing possibly relevant (I don't know) stuff in dmesg, such as 
this:
[quote][75390.506984] hub 5-0:1.0: port 5 disabled by hub (EMI?), 
re-enabling...
[75390.507000] usb 5-5: USB disconnect, device number 8
[75406.588441] usb 5-5: new high-speed USB device number 9 using ehci_hcd
[75406.722345] usb 5-5: New USB device found, idVendor=22b8, idProduct=2ea6
[75406.722360] usb 5-5: New USB device strings: Mfr=1, Product=2, 
SerialNumber=3
[75406.722368] usb 5-5: Product: XT1254
[75406.722374] usb 5-5: Manufacturer: motorola
[75406.722379] usb 5-5: SerialNumber: ZY2234TGKZ
[81479.602219] usb 5-5: USB disconnect, device number 9
[81479.876441] usb 5-5: new high-speed USB device number 10 using ehci_hcd
[81480.010291] usb 5-5: New USB device found, idVendor=22b8, idProduct=2ea6
[81480.010305] usb 5-5: New USB device strings: Mfr=1, Product=2, 
SerialNumber=3
[81480.010314] usb 5-5: Product: XT1254
[81480.010319] usb 5-5: Manufacturer: motorola
[81480.010325] usb 5-5: SerialNumber: ZY2234TGKZ
[81483.946880] usb 5-5: USB disconnect, device number 10
[81484.220444] usb 5-5: new high-speed USB device number 11 using ehci_hcd
[81484.354763] usb 5-5: New USB device found, idVendor=22b8, idProduct=2ea6
[81484.354778] usb 5-5: New USB device strings: Mfr=1, Product=2, 
SerialNumber=3
[81484.354786] usb 5-5: Product: XT1254
[81484.354792] usb 5-5: Manufacturer: motorola
[81484.354797] usb 5-5: SerialNumber: ZY2234TGKZ
[81484.399977] usb 5-5: USB disconnect, device number 11
[81508.968204] usb 5-5: new high-speed USB device number 12 using ehci_hcd
[81509.102613] usb 5-5: New USB device found, idVendor=22b8, idProduct=2ea4
[81509.102627] usb 5-5: New USB device strings: Mfr=1, Product=2, 
SerialNumber=3
[81509.102635] usb 5-5: Product: XT1254
[81509.102641] usb 5-5: Manufacturer: motorola
[81509.102647] usb 5-5: SerialNumber: ZY2234TGKZ
[/quote]

is your work in a github repo, sourceforge project, or similar, where 
others could have a look, and, perhaps, contribute, Nicolas?

-- 
http://tonybaldwin.me
all tony, all the time

---

From: Anthony Baldwin <[email-masked]>
Date: Mon, 5 Sep 2016 13:45:26 -0400

Sorry for top-posting.
Iḿ no t even sure what it was that DID solve this but the phone is now 
mounting at mtp://[usb:005,012]/
Must have something to do with installing the jmtpfs pkg,
because that's the only thing I can think of that I did yesterday that 
could be making a difference today.
I did briefly put the phone on ptp/camera mode, and it let me download 
the photos on it, but now it's letting me completely access the storage 
for whatever (move photos, music, etc. phone<->computer)

-- 
http://www.baldwinlinguas.com
translations, localization,
multilingual web development
EN, ES, FR, PT

---

From: Joe Pfeiffer <[email-masked]>
Date: Tue, 06 Sep 2016 09:21:10 -0600

Anthony Baldwin <[email-masked]> writes:

> the photos on it, but now it's letting me completely access the
> storage for whatever (move photos, music, etc. phone<->computer)

Magic fixes like this *really* sound like a bad cable.

---

From: Nicolas George <[email-masked]>
Date: Mon, 5 Sep 2016 19:09:30 +0200

> [75406.722379] usb 5-5: SerialNumber: ZY2234TGKZ

This is rather promising.

> [81484.220444] usb 5-5: new high-speed USB device number 11 using ehci_hcd

This is less promising: disconnect and then immediate reconnect. Could be a
faulty contact in the cable.

> [81508.968204] usb 5-5: new high-speed USB device number 12 using ehci_hcd

This one was longer. Maybe you remember if you did something with the phone
at the time. /var/log/kernel.log or `journalctl -kb` would have readable
timestamps.

I would also suggest dmesg -w to see the messages in realtime.

> is your work in a github repo, sourceforge project, or similar, where others
> could have a look, and, perhaps, contribute, Nicolas?

It is way too early for that: no doc, no build system. I just added a quick
comment with a copyright notice and the build command and uploaded to my web
page (so 1990's!):

http://nsup.org/~george/comp/misc/mtpop.c

I can make no promise about a timeline, or even reacting to contributions,
except it will be long (fixing libavfilter has uttermost priority for me
right now). But this is the only place I have publicly spoken of it, so if
someone wants to completely take over, just reply to this mail and everybody
will be informed.

Regards,

-- 
  Nicolas George

Regards,

-- 
  Nicolas George