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

Internet connection through USB

asked 2015-10-06 00:44:48 +0200

simoej gravatar image

I have recently updated to version 1.1.9.28 and since then I cannot connect to internet through USB any more. I was used to connect as explained in https://together.jolla.com/question/58975/network-sharing-from-pc-to-phone-answered/

The problem is that now, when executing /usr/lib/connman/tools/connmanctl services, it cannot found the usb gadget (only the cellular is found). I have checked and the usb interface is not in the blacklist. On my PC (Ubuntu) nothing has changed (no upgrades, etc.), firewall is disabled and the file /etc/network/interfaces is modified as explained in the previous link.

Does anyone have a clue about what has been changed with the last update? Thanks

edit retag flag offensive close delete

Comments

I had the same problem and the normally route command like in the issue explaned are working. And on my phone it's the file /etc/connman/main.conf that is modified. I tried to modify the file like in the issue explaned, but it doesn't works.

yajo ( 2015-11-17 18:04:20 +0200 )edit
1

I have version 2.0.0.1 and it doesn't work. I downloaded the latest version of the connman via the command 'devel-su git clone git://git.kernel.org/pub/scm/network/connman/connman.git connman' I tried to installed it and after a while, I was successful. I removed the actually connman via 'devel-su pkcon remove connman'. Then I installed it again, because it worked not good. I have to start the connman-service manual and he breaks often, so i renamed the connman.service into net.connman.service. I did the same with the vpn-service file. After this I did the command 'devel-su pkcon install connman'. So I have now two versions of connman parallel. I can start this one, who supports usb and bluetooth-tethering with 'devel-su systemctl start net.connman.service'. You have to configure it manually via 'connmanctl'. Sometimes I get an error and I have to start the connman again. The connman from Jolla works normally. If you try to do that, be careful. You can damage your complete Network-manager, so you have no possibility to connect to the Internet.

yajo ( 2016-01-16 15:27:26 +0200 )edit

@yajo thanks for the informations, compiling latest connman manually was the only solution to share the ethernet connection from my pc to my phone via USB for the mobile mail app. However I recommend using the latest release from https://git.kernel.org/pub/scm/network/connman/connman.git instead of the latest Git version to avoid bugs. I also don't recommend removing the original connman version since it was unnecessary for me and it could uninstall several system applications as dependencies.

Any idea why USB is not supported in the original version even if USB is not blacklisted in /etc/connman/main.conf? With latest Sailfish OS version, /usr/lib/connman/tools/connmanctl does not exist anymore and pkcon install connman-tools says "Fatal error: connman-tools-1.24+git106-1.20.1.armv7hl requires connman = 1.24+git106-1.20.1, but this requirement cannot be provided", do you know why? Hopefully I still have the self-compiled version of connmanctl.

baptx ( 2018-01-03 15:50:31 +0200 )edit

@yajo did you manage to get an Internet connection from your computer USB connection that is working with the Aptoide Android store? I tried this solution but the Android app still says "no network connection" when I try to click on an featured app to see a description that was not previously cached: https://together.jolla.com/question/2780/fixed-in-10716-sailfish-and-android-apps-using-different-dns/?answer=11554#post-id-11554

baptx ( 2018-11-21 14:45:34 +0200 )edit

I'm sorry. I don't use it any more. I just tried to install the latest version now, but I could not figure out, how it works. If I remember correct, there was an android app to simulate an existing wifi connection. But I'm not quite sue how well this worked.

yajo ( 2018-11-21 16:39:40 +0200 )edit

1 Answer

Sort by » oldest newest most voted
0

answered 2018-08-07 14:15:02 +0200

baptx gravatar image

I still wonder why USB is not supported in the original connman version and we have to use a self-compiled version of connman.

Here is a reminder script (https://pastebin.com/SHPz3QuQ) based on previous answers that I created some times ago to share my Linux desktop Internet connection (connected with an Ethernet cable) to my Jolla smartphone (connected with an USB cable), it may be useful for others:

# ON laptop (tun0 instead of eth0 or eth1 for VPN):
#sudo sh -c "echo 1 > /proc/sys/net/ipv4/ip_forward"
#sudo iptables -t nat -A POSTROUTING -o tun0 -s 192.168.2.11 -j MASQUERADE

# stop default connman without USB support and start self-compiled version
#sudo systemctl stop connman.service
#sudo systemctl start net.connman.service

# not needed with connman
#/sbin/route add default gw 192.168.2.12
#sudo sh -c 'echo "nameserver 208.67.222.222
#nameserver 208.67.220.220" > /etc/resolv.conf'

#ctl=/usr/lib/connman/tools/connmanctl
ctl=connmanctl
gadget=`$ctl services | grep gadget | cut -b 26- | tail -1`

# if mobile network is disabled by default in self-compiled version
#$ctl enable cellular

$ctl config $gadget --ipv4 manual 192.168.2.11 255.255.255.0 192.168.2.12 --nameservers 208.67.222.222 208.67.220.220
$ctl connect $gadget

Note: for the initial setup, you first have to read the comments and do some commands manually to share Internet connection of your desktop computer and start the self-compiled connman version. Then, the script can be run directly with a command like "./internet_usb_receive.sh" when you disconnect and reconnect the USB cable.

edit flag offensive delete publish link more

Comments

1

Hi

Is a recompiled connman still required on Sailfish OS 3? I cannot see "gadget" in my connman services results... I am now on an Xperia XZ, SF 3.0.1.11.

One additional question : has anyone used it successfully on SF3 ? I wonder whether the iptables settings on 3.0.1.11 need some tweaking. I have not yet analyzed them but failed to make the connection working the way I used to on SF 2.

Regards Dominique

ddelamarre ( 2019-01-24 18:50:07 +0200 )edit

@ddelamarre hi, yes a recompiled version of connman was still required the last time I tested with Sailfish OS 3 and it worked when I tested with the reminder script above (you should follow the comments of the script also). For information, the net.connman.service systemd service does not exist by default, you have to copy /lib/systemd/system/connman.service and rename it to something else like net.connman.service in /lib/systemd/system/, then you can edit the file to change the ExecStart path below [Service] to the recompiled version of connman, it will be something like ExecStart=/usr/local/sbin/connman -n --nobacktrace. I commented everything else since it was not needed.

baptx ( 2019-01-25 13:40:10 +0200 )edit

@baptx: How did you recompile connman? @ddelamarre: Did you come to a solution in the meantime?

Sebix ( 2020-05-23 19:16:59 +0200 )edit

@ddelamarre I've tried it successful with the Sailfish OS 3.3.0.16. The only problem is that android apps won't work with that for me..

yajo ( 2020-05-24 18:13:06 +0200 )edit

I also got it working partially. Command line tools and background processes (like mail syncing) works, but Apps are still asking for a Wifi/Mobile connection. I haven't yet found a solution for this. However, encouraging to read, that I'm not the only one seeking for such a solution :)

Sebix ( 2020-05-24 19:42:05 +0200 )edit
Login/Signup to Answer

Question tools

Follow
6 followers

Stats

Asked: 2015-10-06 00:44:48 +0200

Seen: 1,774 times

Last updated: Aug 07 '18