Pages

Friday, November 14, 2014

Ubuntu-Connect an Android device using MTP in Ubuntu 14.04 LTS

After Much of Fiddle I was able to connect my ASUS Zenfhone 5 to my ubuntu via MTP Here is How..

1. First we need to install some MTP Apps so run the following command

 sudo apt-get install libmtp-common mtp-tools libmtp-dev libmtp-runtime libmtp9  

Then run

 sudo apt-get dist-upgrade  

2. Then we're going to amend the fuse.conf file. FUSE is an application that aims to provide a secure method for non privileged users to create and mount their own file system implementations.

Run the following command

 sudo nano /etc/fuse.conf  

You will get following lines remove # before last line which allows other users to mount their own file systems

 # /etc/fuse.conf - Configuration file for Filesystem in Userspace (FUSE)  
 # Set the maximum number of FUSE mounts allowed to non-root users.  
 # The default is 1000.  
 #mount_max = 1000  
 # Allow non-root users to specify the allow_other or allow_root mount options.  
 user_allow_other  

3. Now connect your device using MTP option and run following command
 lsusb  
You will get a list as follows
 Bus 002 Device 007: ID 413c:8160 Dell Computer Corp. Wireless 365 Bluetooth  
 Bus 002 Device 005: ID 413c:8162 Dell Computer Corp. Integrated Touchpad [Synaptics]  
 Bus 002 Device 004: ID 413c:8161 Dell Computer Corp. Integrated Keyboard  
 Bus 002 Device 003: ID 0a5c:4500 Broadcom Corp. BCM2046B1 USB 2.0 Hub (part of BCM2046 Bluetooth)  
 Bus 002 Device 002: ID 8087:0020 Intel Corp. Integrated Rate Matching Hub  
 Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub  
 Bus 001 Device 006: ID 0b05:5480 ASUSTek Computer, Inc.   
 Bus 001 Device 002: ID 8087:0020 Intel Corp. Integrated Rate Matching Hub  
 Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub  

I find the only device connected to my system of name  ASUSTek Computer is my ASUS mobile we need two parts from above line

0b05:5480

Make a note of these and now we will add these to another rules file

4. Run following command

sudo nano /lib/udev/rules.d/69-mtp.rules

Now add the following lines to the file see the idProduct and idVendor we have added change it in accordance with your device

# ASUSTek Computer, Inc.
ATTR{idVendor}=="0b05", ATTR{idProduct}=="5480", SYMLINK+="libmtp-%k", ENV{ID_MTP_DEVICE}="1", ENV{ID_MEDIA_PLAYER}="1"

5. Now we need to add this information to another rules file

sudo nano /etc/udev/rules.d/51-android.rules
 
Now add the following lines to the open file
 ATTR{idVendor}=="0b05", ATTR{idProduct}=="5480", MODE=”0666"  

Remember to add correct idVendor and idProduct

6. Restart the service
 sudo service udev restart  

7. Reboot Device

 sudo reboot

That's It

4 comments:

  1. follow all the steps, but when I connect the zenfone 5, ubuntu shows a screen stating the following error

    Can not mount Android
    No MTP device found

    ReplyDelete
  2. is your device unlocked at the time of connecting

    ReplyDelete
  3. I have an Asus Zenfone 5 running Android 4.4.2. I edited /etc/fuse.conf but lsusb still doesnt detect my device. Interesting thing is my phone was mounting fine in Ubuntu 14.04.02(after several upgrades from the initial release) but this problem started only after I installed 14.04.02 from a live USB.

    ReplyDelete