SEARCH

Enter your search query in the box above ^, or use the forum search tool.

You are not logged in.

#1 2013-10-20 20:56:49

damo
#! gimpbanger
From: N51.5 W002.8 (mostly)
Registered: 2011-11-24
Posts: 5,434

HowTo: Connect to an Android 4 phone

How to access an Android 4 phone

It now takes a lot of fiddling to get this to work due to changes to the Media Device(MTP) file system protocol with usb connections. See this post for example. I have found several ways to access a Samsung Galaxy Note - in order of difficulty (for me!) these are:

Method 1 with USB

apt-get install gphotofs
mkdir ~/android-device # or any other place with user permissions

Connect the phone, and in usb settings choose "Connect as Camera(PTP)"
connect-as-2.png

gphotofs ~/android-device

The media folders can now be displayed in thunar.

Before disconnecting, close the file browser and

fusermount -u ~/android-device

(EDIT: typo correction)
Weirdly I have found that sometimes the whole android filesystem is accessible by choosing "Connect as Media device(MTP)".
connect-as.png
After a long delay a pop-up may say your pc doesn't have the correct software to display files, but then it mounts itself (on /dev/sdb in my case).
connect-warning.png
This has occurred whether PTP or MTP have been selected, which isn't supposed to happen! fusermount -u may not work then so

umount -l /dev/sdb

If you are lucky enough for this to happen, then you won't need to do the next method....

Method 2 with USB

Instead of using mtpfs to access an MTP filesystem, use the go-mtpfs library which simplifies everything

Install go-mtpfs, using a method found here: http://novaspirit.com/blog/?p=121

	sudo apt-get install golang fuse git-core libmtp-dev libfuse-dev
	sudo adduser $USER fuse
	mkdir ~/tmp/go
	export GOPATH=~/tmp/go
	go get github.com/hanwen/go-mtpfs
	sudo mv ~/tmp/go/bin/go-mtpfs /usr/bin
	mkdir ~/android-device

Now, go-mtpfs is installed. To mount your android device run

	go-mtpfs ~/android-device & 

   
Contents of your phone can be found at ~/android-device folder in your home directory.
To unmount run these commands

fusermount -u ~/android-device

If this doesn't work due to a "filesystem busy etc" message, then umount it

To make it even more simple you can add aliases to your .bashrc file

	alias android-on='go-mtpfs ~/android-device &'
	alias android-off='fusermount -u ~/android-device'

I have found that trying to remount, with the same instance of Thunar open, sometimes results in failure. The mount command shows

