LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   General (https://www.linuxquestions.org/questions/general-10/)
-   -   Connect Android Phone to Linux (Ubuntu) (https://www.linuxquestions.org/questions/general-10/connect-android-phone-to-linux-ubuntu-947164/)

future_computer 05-27-2012 08:29 PM

Connect Android Phone to Linux (Ubuntu)
 
I have a Sony Xperia S phone, running Android 2.3,
it has only internal memory 32GB.
When I plug the usb cable between the phone and my PC (ubuntu),
the file manager does not detect its memory.

In Windows, MTP driver is needed,
how about Linux?
What can I do?

Peacedog 05-27-2012 08:44 PM

Hi future_computer, Welcome to LQ. When you plug the phone into the pc it should ask you which mode, charge only, disk mode, or Sync. If it isn't asking you, goe into settings, Connect to PC, and change the default connection type there.

Good luck. ;-)

future_computer 05-27-2012 08:52 PM

In the phone setting, I set it as "storage" under the option USB connection mode.
But it does not work.

frankbell 05-27-2012 08:53 PM

In my Android (HTC T-Mobile MyTouch 3G), it connects by default as "charge only" and that message is reflected in the message in the notification panel.

I can touch the notification message and get options to mount it as a disk drive, to tether, and something else I forget. If I select, disk drive, it unmounts the SD card from the phone, making it available to the computer. When I'm done with it, I unmount the drive from my computer, then change the connection type on the phone.

My previous phone (HTC T-Mobile G-1) acted in a slightly different, but similar fashion.

I did look at the manual (http://www-support-downloads.sonymob...261-9418.1.pdf) and there is no mention of Linux.

Peacedog 05-27-2012 09:14 PM

If you continue to have trouble connecting via usb you can set up a samba share on your pc, install astro with the smb module or some similar file manager on the device and just manage it over the network. You can copy data from the device to the share that way.

Good luck. ;-)

future_computer 05-27-2012 09:53 PM

In Windows, it does not work also,
I do not know why?
First time I installed Sony PC Companion in Windows,
connected the phone and it worked.
But later on, the windows trying to install MTP driver, prompted me that it failed,
and device not mounted.

future_computer 05-27-2012 10:25 PM

Quote:

Few days ago I was installing Motorola Milestone 2 mobile phone drivers and there was an MTP USB Device that kept refusing to install properly.

After a quick Google search I found a "e;solution"e; — select MTP USB device in Device Manager, select Update driver, then manually select USB Mass Storage. Without those steps PC refused to mount the phone storage even though it was in USB Storage Mode.

Unfortunately, that doesn't fix the problem permanently because as soon as you unplug/replug the phone it will again try to install the MTP USB Device and it will, of course, fail miserably.

I traced it down to a file C:\WINDOWS\INF\wpdmtp.inf. After removing it, Windows no longer tries to install MTP USB device but installs regular mass storage. Keep in mind that this is a dangerous workaround so be sure to backup the file if you decide to try it.
Advise from somebody.

Peacedog 05-28-2012 12:15 AM

I'm not sure what you're trying to do here. Are you trying to connect to Linux or Windows or both?

Good luck. ;-)

future_computer 05-28-2012 03:17 AM

I want to connect to Windows as well as Linux.
Usually Linux can auto detect the phone's internal memory, but this time it does not!

future_computer 05-28-2012 11:29 AM

My problem is still unsolved.

frankbell 05-28-2012 08:23 PM

I can't help with the Windows aspect; Sony might be your best source of assistance on that.

I do have an idea about the Linux side.

Connect up the phone, the run the dmesg command in a terminal. (you might have to run it as root to get adequate results). Then inspect the output for the part regarding the phone; there will be quite a bit of output, so it will take some looking, but it should be towards the end.

Post the relevant output here. It might help clarify the situation.

I would not suggest the lsusb command because it won't return enough information about whether and, if so, how the computer is seeing the phone's file system.

future_computer 05-29-2012 12:40 AM

ok, will try to do it.

baldy3105 05-29-2012 04:20 PM

Some phones do not allow mounting of the phones storage as a USB mass storage device. You may need to root the phone and install a work around.

An alternative would be to use something like airdroid which allows access via a mini web server on your phone.

frankbell 05-29-2012 06:58 PM

I do recall that the Sony website said that there was special Sony software for connecting to Windows.

