We have moved to a new Sailfish OS Forum. Please start new discussions there.
79

Why is Jolla/sailfish so hard to connect to linux?

asked 2014-05-06 11:18:21 +0300

Mr.Thumb gravatar image

updated 2015-05-14 08:52:03 +0300

rdmo gravatar image

tldr; Please don't mistake mitigating workarounds for solutions to this problem. Simple connection with another Linux computer is tough or problematic for many users of Sailfish devices.

Why is a Linux/open-source phone so hard to sync/connect to a Linux computer? It should be easier than a walk in the park! What is missing? Why is it so important to force Linux users through circuitous MITM-style hubris just to connect?

Update : Ok, I see this issue still is hot and not solved in an nativ jolla app. So here is what I do at the moment.

Update (not OP): Ten step workarounds vs. plug and play? I should be able to connect and set up a read-only connection without device root or deference any third party (yes, even Jolla) ssh/root permission monitor/authenticator. For Read-only, this should be a user level permissions/connection fix. Write/Execute are distinct problems. Is the wireless/USB technology/security standard that bad, or is this a user auditability/security management issue?

  1. I have to be root - set under settings -> system ->developer mode . Set USB LAN to 192.168.1.11 set a SSH password
  2. make a script on my /home/(your user) f.eks. 'mountjolla'
  3. Script :

#!/usr/bin/bash
localIp='192.168.1.10/24'
localBroadcast='192.168.1.255' 
netAdp=$1
mountPath='/home/(your user)/jolla'
user='nemo'
jollaIp='192.168.1.11'

sudo ip addr add $localIp broadcast $localBroadcast dev $netAdp
# First umount if all ready mounted
fusermount -u $mountPath
sleep 2
sshfs $user@$jollaIp:/home/$user -p 22 $mountPath

  1. do a "mkdir /home/(your user)/jolla . If it is not there allready

  2. do chmod 755 to your script "chmod 755 ~/mountjolla"

  3. plug usb cable in phone & computer

  4. if not check usbnet module is loaded with "lsmod"

  5. do "ip link" ( on Archlinux ) and I guess others Linux OS's

  6. notice what net device pop up ( f.eks. enp0s29u1u2u1u3 )

  7. run your script "mountjolla enp0s29u1u2u1u3"

And you have you jolle "nemo" dir mounted at /home/(your user)/jolla !

  1. umount it with "fusermount -u /home/(your user)/jolla"

Still not an "easy way" tough :-/ but it works

Another way is using firefox with "FireFTP" extention: , after setup ssh settings + password etc , connect USB cable, get usbnet setup with "ip link" and "sudo ip addr add (localIP) broadcast (localBrodcast) dev (jollaIP)" and point browser to "sftp://(jollaIP)/". Then you get a nice "mc" like interface :P (thanks coderus for the hint)

edit retag flag offensive close delete

Comments

1

Please provide some details, how were you trying to sync? Sailfish OS uses the MTP Protocol - https://en.wikipedia.org/wiki/Media_Transfer_Protocol Depending on your derivative there should be MTP support installable, please check the wikipedia page or post your exact operating system (example Ubuntu 12.04 LTS).

Otherwise you could enable SSH and build yourself a little bash script that connects and sync's.

I know its a bit inconvenient, but if you are using Gnu\Linux and a Jolla, you are probably a person that likes to hack their own stuff ;)

ozzi ( 2014-05-06 11:34:11 +0300 )edit
3

I find the use of the MTP Protocol problematic, at least for older Linux systems. If I connect my Jolla to my Ubuntu (11.10) laptop, it is recognized as digital camera, but no transfer is possible. I wonder about the reason why that protocol was chosen. Never mind, I decided to disable USB connectivity on my Jolla, and I now use ssh to connect to the phone.

barral ( 2014-05-06 11:59:08 +0300 )edit
2

I just think it is abit of a pain(and something to make better working ) to just plug the phone (USB) and transfeer some files to it. (MPT do not work under Archlinux at the moment) And I had no problems with my old "shitty" HTC on Linux ? So why can a Jolla just work on Linux with USB ? Now I run Bittorrent sync (andriod) to sync the phone but then I have to move stuff around and is not able to "browser" the dirs ? SSH sounds nice but my WiFi is not connected to my intranet so I have to lock in on the WIfi router to login on the Jolla !?

Mr.Thumb ( 2014-05-06 12:37:17 +0300 )edit
1

My system is Ubuntu 10.04 LTS, and has no support for MTP neither.

Macilaci457 ( 2014-05-06 14:06:09 +0300 )edit
3

Jolla connects well with Ubuntu 13.10 and 14.04. Already transfered many files to my phone and barely ever had a problem.

molan ( 2014-05-06 14:29:00 +0300 )edit

28 Answers

Sort by » oldest newest most voted
27

answered 2014-05-07 06:41:22 +0300

WhyNotHugo gravatar image

Use sshfs, instead of whatever-it-is that runs over USB - honestly, it had never ocurred to me to use a cable to manage a wireless handheld computer before I read about this on these forums a few days ago. It's a pretty senseless idea, if you consider it. You don't plug your laptop onto your PC to share files, do you?

Here's a script I wrote that works at home. The lack of avahi support forces one to hardcode the IP address (On the N9, you could use devicename.local instead of the IP). Hopefully, this will be addressed in future:

$ cat .bin/mount/sshfs.jolla 
#!/bin/sh
export MOUNTPATH=~/mount/jolla
mkdir -p ${MOUNTPATH}
sshfs nemo@172.16.9.157:/home/nemo/ ${MOUNTPATH}
edit flag offensive delete publish link more

Comments

Quick and dirty (could be a comment on my answer but hey), where is the for-dummies-guide with fstab and auto-mount? ;)

chemist ( 2014-05-07 10:14:40 +0300 )edit
1

Wired access is good for transferring larger amounts of data fast.

That said, the sshfs route can also be taken by adding an entry to /etc/fstab like so: nemo@192.168.1.20: <local mountpath=""> fuse.sshfs noauto,users,_netdev 0 0</local>

For avoiding having to find the IP every time, you could reserve one for the Jolla's MAC address in your router.

fawz ( 2014-05-08 02:51:25 +0300 )edit

The device always gets the same IP at home, but I'm not always at home. ;)

WhyNotHugo ( 2014-05-08 04:03:55 +0300 )edit

The most basic usage to connect a smartphone to a computer is to back up the pictures/videos. I'm doing that all the time because I do need to have my pics/videos backed up on a hard disk. I don't trust the cloud backup solutions only.

chinauser ( 2014-05-08 08:34:33 +0300 )edit

@chinauser: So? This answer does not even remotely make any reference to cloud-based solutions.

WhyNotHugo ( 2014-05-08 08:46:51 +0300 )edit
17

answered 2014-06-07 08:51:59 +0300

dez gravatar image

updated 2014-06-07 13:22:46 +0300

Jolla is using MTP protocol to provide an access to Linux-specific btrfs file system not only from Linux but also from other OSes (Windows, MacOSX etc.) and this is the only currently available way to provide read/write access. Also MTP is not a Microsoft protocol as one user wrote here, but USB Implementers Forum standard, it was just proposed by this company.

Regarding sync on Linux: as a Linux user you can just use SSH/SFTP to do whatever you want with the filesystem on the device. User should enable Developer Mode for ssh access to be enabled because it opens one more port and many users simply do not use it so there is no reason to open one more potential target for "hacker" attack.

MTP has drawbacks, also available implementation of Linux MTP server (Buteo MTP) is complex and it does not allow to transfer ownership and permissions information. But for people familiar with Linux it should not be hard to use ssh-based solutions.

Read to understand reasons:

edit flag offensive delete publish link more

Comments

My preferred solutions to sync are syncevolution (for contacts and calendar) and unison (for everything else). Both support two-way-sync.

Eierkopp ( 2014-11-05 20:42:47 +0300 )edit
7

answered 2014-05-06 12:40:00 +0300

chemist gravatar image

updated 2014-05-07 14:32:13 +0300

  1. use a derivative that has proper MTP support (a year ago I would not know of one but for me debian testing works out of the box)
  2. use a fuse-mount over ssh instead of MTP over USB (if you need a folder to click on...)
  3. write a script to sync your device over ssh with rsync (rsync does have a partial transfer mode just in case you loose connection, it will resume any incomplete transfer)
  4. wait for Jolla to devel their Jolla Docks (PC-Suite) and Jolla Radar (OTA-Suite)

Driven by the need for an alternative I started a skunkworks/feature-request https://together.jolla.com/question/42078/jolla-radar-an-unlike-suite-to-get-rid-of-mtp/

edit flag offensive delete publish link more

Comments

1 and 2 no good do not work right now . 3 still needs MTP 4. Sounds Good ;-) so Dropbox/BitSync is the way for me now :-S

Mr.Thumb ( 2014-05-06 12:51:36 +0300 )edit

@Mr.Thumb ehrm pardon?! 1. does not work cause of MTP, well lets stick to that (upgrade your system to something current and it should work - ubuntu and arch should work by now) for 2. you need to install fuse and setup an sshfs mount (that even works in the internets if you have a way to tunnel to your device, dyndns...), 3. does not need MTP it is rsync over wlan in an ssh-tunnel (same problem as 2. as of your wlan). Using arch requires some sort of linux-skill level so I am sure you figure out a way of either wlan or usb. 2. and 3. you may use USBnetworking and have a startup-script ready to ssh-mount over usb-network as soon as it settles...

chemist ( 2014-05-06 13:05:17 +0300 )edit
2

Hmm... MPT hmm.. but shaky . sshfs, dyndns agghh.. not again .. USBnetworking could not get it to work, maybe I try again if/when I get time .. I could also just take out the freaking Sd card and put the files on ;-) What I mean "Why is it painful to get Jolla going/sync on Linux when it is a LInux phone?" Should this phone not just WORK on linux !? What is the problem with that ? Is Jolla not focus on Linux users or is it a project thing so it will work some day !? It would send a Very "nice" signal out to all "IPhone" users that this phone just works on Linux !

Mr.Thumb ( 2014-05-06 13:35:32 +0300 )edit
1

MTP sucks. Try streaming a video file from jolla to Windows PC, and it will first copy the 2 gig file to Windows before doing anything. On Linux MTP just doesn't work with Ubuntu 12.04 LTS, is horribly slow etc. With Linux, ssh access with sshfs mounts, rsync, shell for debugging etc work really well. Network manager setup: manual IP 192.168.2.1, tied to the MAC address of jolla, setup /etc/hosts to have a jolla name with the correct IP address 192.168.2.15. Not easy to setup but flexible for everything. I would have expected a USB mass media mode like with N9. That works everywhere, but maybe I'm just getting old...

mcfrisk ( 2014-05-06 15:14:44 +0300 )edit
2

USBmassStorage mode has its flaws too and that is why they went MTP only. I'd love another mode too but MTP seems to be the easiest way to get MSheepWindows to work, as they as you know do not support anything but their own. So the limitation here is not to make it compatible to linux as that is actually depending on how old your distro (working MTP seems to be bleeding edge, still - reading any system not upgraded for a couple of months might have very issues, I for myself have it only recognized to be working kind of properly since Feb) is but what works on Win7/8.x too. FAIK this is MTP only.

chemist ( 2014-05-06 17:19:30 +0300 )edit
6

answered 2014-05-07 10:03:44 +0300

Khertan gravatar image

Because they made the worst choice to use a stupid MS protocol called MTP, and as most MS protocol they are inconsistent, not well thought, not well documented, extended with undocumented features ... and so not well implemented in various Linux distribution.

edit flag offensive delete publish link more

Comments

On top of that, it adds no real value, and offers nothing it's predecesors did not. It's only really usable on "dumb" devices (eg: cameras).

WhyNotHugo ( 2014-05-07 21:45:54 +0300 )edit
11

This answer is very biased and shows @Khertan does not understand the reason for this choice. MTP is the only alternative to expose UNIX file system to be accessible from different OSes. So, this "answer" is just non-constructive ranting.

dez ( 2014-06-07 08:39:24 +0300 )edit

Just in case anyone actually believes that MTP is the only way to expose a UNIX filesystem; that's not factually correct. NFS, Samba etc are supported cross-platform. MTP is simply (sadly) the defacto standard for mobile devices when it comes to media transfer and they didn't want to break with the standard. It could be done differently.

fawz ( 2014-06-07 21:36:15 +0300 )edit

@dez No it isn't sshfs predates mtp by years. Samba is equally awful, and quite a pain to set up. But mtp is so hard, I simply gave up after an hour and installed airdroid (this happened when copying to a friend's Android phone). Meanwhile, sshfs is just a matter of reading an extremely simple man page.

WhyNotHugo ( 2014-06-07 22:03:37 +0300 )edit
5

answered 2014-05-19 08:09:05 +0300

Tuokki gravatar image

Jolla has been operated via USB perfectly. I use Windows, but also for Suse Linux distribution. I also use SSH (through the WLAN network) for file transfer. A handy program for both Windows and the Linux is FileZilla.

edit flag offensive delete publish link more

Comments

FileZilla works great. "Directory comparison" and "Synchronized directory browsing" features are very usefull.

jbrek ( 2014-05-19 14:04:08 +0300 )edit

Filazilla sort-of-works. You can copy files in both directions, but it's a very poor replacement to mounting the phone's fs locally (which is what sshfs does).

WhyNotHugo ( 2014-05-22 14:33:23 +0300 )edit
5

answered 2014-06-03 18:05:59 +0300

pmelas gravatar image

