Cannot connect Samsung Galaxy S3 (Android 4) via USB cable

I’ve been trying to get this working for days, but it seems to be a more difficult issue than I imagined. I have a Samsung Galaxy S3 smartphone, which I frequently connect to my computer for file transfers in Windows. Unfortunately, some Android developers were dumb and removed the Mass Storage option from version 4.0 of Android. It can only be connected through MTP (Media Transfer Protocol) and PTP (for digital cameras). While in Windows 7 I have no problem with either mode, neither will connect on OpenSuse 12.2 64bit (KDE 4.8.5).

I firstly tried MTP which is the default. Once I plug my device into an USB port, the notifier pops up and informs me a new device has been connected (Portable Media Player). If I click to open it with Dolphin, I’m taken to the camera:/ page. The full path where my device gets mounted is camera:/Samsung GT-P7310/P7510/N7000/I9100/Galaxy Tab 7.7/10.1/S2/Nexus/Note@usb:001,010/ which IMO indicates a problem by itself. The last folder there is empty and cannot be accessed, where I later noticed that Dolphin prints the message “The process for the camera protocol died unexpectedly”.

I tried PTP mode too, which also mounts the device in camera:/ (the notifier now calls it Camera). This time the device is partly accessible, but only a few files and folders are visible from everything contained in the storage. The location this time is camera:/USB PTP Class Camera@usb:001,014/store_00010001/ for the internal memory and camera:/USB PTP Class Camera@usb:001,014/store_00020002/ for the micro-SD card (I think). The first path is the one that’s partly readable, while the second is displayed as an empty folder.

As MTP is the right way, I googled more information as to how this can be worked around. Several pages suggested I upgrade libmtp9 to version 1.1.4 since it supposedly added support for the S3 (compared to 1.1.3 distributed with OpenSuse), but that didn’t change anything. I also installed mtpfs and mtp-tools, but it hasn’t resolved the problem either. Someone else said to use mtpfs in the console, which I also did. It once again notices the device, but it fails connecting to it after a minute with an error. Here is my output:

mircea@linux-qz0r:~> mtpfs
Listing raw device(s)
Device 0 (VID=04e8 and PID=6860) is a Samsung GT P7310/P7510/N7000/I9070/I9100/I9300 Galaxy Tab 7.7/10.1/S2/S3/Nexus/Note/Y.
   Found 1 device(s):
   Samsung: GT P7310/P7510/N7000/I9070/I9100/I9300 Galaxy Tab 7.7/10.1/S2/S3/Nexus/Note/Y (04e8:6860) @ bus 1, dev 15
Attempting to connect device
PTP_ERROR_IO: failed to open session, trying again after resetting USB interface
LIBMTP libusb: Attempt to reset device
Listing File Information on Device with name: GT-I9300
fuse: missing mountpoint parameter
mircea@linux-qz0r:~>

Does anyone else have the S3 (or any Android 4 device with the same structure) and can explain what to do to get the S3 connecting properly via MTP?

Hi
Look at using jmtps, you will need to create the udev rule to add in as
by default I just used my ASUS TF101.

Package is here;
http://software.opensuse.org/package/jmtpfs?search_term=jmtpfs


