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
3

answered 2015-06-03 20:21:55 +0300

haasn gravatar image

This is how I got it to work on Gentoo Linux. It should transfer to most other distros.

  1. Enable developer mode on the phone and either set it as the default USB mode or select it manually when prompted.

  2. Enable usbnet, rndis_host and usb_f_rndis support in the kernel. This is where I had to configure them on linux 4.0.0:

    Device Drivers --->
      [*] Network device support --->
        USB Network Adapters --->
          [M] Multi-purpose USB Networking Framework
            <M> CDC Ethernet support
            <M> CDC EEM support
            <M> Host for RNDIS and ActiveSync devices
            <M> Simple USB Network Links (CDC Ethernet subset)
              [*] Embedded ARM Linux links
    
      [*] USB Support --->
        <*> USB Modem (CDC ACM) support
        <*> USB Wireless Device Management support
        <*> USB Gadget Support  --->
          <M> USB Gadget Drivers
            <M> Ethernet Gadget (with CDC Ethernet support)
              [*] RNDIS support
    
  3. Plug the device in. You should see something like this inside dmesg: [166495.570786] rndis_host 1-1:1.0 usb0: register 'rndis_host' at usb-0000:00:14.0-1, RNDIS device, ea:57:53:46:e8:42. If you don't, you may need to make sure the above modules are loaded. (I had to run modprobe usb_f_rndis manually)

  4. You should have a usb0 device (check ifconfig -a to confirm). At this point, all I needed to do was run dhcpcd usb0 to get it to set itself up correctly. I'm sure there are also ways to make it do this automatically, but I just run it manually whenever I need to access it for some reason.

Now you can access the phone via ssh over high-speed USB, rather than over the slow wireless network. Forget MTP and all that broken nonsense.

edit flag offensive delete publish link more
2

answered 2014-11-05 20:26:48 +0300

molan gravatar image

Another solution for Ubuntu and Ubuntu based distributions:

From my experience MTP works well out of the box starting with Ubuntu 14.04. If you use an older version (or for example elementary OS, based on 12.04), try this in terminal:

  1. sudo add-apt-repository ppa:langdalepl/gvfs-mtp
  2. sudo apt-get update
  3. sudo apt-get upgrade
  4. sudo reboot

Now connect again your Jolla and it should work. In case you want to downgrade/revert Gvfs do:

  1. sudo ppa-purge ppa:langdalepl/gvfs-mtp
  2. reboot
edit flag offensive delete publish link more
1

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

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

answered 2015-04-07 15:13:30 +0300

coderus gravatar image

I just added bookmark to following location: sftp://nemo@192.168.2.15 (replace with actual ip address, if needed) and I have no problems in connecting Jolla to Linux PC :D

edit flag offensive delete publish link more
1

answered 2015-08-14 20:12:50 +0300

cg gravatar image

I'm on OpenSuse and since the following 2 options have not yet been mentioned here...

  1. very easy but with MTP and thus i.e. timestamps are not transferred: I use a filemanager called "Krusader" all the time - after connecting my Jolla via USB I simply enter "camera://" in its adress line and navigate through the directories on the phone

  2. using SSH and WLAN (i.e. timestamps a preserved): connect your Jolla to the same network as the linux PC, on the Jolla activate developer mode, set password for SSH connection and take a note of the IP address. There is another nice filemanager called "gftp" - make a connection to the IP of your Jolla, username "nemo", protocol "SSH2". If transfer seems stuck, wake up your Jolla.

Both filemanagers have the ability to store bookmarks, so next time your connected it's almost just about clicking that bookmark.

edit flag offensive delete publish link more
0

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

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

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

dsilveira gravatar image

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

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

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

dsilveira ( 2014-05-22 16:23:32 +0300 )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 +0300 )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 +0300 )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 +0300 )edit
0

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

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
0

answered 2015-04-07 12:44:56 +0300

r0kk3rz gravatar image

Is there a possibility to get Jolla to advertise the local filesystems when using RNDIS (Developer Mode)?

This is probably a better solution than MTP for linux hosts since RNDIS seems to be well supported out-of-the-box and also allows for ssh-over-usb.

edit flag offensive delete publish link more
0

answered 2015-04-07 16:00:39 +0300

Marzanna gravatar image

Jolla uses MTP. It works for Android phones with minor issues. For Jolla I also had to add udev rule to /etc/udev/rules.d/51-android.rules It looks like:

SUBSYSTEM=="usb",ATTR{idVendor}=="2931",MODE="0666",GROUP="plugdev"

Then I got it detected. But the file manager (Thunar) does not recognize my Jolla (but it detects other Android smartphones). I temporary solved it by using gmtp.

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

Question tools

Follow
25 followers

Stats

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

Seen: 16,686 times

Last updated: Aug 23 '17