answered
2018-08-07 14:15:02 +0200
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.
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 )editI 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
baptx ( 2018-01-03 15:50:31 +0200 )edit/etc/connman/main.conf
? With latest Sailfish OS version,/usr/lib/connman/tools/connmanctl
does not exist anymore andpkcon 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.@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 )editI'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