Fedora Linux Support Community & Resources Center
  #1  
Old 17th July 2013, 07:15 PM
linuxguy123 Offline
Registered User
 
Join Date: Jul 2013
Location: My house.
Posts: 70
linuxfirefox
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.
Reply With Quote
  #2  
Old 17th July 2013, 11:49 PM
jbs1136 Offline
Registered User
 
Join Date: Jan 2010
Location: Washington
Age: 74
Posts: 48
linuxchrome
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
Reply With Quote
  #3  
Old 18th July 2013, 12:41 AM
Tecton Offline
Registered User
 
Join Date: Aug 2011
Location: Australia
Posts: 33
linuxchrome
Re: Android 4.2 file access from Fedora 19 via MTP.

+1 for AirDroid.
Reply With Quote
  #4  
Old 18th July 2013, 12:50 AM
CronoCloud Offline
Registered User
 
Join Date: May 2010
Location: Midwest USA
Age: 50
Posts: 514
linuxfirefox
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
Reply With Quote
  #5  
Old 18th July 2013, 10:52 AM
bbfuller Offline
Registered User
 
Join Date: Jun 2005
Location: UK
Posts: 4,415
linuxopera
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.
Reply With Quote
  #6  
Old 14th September 2013, 09:36 PM
GeekGirl1 Offline
Registered User
 
Join Date: May 2011
Location: Philadelphia, PA
Posts: 38
linuxfirefox
Re: Android 4.2 file access from Fedora 19 via MTP.

Quote:
Originally Posted by CronoCloud View Post
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.
Reply With Quote
  #7  
Old 14th September 2013, 09:42 PM
inkrypted Offline
Registered User
 
Join Date: Oct 2012
Location: Missouri
Posts: 156
linuxfirefox
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)
Reply With Quote
  #8  
Old 25th September 2013, 01:16 PM
usuario51 Offline
Registered User
 
Join Date: Oct 2008
Location: Toledo/Spain
Posts: 1
linuxfirefox
Re: Android 4.2 file access from Fedora 19 via MTP.

Quote:
Originally Posted by linuxguy123 View Post
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!!
Reply With Quote
  #9  
Old 3rd December 2014, 07:47 PM
iborg Offline
Registered User
 
Join Date: Oct 2009
Posts: 33
linuxfirefox
Re: Android 4.2 file access from Fedora 19 via MTP.

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

Tags
access, android, fedora, file, mtp

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Mounting Nexus 4 via MTP in Fedora 17 troyengel Guides & Solutions (Not For Questions) 14 27th January 2013 06:28 PM
mtp for android devices geolab Hardware & Laptops 3 19th July 2012 06:16 PM
Bluetooth OBEX file transfer fails between F16 and Android SGS3 zimon Servers & Networking 0 27th June 2012 03:39 PM
MTP devices and Fedora Thetargos Using Fedora 0 2nd October 2010 05:12 AM
I can't believe Fedora's Amarok is still broken (MTP bug) Thetargos Using Fedora 15 10th May 2008 09:19 AM


Current GMT-time: 01:35 (Sunday, 24-09-2017)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat