Fedora 32 KDE cant find phone

Get help for specific problems
Posts: 5
Joined: 30 Aug 2020

fev19

Hello,

I already used FFS on Windows with great success. Now I switched to Linux and cant sync my music folder on my Android phone anymore. I can access my phone with dolphin but I cant find it in FFS.

What I did before posting: I searched for solutions for 2 weeks. I ran FreeFileSync as sudo.
I updated my phone (Rom, Firmware) and Fedora KDE.
I already noticed that the screen on the phone must be on to get access with file explorer.

I found a week ago: viewtopic.php?t=6813&p=22674&hilit=kde#p22674

Details: Fedora 32 KDE Plasma
Xiaomi Mi 9T Pro with unoffical Lineage os 17.1
FFS 11 Linux version

I am still new to Linux but it would be great someone with more experience could show me the way to go.

Thanks,
Fev
Posts: 345
Joined: 7 Jan 2018

bgstack15

File managers like Dolphin (which is part of the whole KDE suite) tend to include advanced functionality like the abilities to view SMB (Samba: i.e., Windows network shares) or MTP (mobile devices) among other things. They could either use the low-level libraries like libsmb themselves or actually bundle the functionality into the file manager directly. These are neat features, but if the right libraries are not installed, and you do not mount the device/location as a filesystem on the kernel level, then other programs cannot access those items the same way.

By your coming here for help, I surmise that the location string in Dolphin was not merely a "/run/user/1000/android-29839183487" and instead was something like "mtp:///android-23828472/Internal Storage/". The protocol "mtp://" would be a good indicator that Dolphin is using its advanced functionality that is not extensible to other programs such as FreeFileSync.

So what you want to do is find a way to mount the mtp device (i.e., your phone) so that it is treated as a regular filesystem that any program will be able to use. One way to do this for MTP-connected devices is to use any of the various FUSE (Filesystem in USErspace; don't get bogged down in kernel space vs. userspace) tools that will mount the mtp device like it is a regular filesystem.

I have had success using jmtpfs on Devuan, and haven't validated it on Fedora, but Fedora 32 does have it. Another one to try would be simple-mtpfs. If you need specific guidance for either one, let me know here.

It is normal for an Android phone to allow USB access to itself only after you unlock the screen. It's a safety mechanism.
Posts: 5
Joined: 30 Aug 2020

fev19

thanks for your fast replay bgstack15.

Yes it looks like this : mtp:/Mi 9T Pro/Interner gemeinsamer Speicher/
I understand why it is not working.
I installed both jmtpfs and simple-mtpfs via dnf. Restarted computer afterwards. It is still MTP-adress in Dolphin and I cant find it via FFS.

A specific guidance would be awesome. I'm still a noob at linux. Do I need to start FFS with superuser?
Posts: 345
Joined: 7 Jan 2018

bgstack15

I never actually figured out simple-mtpfs so let's start with jmtpfs and if that fails, I'll bother to read the man page for simple-mtpfs.
Step 1: connect phone to Linux system.
Step 2: Set phone to "mtp mode." My phone never remembers that setting, so I have to do it every time I connect this way.
Step 3: List mtp devices and make sure it recognizes that the phone is even there. In a terminal, run:
jmtpfs -l
That's dash L as in Lima.
Additionally, you can run an "lsusb" to see all USB devices. Hopefully some mtp or Android device will show up.
Step 4: If step 3 shows that the device is there, you can tell jmtpfs to mount [the first-found device] to a directory. Something like this:
jmtpfs /home/fev19/android
Where "android" is a directory you made inside your home directory. You can pick whatever directory you want, that your use account owns. Do not run jmtpfs with sudo. Jmtpfs is one of those FUSE things that can be run by a regular user.
In traditional Unix, silence is good. So if it displays nothing at all and just shows you the next bash prompt, it worked. You should now be able to view /home/fev19/android either in a terminal, and in Dolphin.
Step 5: Change your FreeFileSync job to use this new directory.
Step 6: When done, be sure to run
sudo umount -l /home/fev19/android
So we are using sudo to unmount the directory. I always just use the superuser access instead of ever learning if jmtpfs has an unmount command or if there's another way FUSE methods provide for unmounting things. The umount command will definitely work. The dash Lima is there to tell it to lazy-unmount, which can protect you when the phone was already disconnected or otherwise the connection already failed. Skipping this isn't the worst thing in the world, but you really don't want to run multiple jmtpfs [mount] commands with zero unmounts in between because that could get mildly ugly.

Additional thoughts:
Now, in my limited experience with mtp, its throughput is really small, so file copies can be slow, etc.
Also, the connection seems to time out or fail out if I don't use it for a minute or two. But then I have an aggressive screensaver timeout which might be related.
Posts: 5
Joined: 30 Aug 2020

fev19

thanks for your efforts,
in step 4 I get this:

[fev1@localhost ~]$ jmtpfs /home/fev1/android
Device 0 (VID=2717 and PID=ff48) is a Xiaomi Mi-2s (MTP).
error returned by libusb_claim_interface() = -6LIBMTP PANIC: Unable to initialize device
terminate called after throwing an instance of 'MtpErrorCantOpenDevice'
what(): Can't open device
Abgebrochen (Speicherabzug geschrieben)
Posts: 345
Joined: 7 Jan 2018

bgstack15

This is reaching the end of my knowledge. Perhaps the phone was not already set to act as an MTP device and the screen unlocked. Perhaps the libmtp library does not support this device. You could investigate how to attach this exact model phone up to Linux systems.
Or, maybe it's time to try the simple-mtpfs.
Posts: 5
Joined: 30 Aug 2020

fev19

I tried it today another time. It worked with jmtpfs.

Speed is slow like 0,5MB/sec. Any chance to improve it? There is a donated version. I donated 1-2years ago while I used it under Win10. Would it improve my transfering speed?

Thanks for your helping guide! :)
Posts: 345
Joined: 7 Jan 2018

bgstack15

The speed is a limitation of the FUSE method of mounting the device. There is nothing that FreeFileSync can do to make it better.
Posts: 5
Joined: 30 Aug 2020

fev19

Thanks again. I appreciate your help.