Locked(DeviceFs(GT-N on /home/damo/android-device type fuse....)

I get round it with

umount -l /home/damo/android-device

and restarting Thunar

These inconsistencies are frustrating, but I find a direct usb connection is easier than the other options.

Method 3 with a web app using wifi or tethering
eg AirDroid
airdroid-th.png

Description
Your Android, on the Web
AirDroid is a free and fast app that helps you manage your Android from a desk web browser, all over the air.

AirDroid philosophy:
※ One less cable.
Move things on and off your Android device without a USB cable. Even when the device is not nearby.
※ One less screen.
Send and receive SMS from your big-screen computer, without being distracted by the small-screen thing.
※ One less worry.
Locate and lock your Android when it’s lost. Cannot get it back? Simply wipe all data remotely.

Pros: Good interface, easy to use, works well, log in via google/facebook etc if you want (option to stay logged in for an extended period)
Cons: Image galleries load slowly and it takes ages if multiple files need selecting; needs wifi connected

(Watch the camera view remotely, so you can get a screenshot of the sh** who has just stolen your phone big_smile )

Method 4 with SSH/FTP

Works fine if you know your way around that stuff, and know the username and password for the phone.

I have tried AndFTP

Description
AndFTP is a FTP, FTPS, SCP, SFTP client. It can manage several FTP configurations. It comes with both device and FTP file browser. It provides download, upload, synchronization and share features with resume support. It can open (local/remote), rename, delete, update permissions (chmod), run custom commands and more. SSH RSA/DSA keys support. Share from gallery is available. Intents are available for third party applications. SCP and folder synchronization are available in Pro version only.

andFTP.png

[I haven't spent any time investigating the oddities, and I haven't used ftp/ssh much, so if anyone can shed any light on these, we can add them to the HowTo.....]

Hope this is useful smile

Last edited by damo (2014-02-07 00:28:14)


BunsenLabs Group on deviantArt
damo's gallery on deviantArt
Openbox themes
Forum Moderator smile

Offline

Be excellent to each other!

#2 2013-10-22 21:10:07

Diet
#! Member
From: /home/basement
Registered: 2013-09-01
Posts: 53

Re: HowTo: Connect to an Android 4 phone

Thanks for taking the time to type this up, I'm sure it will be useful in the future when I finally get around to rooting my phone  big_smile


I've not failed, I've just found a thousand ways that don't work.

Offline

#3 2013-10-22 21:29:44

el_koraco
#!/loony/bun
From: inside Ed
Registered: 2011-07-25
Posts: 4,749

Re: HowTo: Connect to an Android 4 phone

Since Gnome 3.8, there's gvfs-mtp, which works without a hitch. I think you can just install this from unstable or whatever.

Offline

#4 2013-10-23 19:39:48

xero
#! Junkie
From: 0x000000
Registered: 2013-09-30
Posts: 382
Website

Re: HowTo: Connect to an Android 4 phone

i have a samsung gs3 running cyanogenmod 10.1.3

when i set my phone into mobile hot spot, enable usb storage, and connect to it, #! automounts my phone just like a usb drive.


▬▬ι═════════-
dotfiles http://git.io/.files

Offline

#5 2013-10-23 20:28:04

damo
#! gimpbanger
From: N51.5 W002.8 (mostly)
Registered: 2011-11-24
Posts: 5,434

Re: HowTo: Connect to an Android 4 phone

@xero

That's good - newer Android? more recent #!?

I started all this so my 82 yr old mother could get the photos off her smartphone onto her crunchbang/xfce laptop with the minimum of hassle. Her previous phone and camera would plug'n'play on Mint, now she clicks a launcher that runs a script to mount and d/l stuff. I'm not willing to try the latest android/testing repos on her hardware, and risk it becoming unusable!


BunsenLabs Group on deviantArt
damo's gallery on deviantArt
Openbox themes
Forum Moderator smile

Offline

#6 2013-10-23 20:40:22

xero
#! Junkie
From: 0x000000
Registered: 2013-09-30
Posts: 382
Website

Re: HowTo: Connect to an Android 4 phone

@damo
my cm rom is based on android 4.2.2
and i'm using #! waldorf

maybe it's a cm aftermarket feature, but idk

Last edited by xero (2013-10-23 20:40:35)


▬▬ι═════════-
dotfiles http://git.io/.files

Offline

#7 2013-10-24 22:23:41

RRrp
Member
Registered: 2013-10-20
Posts: 12

Re: HowTo: Connect to an Android 4 phone

Thanks for the help. Access aquired.  smile

Offline

#8 2013-12-02 03:18:03

superwow
#! Member
From: rlyeh
Registered: 2013-08-23
Posts: 59

Re: HowTo: Connect to an Android 4 phone

Thanks for the tutorial. I have a question.

Using the first method above allows me to view my MotoX's photos. I was able to import the photos using Shotwell (veeerrrry slowly, for some reason). However, when I tried to unmount using 'fusermount -u gphotofs', I got unexpected results. A message was returned:

entry for /home/superwow/gphotofs not found in /etc/mtab

Umount -l /dev/sdb showed I had mounted several tmpfs (temp file systems I think, which should be Android). Lsusb showed I was attached to sda mountpoints, and several tmp folders.

I tried to troubleshoot and then left the computer for a couple of hours to run errands. It was not plugged in and shut itself down when the battery ran down. Reconnecting to power, rebooting the computer, and trying to access the drive again by repeating the steps, I get

superwow@rlyeh:~$ gphotofs ~/MotoX_gfilesystem
fusermount: failed to access mountpoint /home/superwow/MotoX_gfilesystem: Permission denied

Has shutdown and inappropriate unmounting borked my gphotofs? How to fix it?

Offline

#9 2014-02-06 23:37:48

Rasputin
New Member
Registered: 2013-11-14
Posts: 2

Re: HowTo: Connect to an Android 4 phone

First off - thanks for the tutorial - it really helped.

Superwow - I had the same error as you. Turns out, the fusermount example in the tutorial is mistaken - the syntax should be 'fusermount -u mount-point-name' and not 'fusermount -u gphotofs'. So I named my folder where I mounted my phone MOTO_G which means the fusermount unmount command in my case reads:

fusermount -u MOTO_G

hope this helps.

Offline

#10 2014-02-06 23:51:46

wmdiem
#! CrunchBanger
Registered: 2008-12-26
Posts: 187

Re: HowTo: Connect to an Android 4 phone

I haven't done it on 4.x but I use FTPServer.
Setup the server, make sure it is bound to your local wifi; (make sure that your wifi router isn't set to block client to client communications, most aren't but if things aren't working right, check this). If you need to get something from your phone to your computer, just start the sever on your phone, and use your favorite FTP client to browse your phone's files.
Easy peasy.

Offline

#11 2014-02-07 00:29:00

damo
#! gimpbanger
From: N51.5 W002.8 (mostly)
Registered: 2011-11-24
Posts: 5,434

Re: HowTo: Connect to an Android 4 phone

@rasputin

Good spot, corrected wink


BunsenLabs Group on deviantArt
damo's gallery on deviantArt
Openbox themes
Forum Moderator smile

Offline

#12 2014-02-26 03:35:59

neandergeek
New Member
Registered: 2012-02-20
Posts: 8

Re: HowTo: Connect to an Android 4 phone

Thanks for the tutorial Damo, it's been an enormous help. 

With a couple of hiccups I was able to get method 2, gomtpfs, working so access my Samsung Galaxy S4.  It wasn't absolutely essential since I use an rsync app to sync photos from my phone to a Raspberry Pi file server and to sync Oggcasts to the phone, but I wanted to be able to access files on my phone on my laptop anytime without booting to LinuxMint or something much worse from Redmond, Washington.

Running Waldorf 64bit with a 3.12 bpo kernel (after a reinstall over the past couple of days when I borked my system install other linux distros to an external USB 3.0 drive)

Hiccups

  1. I also had to install pkg-config to be able to execute the 'go get github.com/hanwen/go-mtpfs' command (you must have already had it installed and I didn't)

  2. 'go-mtpfs ~/android-device &' failed with an error saying I did not have permission to execute /bin/fusermount.  I had added myself to the fuse group and running addgroup again confirmed it.  sudo go-mtpfs worked so I tried rebooting after which it worked so something didn't recognize my being in the group after the addgroup command.

  3. After rebooting go-mtpfs ~/android-device gave an error from the phone even after unplugging and replugging.  Going into the usb menu on the phone setting it to connect as a camera then setting it back to connect as an MTP device worked.

Next I want to look at udev to see if I can have the system do the mount automatically when the phone is plugged in.

Thanks Again,
Richard

Offline

#13 2014-02-26 05:56:12

twoion
Emerald Caffeine
From: 星界
Registered: 2012-05-11
Posts: 1,648

Re: HowTo: Connect to an Android 4 phone

neandergeek wrote:

Hiccups

Nothing new for me as far as MTP is concerned, I have only had problems with MTP (random on/offs, ....) on my GT8730 and am tempted to equally blame it on the implementations on the phone and the client library.

I don't see what would justify MTP's existence if SSH via sshfs or a FTP client/ftpfs do the job much better. I even can use rsync again.


Tannhäuser ~ {www,pkg,ddl}.bunsenlabs.org/{gitlog,repoidx}

Offline

#14 2014-03-14 10:02:46

karamelos
Member
Registered: 2014-02-14
Posts: 16

Re: HowTo: Connect to an Android 4 phone

Hi Guys

I know that the thread is old but i need a few basic help.
I Own a Nexus 7 and i am trying to install go-mtpfs solution. But I have 2 problems

1:

karoto@Deadalus:/$ sudo apt-get install libmtp-dev
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 libmtp-dev : Depends: libusb-1.0-0-dev but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

If I execute

karoto@Deadalus:/$ sudo apt-get install libusb-1.0-0-dev
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 libusb-1.0-0-dev : Depends: libusb-1.0-0 (= 2:1.0.11-1) but 2:1.0.17-1+b1 is to be installed
E: Unable to correct problems, you have held broken packages.

2:

Did I missed something here? or.. ?

screenshot-03142014-020526pm.php

And thus I am not able to proceed to go get..

Last edited by karamelos (2014-03-14 10:07:36)

Offline

#15 2014-04-10 08:00:47

KrunchTime
#! Die Hard
From: not where I belong
Registered: 2012-03-02
Posts: 3,264

Re: HowTo: Connect to an Android 4 phone

Thanks for the great howto, damo.  I used method #2 this morning to successfully access my new Samsung Galaxy Note 10.1, 2014 Edition tablet under CrunchBang 11 to transfer a couple of files.  big_smile

04/11/2014 edit:  I was using the go-mtpfs method this morning and ran into instances where it wasn't reliable.  I would run the command to connect a device, open a file manager, and not see anything at all.

I also tried using bluetooth, but that didn't work at all, at least using the blueman app.

So, I did a bit of research on the web about using other forms of wireless transfer and came across an app called WiFi File Transfer Pro in the Google Play Store; $1.40 and it works great.

Last edited by KrunchTime (2014-04-11 13:50:31)


Linux User #586672
Come and Die -- Kyle Idleman

Offline

#16 2014-04-10 09:39:37

karamelos
Member
Registered: 2014-02-14
Posts: 16

Re: HowTo: Connect to an Android 4 phone

I am trying to make it work as MTP and not Camera.

but fail sad

karoto@Deadalus:~$ sudo apt-get install golang fuse git-core libmtp-dev libfuse-dev
[sudo] password for karoto: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
fuse is already the newest version.
fuse set to manually installed.
libfuse-dev is already the newest version.
git-core is already the newest version.
golang is already the newest version.
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 libmtp-dev : Depends: libusb-1.0-0-dev but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

Any Idea?

Offline

#17 2014-04-10 18:37:36

damo
#! gimpbanger
From: N51.5 W002.8 (mostly)
Registered: 2011-11-24
Posts: 5,434

Re: HowTo: Connect to an Android 4 phone

@karamelos

I suggest you start a new thread in Help&Support, with some more details of your system and what you have done so far. This isn't the place for problem-solving  wink


BunsenLabs Group on deviantArt
damo's gallery on deviantArt
Openbox themes
Forum Moderator smile

Offline

#18 2014-04-10 20:24:26

Joe90
#! Junkie
Registered: 2013-10-10
Posts: 337

Re: HowTo: Connect to an Android 4 phone

On stock Iceweasel not all features work with Airdroid, so try Chromium instead. On an HTC One found this method to be extremely quick and simple for upload and download

Offline

#19 2014-06-09 01:28:35

matthias2223
New Member
Registered: 2013-05-17
Posts: 2

Re: HowTo: Connect to an Android 4 phone

I have a Motorola Moto G Android Kitkat 4.4.3 and Method 2 worked flawlessly. Thanks for taking the time to make a this excellent tutorial!

Last edited by matthias2223 (2014-06-09 01:29:10)

Offline

#20 2014-06-09 04:57:05

camshron
#! Member
Registered: 2009-04-02
Posts: 58

Re: HowTo: Connect to an Android 4 phone

too many steps guys try this sudo apt-get install gmtp http://gmtp.sourceforge.net/ i just got my first smartphone (Motorola Moto G Android Kitkat 4.4.2) two weeks ago and i used this. it seems i had it already installed a long time ago in case a smartphone user needed my help. it transfers every file i throw at it and even drag and drop works and im on waldorf.

Offline

#21 2014-06-12 07:23:46

DapperMe17
#! CrunchBanger
From: Todd's Gang
Registered: 2012-10-19
Posts: 221

Re: HowTo: Connect to an Android 4 phone

Vx Connectbot http://connectbot.vx.sk/ for Android. Super easy install on Android, with SSH file transfer to/from your #! box.

Last edited by DapperMe17 (2014-06-12 07:24:26)

Offline

#22 2014-08-17 01:29:30

edps
Member
From: Rio de Janeiro, Brazil
Registered: 2012-05-19
Posts: 30
Website

Re: HowTo: Connect to an Android 4 phone

try jmtpfs:

https://edpsblog.wordpress.com/2014/08/ … no-debian/

good luck!

Last edited by edps (2015-03-29 20:58:44)

Offline

#23 2014-11-25 00:09:12

shapacko
New Member
Registered: 2014-11-20
Posts: 1

Re: HowTo: Connect to an Android 4 phone

jmtpfs worked flawlessly for me! thanks!

Offline

#24 2014-11-25 07:29:44

damo
#! gimpbanger
From: N51.5 W002.8 (mostly)
Registered: 2011-11-24
Posts: 5,434

Re: HowTo: Connect to an Android 4 phone

...or use PCManFM instead of Thunar, because mtp support is built in. I found it automatically mounted a phone filesystem.


BunsenLabs Group on deviantArt
damo's gallery on deviantArt
Openbox themes
Forum Moderator smile

Offline

Be excellent to each other!

#25 2014-11-25 07:36:25

damo
#! gimpbanger
From: N51.5 W002.8 (mostly)
Registered: 2011-11-24
Posts: 5,434

Re: HowTo: Connect to an Android 4 phone

shapacko wrote:

jmtpfs worked flawlessly for me! thanks!

But it's not in wheezy - you can get it from wheezy-backports though.


BunsenLabs Group on deviantArt
damo's gallery on deviantArt
Openbox themes
Forum Moderator smile

Offline

Board footer

Powered by FluxBB

Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.
Server: acrobat

Debian Logo