Cheers Malcolm °¿° (Linux Counter #276890)
openSUSE 12.2 (x86_64) Kernel 3.4.6-2.10-desktop
up 1 day 1:12, 4 users, load average: 0.23, 0.20, 0.15
CPU Intel i5 CPU M520@2.40GHz | Intel Arrandale GPU

Won’t work either. I installed jmtpfs_x64, plugged in the device, and typed jmtpfs in the console. Just like the others, it waits for a few minutes, then says it can’t connect / resetting the device / etc. Here is the output:

mircea@linux-qz0r:~> jmtpfs
Device 0 (VID=04e8 and PID=6860) is a Samsung GT P7310/P7510/N7000/I9070/I9100/I9300 Galaxy Tab 7.7/10.1/S2/S3/Nexus/Note/Y.
PTP_ERROR_IO: failed to open session, trying again after resetting USB interface
LIBMTP libusb: Attempt to reset device
LIBMTP PANIC: failed to open session on second attempt
terminate called after throwing an instance of 'MtpErrorCantOpenDevice'
  what():  Can't open device
Aborted
mircea@linux-qz0r:~>

Is it because I didn’t add the udev rule, or would that part come after the device can connect? No idea what udev is and how you add rules to it… I hope it doesn’t require hacking anything since I’m still new and don’t wanna mess with advanced stuff.

Hi
That’s because it needs a udev rule :wink:

Can you plug the device in and then run the command dmesg, then post
the output for your device (in code tags), which should be the last
~10 entries. I can then add a udev rule to my package and update for
you.

Once you have the updated package, you need to mount like;


mkdir ~/galaxy
jmtpfs -o allow_other ~/galaxy

To unmount use;
fusermount -u ~/galaxy

There is a man page, use man jmtpfs :wink:


Cheers Malcolm °¿° (Linux Counter #276890)
openSUSE 12.2 (x86_64) Kernel 3.4.6-2.10-desktop
up 1 day 3:18, 4 users, load average: 0.14, 0.11, 0.10
CPU Intel i5 CPU M520@2.40GHz | Intel Arrandale GPU

Hmmm. Just to be clear, does that mean adding the model of my device into that package to implement it in the FS (if you’re the developer of jmtpfs), or are you customizing a package copy to work with my specific device (and its unique serial)? If it’s the second, I don’t wanna permanently depend on a hacked application to connect my phone, although temporarily it can work. Eventually I need to find a proper and stable way to get it connecting if this works. Anyway, here’s that dmesg part:

[35518.279212] usb 1-1.4.1: new high-speed USB device number 17 using ehci_hcd
[35518.357577] usb 1-1.4.1: New USB device found, idVendor=04e8, idProduct=6860
[35518.357582] usb 1-1.4.1: New USB device strings: Mfr=2, Product=3, SerialNumber=4
[35518.357585] usb 1-1.4.1: Product: SAMSUNG_Android
[35518.357588] usb 1-1.4.1: Manufacturer: SAMSUNG
[35518.357590] usb 1-1.4.1: SerialNumber: 4df0f886586249b7

Hi
Correct, it’s just the vendor and product id, and no it’s not a hack,
udev needs those two ‘common’ numbers in the rule to identify the
device. No serial numbers involved :wink: I’m just the packager, if there
are issues, I will push them upstream…

udev is the proper and correct way, but if it can’t identify, hence the
vendor and product id’s are required.

There is an updated package on the build service, please try it out and
report back :slight_smile:

Cheers Malcolm °¿° (Linux Counter #276890)
openSUSE 12.2 (x86_64) Kernel 3.4.6-2.10-desktop
up 1 day 8:43, 4 users, load average: 0.15, 0.11, 0.06
CPU Intel i5 CPU M520@2.40GHz | Intel Arrandale GPU

Did you mean to update udev or jmtpfs? I updated jmtpfs from the link you first posted but same issue.

mircea@linux-qz0r:~> jmtpfs
Device 0 (VID=04e8 and PID=6860) is a Samsung GT P7310/P7510/N7000/I9070/I9100/I9300 Galaxy Tab 7.7/10.1/S2/S3/Nexus/Note/Y.
PTP_ERROR_IO: failed to open session, trying again after resetting USB interface
LIBMTP libusb: Attempt to reset device
LIBMTP PANIC: failed to open session on second attempt
terminate called after throwing an instance of 'MtpErrorCantOpenDevice'
  what():  Can't open device
Aborted
mircea@linux-qz0r:~>

udev doesn’t have an update available in the official repositories, so I imagine I need to update that from somewhere else? I’m not good with this yet so it would help mentioning links and what to do exactly. Also hope it’s safe for the system to change such components.

Hi
No only jmtpfs needed updating, can you check the contents of the rules
file;


cat /lib/udev/rules.d/51-android.rules

It should have your device listed?

If it does, can you run the following command (as root user) and then
plug in your device;


udevadm monitor

You should see something like;


udevadm monitor
monitor will print the received events for:
UDEV - the event which udev sends out after rule processing
KERNEL - the kernel uevent

KERNEL[167318.061919] add      /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2 (usb)
... more output

If you don’t can you post the output seen.


Cheers Malcolm °¿° (Linux Counter #276890)
openSUSE 12.2 (x86_64) Kernel 3.4.6-2.10-desktop
up 1 day 22:40, 5 users, load average: 0.31, 0.13, 0.11
CPU Intel i5 CPU M520@2.40GHz | Intel Arrandale GPU

Sure. Here’s the content for that rules file:

mircea@linux-qz0r:~> cat /lib/udev/rules.d/51-android.rules
# Android devices - UDEV Rule

# For ASUS Transformer TF101
SUBSYSTEM=="usb", ATTRS{idVendor}=="0b05", ATTRS{idProduct}=="4e0f", SYMLINK+="libmtp-%k", MODE="0666", GROUP="users"
# For Samsung GT
SUBSYSTEM=="usb", ATTRS{idVendor}=="04e8", ATTRS{idProduct}=="6860", SYMLINK+="libmtp-%k", MODE="0666", GROUP="users"

RUN+="udev-acl --action=$env{action} --device=$env{DEVNAME}"mircea@linux-qz0r:~>

As for udevadm monitor, here’s what I get after writing that and plugging in my device. It simply says that first then the application remains stuck:

linux-qz0r:/home/mircea # udevadm monitor
monitor will print the received events for:
UDEV - the event which udev sends out after rule processing
KERNEL - the kernel uevent

KERNEL[97947.872111] add      /devices/pci0000:00/0000:00:1a.7/usb1/1-1/1-1.4/1-1.4.1 (usb)
KERNEL[97947.872480] add      /devices/pci0000:00/0000:00:1a.7/usb1/1-1/1-1.4/1-1.4.1/1-1.4.1:1.0 (usb)
UDEV  [97947.910908] add      /devices/pci0000:00/0000:00:1a.7/usb1/1-1/1-1.4/1-1.4.1 (usb)
UDEV  [97947.912231] add      /devices/pci0000:00/0000:00:1a.7/usb1/1-1/1-1.4/1-1.4.1/1-1.4.1:1.0 (usb)

Hi
OK, can you run the following command;


udevadm trigger

Then plug the device in and try mounting via jmtpfs.

If it still doesn’t work, can you try running the usb mode switch command as
root user after it’s plugged in, also check dmesg output afterwards…


usb_modeswitch -v 04e8 -p 6860


Cheers Malcolm °¿° (Linux Counter #276890)
openSUSE 12.2 (x86_64) Kernel 3.4.6-2.10-desktop
up 2 days 2:25, 5 users, load average: 0.06, 0.07, 0.06
CPU Intel i5 CPU M520@2.40GHz | Intel Arrandale GPU

udevadm trigger didn’t print or change anything. Here’s the usb mode switch output, which from what I understand was successful:

linux-qz0r:/home/mircea # usb_modeswitch -v 04e8 -p 6860

Looking for default devices ...
   found matching product ID
   adding device
 Found device in default mode, class or configuration (1)
Accessing device 022 on bus 001 ...
Getting the current device configuration ...
 OK, got current device configuration (2)
Using first interface: 0x00
Using endpoints 0x01 (out) and 0x82 (in)
Not a storage device, skipping SCSI inquiry

USB description data (for identification)
-------------------------
Manufacturer: SAMSUNG
     Product: SAMSUNG_Android
  Serial No.: 4df0f886586249b7
-------------------------
Warning: no switching method given.
-> Run lsusb to note any changes. Bye.

linux-qz0r:/home/mircea # 

Here’s the dmesg part about my device after that command:

[111975.856501] usb 1-1.4.1: new high-speed USB device number 22 using ehci_hcd
[111975.932752] usb 1-1.4.1: New USB device found, idVendor=04e8, idProduct=6860
[111975.932757] usb 1-1.4.1: New USB device strings: Mfr=2, Product=3, SerialNumber=4
[111975.932760] usb 1-1.4.1: Product: SAMSUNG_Android
[111975.932763] usb 1-1.4.1: Manufacturer: SAMSUNG
[111975.932765] usb 1-1.4.1: SerialNumber: 4df0f886586249b7

Hi
Are there any phone settings (usb utilities) you can apply to set it as
mass storage, or is it already set?


Cheers Malcolm °¿° (Linux Counter #276890)
openSUSE 12.2 (x86_64) Kernel 3.4.6-2.10-desktop
up 2 days 4:08, 5 users, load average: 0.21, 0.14, 0.14
CPU Intel i5 CPU M520@2.40GHz | Intel Arrandale GPU

It can’t be set to Mass Storage mode, it can only connect through MTP and PTP. But yes, through MTP it’s for connecting the storage and transferring files. Only other setting is the one for USB Debugging, but I don’t think it changes anything (but I can enable it if you suspect it does). There’s also one to Allow Mock Locations in the same menu, but I don’t know if it’s related to this.

Hi
My ASUS Transformer is running 4.1.1 (Jellybean) and has the same
settings, you could try enabling debug and see if that makes a
difference. But all I needed to do was add the rule and run the trigger
command and all was fine…


Cheers Malcolm °¿° (Linux Counter #276890)
openSUSE 12.2 (x86_64) Kernel 3.4.6-2.10-desktop
up 2 days 7:02, 5 users, load average: 0.00, 0.01, 0.05
CPU Intel i5 CPU M520@2.40GHz | Intel Arrandale GPU

@MirceaKitsune: With the USB mass storage access gone, some developers (XDA) have come up with an standalone application which provides the popular UMS access to the MicroSD card:

Enable USB Mass Storage Option In Samsung Galaxy S3 [How To]

I hope this option works for you.

I enabled USB Debugging and Allow Mock Locations to be sure, same thing. What else do I try?

I seen that, but it requires my device to be rooted. I’m still using the original firmware and don’t plan on rooting it for now.

Did anybody mention “Airdroid”? It’s a free app, that makes the data on a phone available through http(s) access. I gave it a try because I couldn’t find the cable (kids), thought there might be an app for accessing data on the phone, gave it a search and found this one.

Yes, it seems like a useful app. I decided against mentioning it, as the OP seems to want file-system access solution via USB. While searching numerous threads discussing this topic, it seems to me that there are a lot of users who have abandoned MTP for now, in favour of using alternative connectivity like this. :slight_smile:

I hesitated, and did not post yesterday for the same reason. But sometimes a temporary workaround can take the pressure off. I can recall lots of situations where “getting it to work” was the #1 priority, doing so buys you time to take a good, relaxed look at things, maybe start from the beginning.

…sometimes a temporary workaround can take the pressure off. I can recall lots of situations where “getting it to work” was the #1 priority, doing so buys you time to take a good, relaxed look at things, maybe start from the beginning.

Very true - alternative solutions and workarounds are better than no solution at all