My Jolla was connecting fine over USB (MTP) on Linux Mint 16, it was not working though on my laptop Linux Mint 15. After the Sailfish March update, I was able to connect on both computers. Updating to Linux Mint 17, I cannot connect via USB anymore ;-(

I suspect the problem is between Jolla and libmtp. In the MTP device list (music-players.h) is defined in http://sourceforge.net/p/libmtp/code/ci/HEAD/tree/src/music-players.h#l132 as:

/*
* Jolla
*/
{ "Jolla", 0x2931, "Sailfish", 0x0a01,
DEVICE_FLAGS_ANDROID_BUGS },

while the actual device in my system is detected as:

[ 5375.510296] usb 1-1.1.2: New USB device found, idVendor=2931, idProduct=0a05

the product id is wrong (0x0a01 vs 0x0a05).

edit flag offensive delete publish link more

Comments

1

After a fixed libmtp was finally distributed, Jolla decided to change the product Id once again. With 2.0.1.11, the phone reports as 2931:0a07 for "PC Connection". That means that libmtp needs to be patched once again.

raimue ( 2016-06-22 18:46:00 +0300 )edit
5

answered 2015-04-07 11:01:23 +0300

smoku gravatar image

There is definitely something fishy with Sailfish OS MTP support. On Fedora 21 workstation connecting Jolla Phone (with latest firmware) is just a game of luck. If I win (1/20?) MTP connects and I can see internal card and SD card. Connection is very unreliable though and hangs after a while. On the same workstation connecting an Android phone over MTP works every time and the connection is rock-solid.

edit flag offensive delete publish link more

Comments

Your issues with the MTP connection coild possibly be caused by this bug. Check this out.

wanderer ( 2015-07-29 08:54:29 +0300 )edit
3

answered 2014-12-10 22:14:09 +0300

Sorry, I can't stand this discussion. I am proud to have a Jolla phone especially because I got rid of the f... MTP protocol. If you really have got a Linux computer (are you sure???), why the hell not using ssh, sftp or scp? One may even rename folders on the Jolla. Did you ever try this using MTP?

Ok, here are the steps:

  1. Follow the guide to make your Jolla developer friendly (settings->system->developer mode).
  2. Your Linux desktop should provide "Connect to server". Click. Protocol: ssh. Server: the IP, Jolla provided. User: nemo, pass: the password you have chosen on your Jolla. Click.
  3. Voila! That's it. You now may navigate your Jolla phone as if it was another hd.
  4. If in doubt, simply open a terminal on your desktop and type ssh nemo@[from jolla provided IP]. Type the password, you have selected on your Jolla. Now type things like ls (ouh! Even ls -la) or cd [somewhere], ls should give you a hint (same as on W...).

Isn't that amazing? It works!

edit flag offensive delete publish link more

Comments

3

Not all linux users are $root and capable to do more than "click" items, just as most windows users do not know what super+d does or beware of super+pause or even ctrl+shift+escape...

chemist ( 2014-12-11 02:13:38 +0300 )edit
1

Believe me: there isn't yet any win user having a Jolla in his pocket. They want to have "Ahh" and "Ohh" and other crab.

So we are still a community, having fun to improve. So we ARE root!

If there's a shithead among us payed by ms or apple or google, writing bullshit here, f.. him. And this indeed happened, I'm sure.

Besides: I give a damn shit on everybody voting me down or even up.

atmin ( 2014-12-14 19:52:55 +0300 )edit
3

answered 2015-04-08 20:24:40 +0300

zash1958 gravatar image

For our Linux Mint LMDE2 system I installed "jmtpfs" additionally.

The phone and it´s SD card are properly detected, mounted and we transferred a lot of Gigabytes in between!

Runs like a charm!

edit flag offensive delete publish link more

Comments

1

Hey, that works nicely on arch also !!. on archlinux install package "jmtpfs"

  1. Plug USB cabel in . Press "PC connection" on phone
  2. run : jmtpfs ~/(your dir for Jolla)
  3. Load up file browser and point it to ~/(your dir for Jolla)
  4. Vola you can see nemo home dir and sdcard - Nice!!
  5. Close all programs pointing to ~/(your dir for Jolla)
  6. do : fusermount -u ~/(your dir for Jolla)
  7. And pull cable from phone and smile ;-)

p.s. If you want to see all dir on the phone ssh/usbnet is the way to go

Mr.Thumb ( 2015-04-09 00:06:41 +0300 )edit
3

answered 2015-05-19 01:54:49 +0300

Thaodan gravatar image

If you use KDE, use the kio slave for sftp this makes it very easy to connect to the device.

edit flag offensive delete publish link more

Comments

It's really easy with dolphin for example.

Arhangel64 ( 2017-01-17 18:30:43 +0300 )edit
Login/Signup to Answer

Question tools

Follow
25 followers

Stats

Asked: 2014-05-06 11:18:21 +0300

Seen: 16,658 times

Last updated: Aug 23 '17