Giter Club home page Giter Club logo

mtpfs's Introduction

MTPFS
--------

MTPFS is a FUSE filesystem based on libmtp that allows a mtp device
to be browsed as if it were a normal external harddisk

Requirements
------------

FUSE >= 2.2
GLib >= 2.30
libmtp >= 1.1.2

How to mount a filesystem
-------------------------

To mount a device run:

  mtpfs <mount_point>

To unmount do:

  fusermount -u <mount_point>

Note that you may need to be root to do all this if permissions on the
MTP device are not correct

Debugging
---------
To enable debugging info use the --enable-debug option when running ./configure

Acknowledgements
----------------
This wouldn't be possible without libmtp, libusb and fuse.
Sections of code (in id3read.c and mp3file.c) blatently ripped from gnomad

Contact info
------------
Chris Debenham <[email protected]>

mtpfs's People

Contributors

cjd avatar larsch avatar quix0r avatar trofi avatar vsbogd avatar wking avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

mtpfs's Issues

No reported errors, but most directories are blank

I have a Fairphone 3, running vanilla Android 10. I tried to mount it on my gentoo system. USB debugging is enabled. I followed the usage instructions here: https://wiki.gentoo.org/wiki/MTPfs

$ mtpfs ~/AndroidDevice/
Listing raw device(s)
Device 0 (VID=18d1 and PID=4ee2) is a Google Inc Nexus/Pixel (MTP+ADB).
   Found 1 device(s):
   Google Inc: Nexus/Pixel (MTP+ADB) (18d1:4ee2) @ bus 2, dev 32
Attempting to connect device
Android device detected, assigning default bug flags

Listing File Information on Device with name: (NULL)

All the directories appear, but most are blank:

$ ls ~/AndroidDevice/Internal\ shared\ storage/
Alarms  Android  DCIM  Download  Movies  Music  Musicolet  Notifications  Pictures  Podcasts  Ringtones  TWRP  WhatsApp
daniel@gentoo:~
$ ls ~/AndroidDevice/Internal\ shared\ storage/DCIM/Camera/
# no output, but there are definitely files here
$ ls ~/AndroidDevice/Internal\ shared\ storage/Download/
 0f63f9_7876b8c5d43d4713a46fb3d5bb853e64.pdf   freeculture.pdf
'1178993 (1).jpg'                             1178993.jpg
Camera
daniel@gentoo:~
$ ls ~/AndroidDevice/Internal\ shared\ storage/Download/Camera/
# again, no output, despite files existing on the device

can't access MTP device : nothing displayed, successfull access using pcmanfm-qt

I connected in the past using file managers to mtp device, but now I want to perform some sync accross folder, so I need a regular filesystem access

the device is correctly working with pcmanfm-qt, with libmtp support

but when I try with mtpfs I only get the following:

mtpfs media/mtp/
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 2, dev 7
Attempting to connect device
Android device detected, assigning default bug flags

nothing is outputed when ls media/mtp I can´t find how to have more debug information
thanks and regards

Does not build on OS X Sierra 10.12.3

Installed latest OSX Fuse 3.5.8 from https://osxfuse.github.io/
Installed mtpfs dependencies via:

brew install libid3tag
brew install libmad
brew install libmtp

After ./configure and make I get these errors:

In file included from ./mtpfs.h:13:
In file included from /usr/local/include/osxfuse/fuse/fuse.h:31:
/usr/local/include/osxfuse/fuse/fuse_common.h:555:8: error: On Darwin API version 25 or greater must be used
#            error On Darwin API version 25 or greater must be used
             ^
In file included from mtpfs.c:9:
./mtpfs.h:20:10: fatal error: 'sys/statfs.h' file not found
#include <sys/statfs.h>
         ^
2 errors generated.

Nokia 3.1 does show folders, but no files in them

I am trying to transfer files from a Nokia 3.1. Using the libmtp example mtp-filetree I am able to see photos on the telephone, I have a similar experience in Windows Explorer. Using mtpfs I am not able to see any files within the photo folders.

There is a single file in the wifi root, which I am able to see. I have attached the debug output.

I have tried libmtp-git, with mtpfs-git.

debug2.txt

Using mtp-getfile I am able to transfer it:

mtp-files  | grep -B 1 mp4
File ID: 393
   Filename: VID_20200405_193618.mp4

mtp-getfile 393 VID_20200405_193618.mp4

mtpfs not working with Honor 5x Android 6.0, but with go-mtpfs

When trying to mount with mtpfs, I get:

time sudo mtpfs -o allow_other mtp
    Listing raw device(s)
    Device 0 (VID=12d1 and PID=1082) is a Huawei Ascend P8 .
       Found 1 device(s):
       Huawei: Ascend P8  (12d1:1082) @ bus 3, dev 63
    Attempting to connect device
    Android device detected, assigning default bug flags
    Listing File Information on Device with name: (NULL)

    real    0m13.330s
    user    0m0.144s
    sys     0m0.164s
ls mtp 
    ls: cannot access 'mtp': Transport endpoint is not connected

But when I try with go-mtpfs, it works without problems:

sudo fusermount -u mtp
go-mtpfs mtp &
    2016/08/28 15:15:53 FUSE mounted
ls mtp
    Internal storage  SD card

mtp-getfile also does work:

time mtp-getfile 3158 IMG_20160826_093251.jpg
    libmtp version: 1.1.12

    Device 0 (VID=12d1 and PID=1082) is a Huawei Ascend P8 .
    Android device detected, assigning default bug flags
    Getting file/track 3158 to local file IMG_20160826_093251.jpg
    Progress: 3246016 of 3246016 (100%)

    real    0m11.193s
    user    0m0.300s
    sys     0m0.364s

Listing fails with a mutex error.

Mounting appears to succeed, but as soon as I try listing the mountpoint, this happens:

Listing raw device(s)
Device 0 (VID=22b8 and PID=2e76) is a Motorola Moto G (ID1).
   Found 1 device(s):
   Motorola: Moto G (ID1) (22b8:2e76) @ bus 1, dev 17
Attempting to connect device
Android device detected, assigning default bug flags
Listing File Information on Device with name: (NULL)
FUSE library version: 2.9.9
nullpath_ok: 0
nopath: 0
utime_omit_ok: 0
unique: 2, opcode: INIT (26), nodeid: 0, insize: 56, pid: 0
INIT: 7.31
flags=0x03fffffb
max_readahead=0x00020000
   INIT: 7.19
   flags=0x00000010
   max_readahead=0x00020000
   max_write=0x00020000
   max_background=0
   congestion_threshold=0
   unique: 2, success, outsize: 40
unique: 4, opcode: ACCESS (34), nodeid: 1, insize: 48, pid: 343884
   unique: 4, error: -38 (Function not implemented), outsize: 16
unique: 6, opcode: GETATTR (3), nodeid: 1, insize: 56, pid: 343891
getattr /
Attempt to unlock mutex that was not locked
fish: “mtpfs -d droid” terminated by signal SIGABRT (Abort)

(This is with -d.)

package versions:
mtpfs 1.1-4
libmtp 1.1.17-1
glib2 2.64.5-1
libid3tag 0.15.1b-11
fuse2 2.9.9-4
libmad 0.15.1b-9

os: archlinux

The device is a Moto G4 (athene), but that should be irrelevant since it works fine on thunar with vgfs-mtp.

exited on signal 6 (core dumped)

as root on freebsd-10.1 (in VirtualBox eg not usb 2.0)
mtpfs /mnt
Listing raw device(s)
Device 0 (VID=0fce and PID=0170) is a SONY ST21i Xperia Tipo MTP.
Found 1 device(s):
SONY: ST21i Xperia Tipo MTP (0fce:0170) @ bus 0, dev 2
Attempting to connect device
Android device detected, assigning default bug flags
Listing File Information on Device with name: (NULL)
dmeg (exited on signal 6 (core dumped))
#0 0x00000008025b16ca in thr_kill () from /lib/libc.so.7
#1 0x0000000802686149 in abort () from /lib/libc.so.7
#2 0x000000080139fa80 in g_thread_abort (status=1, function=0x8013fdaed "pthread_mutex_unlock") at gthread-posix.c:80
#3 0x000000080139faba in g_mutex_unlock (mutex=0x80401e7c0) at gthread-posix.c:236
#4 0x000000000040567a in mtpfs_getattr (path=0x80401ec00 "/", stbuf=0x7fffffbfdbf8) at mtpfs.c:919
#5 0x000000080082e475 in fuse_fs_getattr (fs=0x804096300, path=0x80401ec00 "/", buf=0x7fffffbfdbf8) at fuse.c:1596
#6 0x0000000800834b9f in fuse_lib_getattr (req=0x80404e400, ino=1, fi=0x0) at fuse.c:2734
#7 0x000000080083fd94 in do_getattr (req=0x80404e400, nodeid=1, inarg=0x8040eb028) at fuse_lowlevel.c:1044
#8 0x000000080083f3a5 in fuse_ll_process_buf (data=0x804064600, buf=0x7fffffbfdf58, ch=0x804016300) at fuse_lowlevel.c:2441
#9 0x00000008008444a0 in fuse_session_process_buf (se=0x8040632e0, buf=0x7fffffbfdf58, ch=0x804016300) at fuse_session.c:87
#10 0x000000080083c063 in fuse_do_work (data=0x804017cd0) at fuse_loop_mt.c:117
#11 0x00000008023284f5 in pthread_create () from /lib/libthr.so.3
#12 0x0000000000000000 in ?? ()

LIBMTP PANIC: failed to open session on second attempt

This is what happens:

root@bobby:/media# mtpfs /media/SAMSUNG_Galaxy3/
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: failed to open session on second attempt
Unable to open raw device 0

Unknown device (2207:0015)

Got an unknown device with a request to report this to this project. It's a Boox Onyx NovaPro e-ink tablet running (at the latest) Android 6.0.1. Appears to perhaps have read-only access to the file system (directory tree appears visible), but apparently all write operations silently fail as the user and fail with a permission denied error as root.

Cannot see/copy files on Xiaomi Redmi Note 3

Hi!
Try to attach a phone to a Gentoo linux box...
use libmtp-1.1.11 mtpfs-1.1-r3

mtpfs ~/AndroidDevice/
Listing raw device(s)
Device 0 (VID=2717 and PID=ff68) is a Xiaomi Redmi 2 2014811 (MTP).
Found 1 device(s):
Xiaomi: Redmi 2 2014811 (MTP) (2717:ff68) @ bus 2, dev 8
Attempting to connect device
Android device detected, assigning default bug flags
Error 7: Found a bad handle, trying to ignore it.
Listing File Information on Device with name: Redmi Note 3

mtp-detect: http://pastebin.calculate-linux.ru/ru/show/11901

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.