mtp usage: como montar e transferir arquivos de e para um celular Samsung modelo Galaxy: Android

1

como faço para usar o mtpfs para ler / gravar em um telefone Android conectado via USB, conectado como um dispositivo de armazenamento em massa:

thufir@dur:~$ 
thufir@dur:~$ mkdir phone
thufir@dur:~$ 
thufir@dur:~$ sudo mtpfs -o allow_other phone
[sudo] password for thufir: 
Unable to open ~/.mtpz-data for reading, MTPZ disabled.Listing raw device(s)
Device 0 (VID=04e8 and PID=6860) is a Samsung Galaxy models (MTP).
   Found 1 device(s):
   Samsung: Galaxy models (MTP) (04e8:6860) @ bus 1, dev 6
Attempting to connect device
ignoring libusb_claim_interface() = -6PTP_ERROR_IO: failed to open session, trying again after resetting USB interface
LIBMTP libusb: Attempt to reset device
LIBMTP PANIC: Could not open session! (Return code 8195)
  Try to reset the device.
Unable to open raw device 0
thufir@dur:~$ 

e:

thufir@dur:~$ 
thufir@dur:~$ mount
/dev/mapper/ubuntu--vg-root on / type ext4 (rw,errors=remount-ro)
proc on /proc type proc (rw,noexec,nosuid,nodev)
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)
none on /sys/fs/cgroup type tmpfs (rw)
none on /sys/fs/fuse/connections type fusectl (rw)
none on /sys/kernel/debug type debugfs (rw)
none on /sys/kernel/security type securityfs (rw)
udev on /dev type devtmpfs (rw,mode=0755)
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620)
tmpfs on /run type tmpfs (rw,noexec,nosuid,size=10%,mode=0755)
none on /run/lock type tmpfs (rw,noexec,nosuid,nodev,size=5242880)
none on /run/shm type tmpfs (rw,nosuid,nodev)
none on /run/user type tmpfs (rw,noexec,nosuid,nodev,size=104857600,mode=0755)
none on /sys/fs/pstore type pstore (rw)
/dev/sda1 on /boot type ext2 (rw)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,noexec,nosuid,nodev)
systemd on /sys/fs/cgroup/systemd type cgroup (rw,noexec,nosuid,nodev,none,name=systemd)
gvfsd-fuse on /run/user/1000/gvfs type fuse.gvfsd-fuse (rw,nosuid,nodev,user=thufir)
thufir@dur:~$ 

e lsusb mostra:

thufir@dur:~$ lsusb
Bus 001 Device 006: ID 04e8:6860 Samsung Electronics Co., Ltd GT-I9100 Phone [Galaxy S II], GT-I9300 Phone [Galaxy S III], GT-P7500 [Galaxy Tab 10.1]
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 003: ID 045e:00cb Microsoft Corp. Basic Optical Mouse v2.0
Bus 004 Device 002: ID 0461:0010 Primax Electronics, Ltd HP Keyboard
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
thufir@dur:~$ 

Alternar o telefone entre o MTP e o PTP permite:

thufir@dur:~$ 
thufir@dur:~$ sudo mtpfs -o allow_other phone
[sudo] password for thufir: 
Unable to open ~/.mtpz-data for reading, MTPZ disabled.Listing raw device(s)
   No raw devices found.
thufir@dur:~$ sudo mtpfs -o allow_other phone
Unable to open ~/.mtpz-data for reading, MTPZ disabled.Listing raw device(s)
Device 0 (VID=04e8 and PID=6860) is a Samsung Galaxy models (MTP).
   Found 1 device(s):
   Samsung: Galaxy models (MTP) (04e8:6860) @ bus 1, dev 8
Attempting to connect device
Listing File Information on Device with name: GT-S7560M
thufir@dur:~$ 
thufir@dur:~$ ls phone 
ls: cannot access phone: Transport endpoint is not connected
thufir@dur:~$ 

embora eu não saiba o que isso faz.

veja também:

link

    
por Thufir 21.10.2014 / 00:55

3 respostas

-1

magicamente, funciona agora:

Está montado?

thufir@tleilax:~$ 
thufir@tleilax:~$ mount
/dev/sda5 on / type ext4 (rw,errors=remount-ro)
proc on /proc type proc (rw,nodev,noexec,nosuid)
sysfs on /sys type sysfs (rw,nodev,noexec,nosuid)
none on /sys/fs/cgroup type tmpfs (rw,uid=0,gid=0,mode=0755,size=1024)
none on /sys/fs/fuse/connections type fusectl (rw)
none on /sys/kernel/debug type debugfs (rw)
none on /sys/kernel/security type securityfs (rw)
udev on /dev type devtmpfs (rw,mode=0755)
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620)
tmpfs on /run type tmpfs (rw,noexec,nosuid,size=10%,mode=0755)
none on /run/lock type tmpfs (rw,nodev,noexec,nosuid,size=5242880)
none on /run/shm type tmpfs (rw,nosuid,nodev)
none on /run/user type tmpfs (rw,nodev,noexec,nosuid,size=104857600,mode=0755)
none on /sys/fs/pstore type pstore (rw)
systemd on /sys/fs/cgroup/systemd type cgroup (rw,nosuid,noexec,nodev,none,name=systemd)
/home/.ecryptfs/thufir/.Private on /home/thufir type ecryptfs (ecryptfs_check_dev_ruid,ecryptfs_cipher=aes,ecryptfs_key_bytes=16,ecryptfs_unlink_sigs,ecryptfs_sig=c36b5937afc3da6c,ecryptfs_fnek_sig=bd3e015ffef0ebaf)
gvfsd-fuse on /run/user/1000/gvfs type fuse.gvfsd-fuse (rw,nosuid,nodev,user=thufir)
/dev/sr0 on /media/thufir/Ubuntu 14.10 amd64 type iso9660 (ro,nodev,nosuid,uid=1000,gid=1000,iocharset=utf8,mode=0400,dmode=0500,uhelper=udisks2)
thufir@tleilax:~$
    
por Thufir 23.03.2015 / 04:07
0

Eu estou no Bunsen Labs derivado do Debian Linux 8.6 bunsen-hydrogen
Então, você pode tentar isto:

$ sudo apt-get install mtp-tools
$ man mtp-tools

Isso é meio desajeitado, mas eu usei-o para tirar arquivos do meu telefone da Alcatel (KitKat). Tem que haver uma maneira melhor ...

#!/bin/bash
# copies all the pictures out of my Android phone

echo "Creating list of .jpg files..."
mtp-files | \
egrep '^File ID|Filename' | \
perl -pe 'm/^File/ && s/\n//' | \
perl -lane 'print "$F[2] $F[4]" if m/\.jpg/' > camera_files.lst

while read field1 field2; do
  echo "Copying $field2..."
  mtp-getfile $field1 $field2
done < camera_files.lst
    
por AAAfarmclub 25.09.2017 / 20:51
0

Não consegui que o mtp-tools funcionasse. Eu instalei o jmtpfs e ele é funcional, embora as operações do diretório sejam muito lentas, especialmente para diretórios enormes como fotos.

(Para um único arquivo eu é mais rápido usar o bluetooth ou e-mail; para muitos arquivos, eu pego o sdcard do meu telefone e montei no computador.)

Veja Como conectar o Android 7.1 para o Ubuntu Linux com USB?

    
por maharvey67 14.04.2018 / 23:20