Sony does not have the best record for openness in the software world. I would not be surprised to find that they have locked this phone down.

An Android phone that cannot mount to a Linux computer would be quite the crime against nature.

Peacedog 05-30-2012 10:03 PM

Looks like you'll need libmtp to get this working. There is more information here.

http://forum.xda-developers.com/show...t=mount+ubuntu

Good luck. ;-)

future_computer 05-31-2012 12:25 AM

Thank you

future_computer 06-14-2012 10:23 AM

yplim@yplim-Inspiron-N5110:~$ lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 001 Device 003: ID 8086:0189 Intel Corp.
Bus 001 Device 004: ID 1bcf:2880 Sunplus Innovation Technology Inc.
Bus 002 Device 003: ID 1d57:32da
Bus 003 Device 005: ID 0fce:4169 Sony Ericsson Mobile Communications AB

Nautilus does not detect the phone internal memory.

Peacedog 06-16-2012 09:46 AM

Can you access the sd card? I'm not sure but, you may need the Android SDK which includes ADB to access the internal memory.

Good Luck. ;-)

maksimov 06-20-2012 04:52 AM

AFAIR MTP is the new thing since ICS (?), and before that Linux was always detecting the device as a USB Mass Storage. However, since ICS the "default mode" is now always MTP, which Linux cannot understand without the drivers.

Whereas MTP worked flawlessly for me on Windows 7 (I use it for games only :P), on Linux you can use the old method of connecting as a mass storage, it's a little more tedious but still:
  1. Before connecting your phone, go to (phone's) Settings -> More... -> USB Utilities -> Connect storage to PC
  2. When a dialog "Connect USB cable to use mass storage" has appeared, connect your cable
  3. The USB-Android will appear saying "USB connected", click "Turn on USB storage"
  4. Next dialog warns you about some applications that may stop as a result, click "OK".

Note: I'm using Squeeze with SGS2

future_computer 07-18-2012 10:17 AM

after doing Factory Reset,
it is ok now. Easy to connect to Windows 7.

frankbell 07-18-2012 09:48 PM

Thanks for the update.

dodghz 12-05-2012 04:23 AM

Disable USB debugging
 
Hi there
At the top of the phone, you'll hopefully see a bar with the USB symbol. Pull this bar down and disable USB debugging. Or alternatively, Settings | Applications | Development | then untick USB debugging.

When connected via the USB cable, Ubuntu will automatically mount the SDcard (or at least it does for me running Ubuntu 12.04 Desktop).

Good luck.

sundialsvcs 12-11-2012 08:52 AM

If your phone's like mine, the computer does not see it or recognize it until the device is put into sharing mode. Apparently it can emulate several different very-different device types, so it doesn't announce its presence on the bus at all until you put it into one of those modes. Doesn't matter what operating system you're using on the host.

commandguru 12-17-2012 05:22 PM

@ future_computer

Install Airdroid from google play. It allows you to transfer files between phone and PC and vice versa via a web browser. You can access both internal and external storage. No need to worry about MTP, USB mass storage or operating systems issues.

Demo
http://www.youtube.com/watch?v=WfNnQxpw7Uw

sonhadorpr 01-01-2013 11:30 PM

Cannot connect Android
 
I get this error msg when trying to connect Android 4.1.1 Samsung SGH-T999 (Galaxy S3):

Unable to mount SAMSUNG_Android_SGH_T999

Error initializing camera: -60: Could not lock the device

The 2 Nautilus windows come up, I can see the folders inside, but no files INSIDE those folders.

I also tried CTRL-H or view hidden files; and still, no files.

This is when the settings on the phone are in MTP.
When I change it to Camera (PTP), I can see the folders, I can see the pictures inside the DCIM folder, but no more files, no music, no text files, no anything.

I also get the same error msg as before.
I never had a problem with previuos Android phones, on Ubuntu, and the problem IS NOT only in Ubuntu...also tried Linux Mint 12, and Mandriva...same problem. No problem connecting to Windows & Mac, just Linux and this Galaxy SIII.

I also do not understand that the system asks me to Open Rythmbox Music Player. When I do this, the music player opens, but no music is found.

So, what am I doing wrong?

Thank You!!
Please see a screenshot @ http://mate.uprh.edu/~romici/Screenshot.png


All times are GMT -5. The time now is 07:17 AM.