Ask / Submit
78

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

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

Mr.Thumb gravatar image

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

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 +0200 )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 +0200 )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 +0200 )edit
1

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

Macilaci457 ( 2014-05-06 14:06:09 +0200 )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 +0200 )edit

28 Answers

Sort by » oldest newest most voted
7

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

chemist gravatar image

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

  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 +0200 )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 +0200 )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 +0200 )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 +0200 )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 +0200 )edit
1

answered 2014-05-06 14:24:51 +0200

djhowls gravatar image

Works for me on Linux Mint can't access the SD card though but a manual card reader sorts that out.

edit flag offensive delete publish link more

Comments

I can connect my Jolla with Linux Mint and copy files from and to the phone. So it works OK for me.

Jozz ( 2014-05-06 16:46:56 +0200 )edit
27

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

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 +0200 )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 +0200 )edit

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

WhyNotHugo ( 2014-05-08 04:03:55 +0200 )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 +0200 )edit

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

WhyNotHugo ( 2014-05-08 08:46:51 +0200 )edit
6

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

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 +0200 )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 +0200 )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 +0200 )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 +0200 )edit
0

answered 2014-05-17 19:49:29 +0200

kxq gravatar image

I like to do my file transfers using obex over bluetooth; google "obexfs". By default that mounts the phone's /tmp/ directory, which is not particularly useful. However, writing the to-be directory to expose into /etc/obexd/root (read: go to the directory that should be visible, then type pwd >/etc/obexd/root ; Consider twice before exposing root dir, bad things can happen) fixes this.

In short, to try:

1) Pair phone with PC; I did this using bluedevil-wizard on the PC while keeping the phone's bluetooth visible.

2) Play with obexftp; once this works,

3) Mount using obexfs.

The phone provides obexftp through "Nokia OBEX PC Suite Services" channel. My PC does not auto-recognize that, one needs to give the channel number explicitly to make this work.

edit flag offensive delete publish link more

Comments

For channel numbers try "sdptool"

kxq ( 2014-05-17 19:57:36 +0200 )edit
0

answered 2014-05-19 02:27:16 +0200

dsilveira gravatar image

updated 2014-05-19 02:28:09 +0200

you just need to update your libmtp, and then mtpfs or kio-mtp in KDE, after that it works fine.

I see the benefits of using MTP, so that you don't need the plug/unplug issues, but I agree that it is not easy for older systems. But you've always got ssh, so just use sshfs or fish:// on KDE

edit flag offensive delete publish link more

Comments

What are the advantages of MTP? (I'm genuinely curious, since so far, they haven't been pointed out, AFAIK).

WhyNotHugo ( 2014-05-22 14:35:17 +0200 )edit

No clue, maybe it's just more clean to implement (mass storage requires certain things)

dsilveira ( 2014-05-22 16:23:32 +0200 )edit
2

The advantage of MTP is that both SailfishOS and host computer can acces the files simultaneously. Furthermore, as the filesystem isn't directly exposed to th host computer anymore, it doesn't matter which filesystem is used internally - so no more FAT32 anymore. USB Mass Storage required the filesystem to be unmounted from the phone which would require many apps to quit.

schmittlauch ( 2014-06-06 13:40:08 +0200 )edit

that could be circumvented with a Virtual Block Device, altough I hear it's implementation is tricky.

dsilveira ( 2014-06-13 18:33:44 +0200 )edit
2

@schmittlauch: sshfs and other pre-existing techniques did not have that issue. USB Mass Storage should never have been user for mobile phones, and it's not designed for that at all. The percieved advantages of libmtp are only valid if you compare it to the worst possible alternative, apparently.

WhyNotHugo ( 2014-06-14 00:06:10 +0200 )edit
5

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

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 +0200 )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 +0200 )edit
5

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

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 +0200 )edit
17

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

dez gravatar image

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

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 +0200 )edit
0

answered 2014-06-07 21:29:55 +0200

arminfelder gravatar image

just install "mtp-tools" e.g "apt-get install mtp-tools on your Linux box and you could access it like any other Android Phone

edit flag offensive delete publish link more
Login/Signup to Answer

Question tools

Follow
26 followers

Stats

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

Seen: 15,269 times

Last updated: Aug 23 '17