FedoraForum.org - Fedora Support Forums and Community
Results 1 to 9 of 9
  1. #1
    Join Date
    Jul 2013
    Location
    My house.
    Posts
    78
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Android 4.2 file access from Fedora 19 via MTP.

    I recently purchased an S4. I wanted to mount it on my Fedora 19 machine so that I browse and transfer files from Dolphin.

    For those not aware, USB Mass Storage mode has been removed as a connection option on several new Android devices. It has been replaced my a new protocol called MTP which has many advantages over USM, including concurrent access by both the device and the client and transcending the FAT32 limitations inherent in USM.

    It turns out that Linux (Fedora at least) supports MTP and accessing an Android device via MTP from Linux (Fedora) is straightforward and efficient.

    Here are the steps to do so.

    1) Download and install phoneutil.apk for your device. I have an S4, so the file is here.
    http://downloadandroidrom.com/file/a.../phoneutil.apk

    2) Dial *#7284# to start the application. Select PDA mode, not modem. Set the USB mode to MTP.

    Note. Phones may be set to MTP mode from the "factory". I had to do this because I was debugging things on my phone and had the mode set to ADB.

    3) Check that at least 1 MTP client is installed on your Linux box.
    $ yum list \*mtp\*
    Loaded plugins: langpacks, refresh-packagekit
    Installed Packages
    gvfs-mtp.x86_64 1.16.3-2.fc19 @Updates
    kio_mtp.x86_64 0.75-2.20130323gitcc6b195.fc19 installed
    libmtp.x86_64 1.1.6-0.fc19 installed
    simple-mtpfs.x86_64 0.1-6.fc19 @fedora

    If you don't have one, install one.

    4) Connect the phone to the machine with a USB cable. Dmesg should show something like this.

    [73006.912779] usb 2-1.1: USB disconnect, device number 9
    [73190.694369] usb 2-1.1: new high-speed USB device number 10 using ehci-pci
    [73190.782053] usb 2-1.1: New USB device found, idVendor=04e8, idProduct=6860
    [73190.782059] usb 2-1.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
    [73190.782063] usb 2-1.1: Product: SAMSUNG_Android
    [73190.782065] usb 2-1.1: Manufacturer: SAMSUNG
    [73190.782067] usb 2-1.1: SerialNumber: xxxxxxx

    If you have a client that responds to the USB plug in event, you may get a pop up on your desktop. I run KDE and in Fedora 19 (and 18 IIRC), kio-mtp intercepts and the notifier asks me if I want to use Digikam or Dolphin to open the device.

    If such a process automatically connects your phone to the machine, then proceed to use it. Note, that although I can open my phone in Dolphin via kio-mtp, the process is not a robust one. It will display the S4 file structure correctly but anything other than simple open or move operation throw errors.

    5) Luckily most linux distributions now ship with a tool called simple mtpfs.

    Install it.
    #yum install simple-mtpfs.


    Check for attached mtp devices.
    $ simple-mtpfs -l
    Device 0 (VID=04e8 and PID=6860) is a Samsung Galaxy models (MTP).
    1: SamsungGalaxy models (MTP)

    Read the simple-mtpfs help
    $simple-mtpfs -h

    Mount the device
    $simple-mtpfs ./S4

    Use the new mountpoint.

    $cd S4
    $ ls
    Alarms Android data Documents INDI Music Notifications Pictures Podcasts samsungapps SMemo
    AllsharePlayLog Application DCIM Download Movies Nearby obb Playlists Ringtones ShareShot

    FWIW, I did not have to enable USB debugging in developer options to use MTP.

    It turns out that file operations in Dolphin work much, much better by opening the simple-mtpfs mounted directory (in this case S4) than relying on kio-mtp. I get no errors on any operations working with the mounted directory in a shell or with Dolphin.

    Hope this helps.

  2. #2
    Join Date
    Jan 2010
    Location
    Washington
    Age
    83
    Posts
    50
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Android 4.2 file access from Fedora 19 via MTP.

    I use an app called AirDroid, available in the Google Play Store. Works great with my Nexus 4, 4.2.2 plus there are no cables to attach. You connect to it through your browser, very nice, easy to use interface that acts like a file browser. You can upload, download or move files around.

    Nice write up you did.

    john

  3. #3
    Join Date
    Aug 2011
    Location
    Australia
    Posts
    36
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Android 4.2 file access from Fedora 19 via MTP.

    +1 for AirDroid.

  4. #4
    Join Date
    May 2010
    Location
    Midwest USA
    Age
    59
    Posts
    551
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Re: Android 4.2 file access from Fedora 19 via MTP.

    For XFCE's Thunar it's as simple as:

    yum install gvfs-mtp

    CronoCloud

  5. #5
    Join Date
    Jun 2005
    Location
    UK
    Posts
    4,430
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Android 4.2 file access from Fedora 19 via MTP.

    In KDE it's built into the Dolphin file manager.

    Look under "Network" - "MTP Devices"

    Part of the "bloat" KDE is always accused of, but very nice to have it there.

  6. #6
    Join Date
    May 2011
    Location
    Philadelphia, PA
    Posts
    39
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Android 4.2 file access from Fedora 19 via MTP.

    Quote Originally Posted by CronoCloud
    For XFCE's Thunar it's as simple as:

    yum install gvfs-mtp

    CronoCloud
    Thank you, that was the hint I was looking for. This thread is for Fedora 19, but I am running Fedora 18.

    Perhaps the F19 repository is different, but gvfs-mtp was not available in F18. Instead, I installed gvfs-gphoto2, which has the MTP support.

    Code:
    yum install gvfs-gphoto2
    In Thunar, Edit --> Preferences -- Advanced. Check "Enable Volume Management", then Configure and be sure that the first 2 entries are checked.

    Logout, then login again. With the MTP device connected (my LG cellphone) and configured for MTP, the device mounts without error and I can view my SD card files. The file path appears as:

    Code:
    gphoto2://[usb:001,024]/store_00020001/
    This also works for MATE's file manager.

  7. #7
    Join Date
    Oct 2012
    Location
    Missouri
    Posts
    156
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Android 4.2 file access from Fedora 19 via MTP.

    I have an S4 and it shows up automatically with the removable drive extension. It's the SPH-L720 Black model.
    Inkrypted
    (Insert witty comment here)

  8. #8
    Join Date
    Oct 2008
    Location
    Toledo/Spain
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Android 4.2 file access from Fedora 19 via MTP.

    Quote Originally Posted by linuxguy123
    I recently purchased an S4. I wanted to mount it on my Fedora 19 machine so that I browse and transfer files from Dolphin.

    For those not aware, USB Mass Storage mode has been removed as a connection option on several new Android devices. It has been replaced my a new protocol called MTP which has many advantages over USM, including concurrent access by both the device and the client and transcending the FAT32 limitations inherent in USM.

    It turns out that Linux (Fedora at least) supports MTP and accessing an Android device via MTP from Linux (Fedora) is straightforward and efficient.

    Here are the steps to do so.

    1) Download and install phoneutil.apk for your device. I have an S4, so the file is here.
    http://downloadandroidrom.com/file/a.../phoneutil.apk

    2) Dial *#7284# to start the application. Select PDA mode, not modem. Set the USB mode to MTP.

    Note. Phones may be set to MTP mode from the "factory". I had to do this because I was debugging things on my phone and had the mode set to ADB.

    3) Check that at least 1 MTP client is installed on your Linux box.
    $ yum list \*mtp\*
    Loaded plugins: langpacks, refresh-packagekit
    Installed Packages
    gvfs-mtp.x86_64 1.16.3-2.fc19 @Updates
    kio_mtp.x86_64 0.75-2.20130323gitcc6b195.fc19 installed
    libmtp.x86_64 1.1.6-0.fc19 installed
    simple-mtpfs.x86_64 0.1-6.fc19 @fedora

    If you don't have one, install one.

    4) Connect the phone to the machine with a USB cable. Dmesg should show something like this.

    [73006.912779] usb 2-1.1: USB disconnect, device number 9
    [73190.694369] usb 2-1.1: new high-speed USB device number 10 using ehci-pci
    [73190.782053] usb 2-1.1: New USB device found, idVendor=04e8, idProduct=6860
    [73190.782059] usb 2-1.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
    [73190.782063] usb 2-1.1: Product: SAMSUNG_Android
    [73190.782065] usb 2-1.1: Manufacturer: SAMSUNG
    [73190.782067] usb 2-1.1: SerialNumber: xxxxxxx

    If you have a client that responds to the USB plug in event, you may get a pop up on your desktop. I run KDE and in Fedora 19 (and 18 IIRC), kio-mtp intercepts and the notifier asks me if I want to use Digikam or Dolphin to open the device.

    If such a process automatically connects your phone to the machine, then proceed to use it. Note, that although I can open my phone in Dolphin via kio-mtp, the process is not a robust one. It will display the S4 file structure correctly but anything other than simple open or move operation throw errors.

    5) Luckily most linux distributions now ship with a tool called simple mtpfs.

    Install it.
    #yum install simple-mtpfs.


    Check for attached mtp devices.
    $ simple-mtpfs -l
    Device 0 (VID=04e8 and PID=6860) is a Samsung Galaxy models (MTP).
    1: SamsungGalaxy models (MTP)

    Read the simple-mtpfs help
    $simple-mtpfs -h

    Mount the device
    $simple-mtpfs ./S4

    Use the new mountpoint.

    $cd S4
    $ ls
    Alarms Android data Documents INDI Music Notifications Pictures Podcasts samsungapps SMemo
    AllsharePlayLog Application DCIM Download Movies Nearby obb Playlists Ringtones ShareShot

    FWIW, I did not have to enable USB debugging in developer options to use MTP.

    It turns out that file operations in Dolphin work much, much better by opening the simple-mtpfs mounted directory (in this case S4) than relying on kio-mtp. I get no errors on any operations working with the mounted directory in a shell or with Dolphin.

    Hope this helps.
    Thanks a lot !!! it's works!!

  9. #9
    Join Date
    Oct 2009
    Posts
    33
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Android 4.2 file access from Fedora 19 via MTP.

    Finally a simple & reliable way to connect my phone
    Thank you!!

Similar Threads

  1. Mounting Nexus 4 via MTP in Fedora 17
    By troyengel in forum Guides & Solutions (Not For Questions)
    Replies: 14
    Last Post: 27th January 2013, 06:28 PM
  2. mtp for android devices
    By geolab in forum Hardware
    Replies: 3
    Last Post: 19th July 2012, 06:16 PM
  3. Replies: 0
    Last Post: 27th June 2012, 03:39 PM
  4. MTP devices and Fedora
    By Thetargos in forum Using Fedora
    Replies: 0
    Last Post: 2nd October 2010, 05:12 AM
  5. Replies: 15
    Last Post: 10th May 2008, 09:19 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •