Ask / Submit
6

Internet connection through USB

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

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

1 Answer

Sort by » oldest newest most voted
0

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

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
Login/Signup to Answer

Question tools

Follow
4 followers

Stats

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

Seen: 881 times

Last updated: Aug 07