LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 07-23-2014, 06:09 PM   #1
rnturn
Senior Member
 
Registered: Jan 2003
Location: Illinois (SW Chicago 'burbs)
Distribution: openSUSE, Raspbian, Slackware. Previous: MacOS, Red Hat, Coherent, Consensys SVR4.2, Tru64, Solaris
Posts: 2,831

Rep: Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550
Accessing MTP devices using Wine?


Can this be done?

I'm asking because I've found that a lot of phones' storage can be accessed through a USB connection but only using MTP. In an ideal world, they'd offer MSC as well as MTP (like my Cowon music player) so that you had some flexibility on how you were able to access, manage, backup, etc. your phone contents. My smart phone offers only MTP which doesn't help someone who runs a Linux desktop (and laptop). I can't always depend on the missus's Win7 system to be around and I'm not comfortable walking up to someone at the local coffee shop and asking "Hey, stranger... can I borrow your laptop for a minute?"

So the question: Is there a way to access MTP devices using Wine?

I've tried the Wine File application but don't see any disks that look like my phone. Of course, that may be because the phone may not actually getting mounted by Linux. (Still tinkering with udev rules to see what I can do about that.)

Any ideas, tips, etc. are greatly appreciated.

TIA...

--
Rick
 
Old 07-23-2014, 06:43 PM   #2
David.V
LQ Newbie
 
Registered: Jul 2014
Location: USA
Distribution: Mint 17
Posts: 15

Rep: Reputation: Disabled
I would suggest Airdroid or File Expert HD both are free from the google play store. Both apps uses the web browser to connect to android devices in which you can transfer files wirelessly. File Expert HD has additional features to transfer files using samba, ftp and etc.

Last edited by David.V; 07-23-2014 at 06:47 PM.
 
Old 07-23-2014, 08:20 PM   #3
jefro
Moderator
 
Registered: Mar 2008
Posts: 22,052

Rep: Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632
Might try linux if possible.
http://forum.xda-developers.com/show....php?t=2055563

Last edited by jefro; 07-23-2014 at 08:21 PM.
 
Old 07-24-2014, 08:30 AM   #4
rnturn
Senior Member
 
Registered: Jan 2003
Location: Illinois (SW Chicago 'burbs)
Distribution: openSUSE, Raspbian, Slackware. Previous: MacOS, Red Hat, Coherent, Consensys SVR4.2, Tru64, Solaris
Posts: 2,831

Original Poster
Rep: Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550
Quote:
Originally Posted by jefro View Post
I found that article as well as another on Circuidipity that went through much the same steps.

The article you mentioned was, seemingly, more complete though when I followed the steps for OpenSUSE 12.2 (what I'm currently running) I didn't gain access to the subdirectories I was looking for. All I see when it's plugged into the OpenSUSE system, the Plasma notification appears, and I select the 'browse with Dolphin' option is a "tools" subdirectory (and a few other files). So... it's not quite what I'm looking for. It also appears that the system is interpreting the phone as a CD-ROM -- it's showing up as "/dev/sr1" in the /var/log/messages file and I sometimes see messages about "Joliet extensions" -- definitely CD-ROM type stuff -- related to the plugged-in phone) -- which I doubt is going to allow any manipulation of the files in the phone's filesystem to be done as I can when it's connected to Windows. Example: Files downloaded from the Chrome browser seem to get placed in "downloads" (surprise, surprise) and using Win7 I could move them into the ringtone or music subdirectories.

Anyone with some experience using "mtpfs" to mount MTP devices? When I try a simple mptfs command
Code:
mtpfs -o allow_other /media/mt-pt
that I ran across in another article, I get an error message about the vendor and product IDs being "UNKNOWN". (Really? LG is an unknown vendor? ) After the failed mtpfs mount, the "mount" command actually shows a device of type "mtpfs" mounted on "/media/mt-pt". However neither the KDE file manager or a simple "cd" to that directory show anything. In fact, issuing "cd /media/mt-pt" hangs the terminal window and I have to kill it. Issuing "umount /media/mt-pt" results in a "target is busy" message. "lsof /media/mt-pt" never shows any processes using the mount point and just hangs (but is at least killable using ^C).

Ultimately, I'm thinking that it might be possible to add a "RUN+" parameter to my udev rule to run a script that does the mount using mtpfs. But... I have no positive experiences with mtpfs (yet), there are a ton of options available at least one of which is listed as mandatory ("mandatory options"... gotta love those), and the error message that was displayed when I tried mounting using mtpfs are not making very hopeful that this is even going to work. My version of OpenSUSE is a couple of years old and the phone may be too "new" for the MTP library to recognize it. IMNSHO, MTP isn't a terrible robust protocol if you need a new version of the library to handle newly released devices that claim to use that "standard". But that seems to be where we are for now.

I'll also look into the wireless file transfer option that another respondent mentioned. Sounds intriguing though I'm not sure if it's really what I'm looking for. I need to do some research on that.

[sigh] I'll take another stab at this later today.

Until then...
 
Old 07-24-2014, 11:48 AM   #5
David.V
LQ Newbie
 
Registered: Jul 2014
Location: USA
Distribution: Mint 17
Posts: 15

Rep: Reputation: Disabled
Quote:
Originally Posted by rnturn View Post

I'll also look into the wireless file transfer option that another respondent mentioned. Sounds intriguing though I'm not sure if it's really what I'm looking for. I need to do some research on that.
With Airdroid and File Expert HD there is no need to make custom rules for devices nor do you have to mount anything.

Both apps gives you a web address of the device and a passcode. Once you enter these items, everything is all set to go. You can upload and download files between PC and the android device in both ways.

The only caveat is when transferring many files at once it will take time because it is using wifi, but it does work.

2nd Option

PS: if you still want a direct connection to your device using the USB cable for faster file transfers, you can install the android-SDK package. They offer two packages ADT Bundle and the SDK Tools. For your case, you need only the SDK tools package. The ADT bundle is mainly for developing android apps.

Anyway, once you extracted the archive package, navigate to the tools folders and run the ddms command. This will bring up a GUI file manager that will allow you to navigate files and folders on both your PC and android device and do file transfers.

PPS: USB debugging mode must be enabled from your android device when using android SDK.

Last edited by David.V; 07-24-2014 at 11:57 AM.
 
Old 07-24-2014, 01:00 PM   #6
rnturn
Senior Member
 
Registered: Jan 2003
Location: Illinois (SW Chicago 'burbs)
Distribution: openSUSE, Raspbian, Slackware. Previous: MacOS, Red Hat, Coherent, Consensys SVR4.2, Tru64, Solaris
Posts: 2,831

Original Poster
Rep: Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550
Quote:
Originally Posted by David.V View Post
With Airdroid and File Expert HD there is no need to make custom rules for devices nor do you have to mount anything.
I don't mind having to add/modify the udev rules but having MTP in the middle has added a fun, new level of complexity.

Quote:
Both apps gives you a web address of the device and a passcode. Once you enter these items, everything is all set to go. You can upload and download files between PC and the android device in both ways.
I'll take a look at it later today.

Quote:
The only caveat is when transferring many files at once it will take time because it is using wifi, but it does work.
Not a problem. I do a lot of work at home using my laptop as an X11 interface into my desktop system. All that's done via the home WiFi and I really haven't found the performance to be a big factor.

I stumbled across a WiFi storage option on the phone on a menu that I'd not descending into before. (I've not had this phone for that long and I'm still finding new things here and there.) That might be another way to gain access to these directory structure using the home WiFi and my laptop. Something I can fiddle with tonight while I'm watching the tube. The lack of documentation of these features is really remarkable.

Quote:
PS: if you still want a direct connection to your device using the USB cable for faster file transfers, you can install the android-SDK package. They offer two packages ADT Bundle and the SDK Tools. For your case, you need only the SDK tools package. The ADT bundle is mainly for developing android apps.
I doubt that the faster access will really be needed. This is merely a smart phone I'll be accessing and there's not enough file management that I plan on doing where I'd be wishing for faster access.

Quote:
Anyway, once you extracted the archive package, navigate to the tools folders and run the ddms command. This will bring up a GUI file manager that will allow you to navigate files and folders on both your PC and android device and do file transfers.

PPS: USB debugging mode must be enabled from your android device when using android SDK.
That sounds easy enough. Enabling USB debugging on the phone may be the toughest part. Again, I'll look into this later.

BTW, thanks for all this information.

--
Rick
 
Old 07-24-2014, 11:53 PM   #7
rnturn
Senior Member
 
Registered: Jan 2003
Location: Illinois (SW Chicago 'burbs)
Distribution: openSUSE, Raspbian, Slackware. Previous: MacOS, Red Hat, Coherent, Consensys SVR4.2, Tru64, Solaris
Posts: 2,831

Original Poster
Rep: Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550
Quote:
Originally Posted by David.V View Post
File Expert HD has additional features to transfer files using samba, ftp and etc.
Thanks for that pointer. That got me to thinking of other options besides MTP...

I found that my phone has an option that allows file sharing via Samba. (I will assume that most Android phones -- mine is using Android 4.4.2 -- have such a a feature.) By enabling that I can access the phone's directory tree using my laptop connected over the local wireless network. I had to go into the "Networking and Connectivity" setup (in KDE's "Configure Desktop" screens) and configure the username and password using the account information that the phone shows you when you enable file sharing. I tried working through my browser but got nowhere with that. But Dolphin works quite well; just click on "Network -> Samba shares" and point to the phone's address on the wireless network. (Probably something like "smb://192.168.1.xxx" but, of course, it'll depend on the address range being used on the WiFi network at home, the coffee shop, etc.)

The MTP route might be something worth pursuing in the future but the Samba file sharing is working whereas MTP is not at the moment. And probably won't until I either upgrade or try recompiling a newer or tweaked version of the MTP library and probably applications, too, and that's not on my agenda this week. Plus I don't need to haul around yet another USB cable all the time; I just need to find a WiFi connection.

Thanks for the hints...

--
Rick
 
Old 07-25-2014, 02:31 PM   #8
David.V
LQ Newbie
 
Registered: Jul 2014
Location: USA
Distribution: Mint 17
Posts: 15

Rep: Reputation: Disabled
Quote:
Originally Posted by rnturn View Post
I found that my phone has an option that allows file sharing via Samba. (I will assume that most Android phones -- mine is using Android 4.4.2 -- have such a a feature.) By enabling that I can access the phone's directory tree using my laptop connected over the local wireless network.
Thanks for that tip.
 
Old 07-25-2014, 03:28 PM   #9
jefro
Moderator
 
Registered: Mar 2008
Posts: 22,052

Rep: Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632
"It also appears that the system is interpreting the phone as a CD-ROM -- it's showing up as "/dev/sr1" "

This has confused me. Wonder why?
 
Old 07-25-2014, 07:27 PM   #10
rnturn
Senior Member
 
Registered: Jan 2003
Location: Illinois (SW Chicago 'burbs)
Distribution: openSUSE, Raspbian, Slackware. Previous: MacOS, Red Hat, Coherent, Consensys SVR4.2, Tru64, Solaris
Posts: 2,831

Original Poster
Rep: Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550
Quote:
Originally Posted by jefro View Post
"It also appears that the system is interpreting the phone as a CD-ROM -- it's showing up as "/dev/sr1" "

This has confused me. Wonder why?
Puzzles me as well. Perhaps it's the system's way of protecting the device from accidental corruption when it's not sure what the device is. That's probably not what's really going on but it would be a nice fallback.

One of the developer READMEs I ran across mentioned people running into problems getting MTP access to work because some desktops may have automatic detection schemes set up that cause the device to be grabbed by 'gphoto' (using PTP) which then messes up any attempts to access the device as an MTP device. I haven't messed around with connecting cameras directly to my computers for a long time -- for me, it's easier to pull out the memory card and mount it as a 'vfat' filesystem -- so I'm not sure how the system sees a camera when it's attached. Files written onto the camera memory cards will almost never be recognized by the camera's "OS" so perhaps treating the device as a CD-ROM makes some sense in that situation. Of course, when KDE popped up the dialog about what I wanted to do with the newly detected device, I either ignored it or selected 'open with file manager'. And I only took the 'open with file manager' once because once I saw that the directory structure was not what I expected to see I didn't want to mess something up. I can't recall the exact conditions and how I responded to the KDE popup when the system was seeing the phone as a CD-ROM.

Also from my README reading: Some of the developers seem to believe that there are still plenty of devices being released on the market that employ some of the not-so standard MTP features that were used by a certain operating system vendor. I can easily imagine the development team at a large electronics vendor choosing to follow an old spec that included some of those proprietary "features" either out of familiarity or laziness ("The new vendor-agnostic spec doesn't include Nifty Feature 1.1 and we don't have time to reinvent/debug it using the new library calls so let's use the old one.")

Thank goodness for Samba is all I can say.

--
Rick
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
On slack-current: /usr/bin/mtp-getfile -> /tmp/package-libmtp/usr/bin/mtp-connect ? LuckyCyborg Slackware 3 05-03-2010 01:13 PM
Accessing devices from udev Jzarecta Linux - Hardware 4 07-11-2007 07:25 PM
MTP Devices in VMware jkfff Linux - Hardware 4 01-17-2007 10:44 PM
Accessing v4l devices from PHP Napalm Llama Programming 13 02-06-2006 01:28 PM
Accessing usb devices 1madstork Slackware 2 10-28-2004 02:04 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:19 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration