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

(3.0.0.5) USB tethering not working anymore

Tracked by Jolla (Rejected)

asked 2018-11-01 12:00:12 +0200

malibu1106 gravatar image

updated 2018-11-11 14:18:38 +0200

Andy Roid gravatar image

Hi guys.

Since last update the usb tethering isn't working anymore, I know that this trick isn't officialy supported ( sadly .. ), but is there any way to get it working again ?

thanks. Nice day.

edit retag flag offensive close delete

Comments

@malibu1106 What device you have?

spiiroin ( 2018-11-02 11:05:30 +0200 )edit

Hi. I have a jp1 .

malibu1106 ( 2018-11-03 14:24:27 +0200 )edit

Same problem with Jolla Phone 1. The connection is not tethered with my Linux laptop or desktop since the update to 3.0.0.5. It was with previous Sailfish version.

This option, even if not officially supported, was highly appreciated! I hope that Jolla will fix it.

tg ( 2018-11-05 17:58:57 +0200 )edit
1

I do have the same problem since 3.0.0.5 with Sony Xperia X and as host computer a Linux system. Does anybody have an idea on how to debug this?

thargor ( 2018-11-06 15:43:52 +0200 )edit

I have this same problem on Jolla C, used to work before.

ixevix ( 2018-11-09 15:11:47 +0200 )edit

12 Answers

Sort by » oldest newest most voted
9

answered 2019-01-21 11:37:49 +0200

Philippe De Swert gravatar image

updated 2020-05-23 23:19:23 +0200

Sebix gravatar image

Simple fix is to install connection sharing with connman

pkcon install usb-moded-connection-sharing-android-connman-config

Then you need to fix up the config file as it seems connman now treats the USB connection as an ethernet device and not a gadget device anymore.

Edit /etc/usb-moded/dyn-modes/connection_sharing-android-connman.ini

Change the last line from:

connman_tethering = /net/connman/technology/gadget

to

connman_tethering = /net/connman/technology/ethernet

Also you need to edit the /etc/connman/main.conf and add this line:

TetheringTechnologies = wifi,bluetooth,gadget,ethernet

And things should work again (after systemctl restart connman/systemctl restart usb-moded or a reboot). At least it did on my XA2.

I noticed connman is also compiled with --disable-gadget for some mysterious reason, that might be the actual right fix.

edit flag offensive delete publish link more

Comments

this did the trick for me on 3.0.0.11, thanks!

cartron ( 2019-01-24 09:53:19 +0200 )edit

It worked on 3.0.2.8 but now i'm on 3.0.3.9 and it stopped working. the connecting PC does not get an IP address. I tried on JP1 and XA2 Ultra(H4233)

Shoppinguin ( 2019-05-11 15:02:42 +0200 )edit

I've just upgraded to 3.0.3.9 on my F5122, and it works for me. I haven't edited any configuration files. The only "special" thing that I did was to uninstall the package before upgrading, and re-install it afterwards. connman_tethering is /net/connman/technology/gadget, but it shows up on my system (openSUSE linux) as an ethernet connection.

pakman ( 2019-05-17 02:19:33 +0200 )edit

It almost worked on version 3.1.0.11

I had to add an entry in the options field to /etc/usb-moded/dyn-modes/connection_sharing-android-connman.ini

dhcp_server = 1

In the TetheringTechnologies entry you can delete gadget is not needed.

Edit: 9.10.2019

dhcp_server it turns out that it is not needed either, I had a problem with the rndis windows driver.

suitable Remote NDIS Compatible Device

Chris_ ( 2019-09-15 21:51:03 +0200 )edit

This answer works as-is on XA2 Ultra running SFOS 3.2.1.20 and I just reached download speed around 14MB/s using USB tethering, instead of WLAN tethering, which for whatever reason is limited to around 1.2MB/s. Awesome! I wonder why 1) usb-moded-connection-sharing-android-connman-config isn't installed by default ans 2) why it still needs patching...

Direc ( 2020-02-02 13:25:35 +0200 )edit
8

answered 2018-11-12 12:33:24 +0200

ixevix gravatar image

updated 2018-11-16 21:05:00 +0200

Update: this is probably a better fix:

Match your /etc/usb-moded/dyn-modes/connection_sharing.ini with the following:

[mode]
name = connection_sharing
module = none
network = 1
network_interface = rndis0
appsync = 1

[options]
sysfs_path = /sys/class/android_usb/android0/functions
sysfs_value = rndis
softconnect_path = /sys/class/android_usb/android0/enable
softconnect = 1
softconnect_disconnect = 0
idProduct = 0A02
dhcp_server = 1
nat = 1
nat_interface=rmnet_data0

which is basically the same as in developer_mode-android.ini but with some added stuff for connection sharing. I am also trying to get this fix into the repo. Also no need to reboot you can just do systemctl restart usb-moded after editing the file.

tl;dr

Add to /etc/usb-moded/dyn-modes/developer_mode-android.ini

nat = 1
nat_interface = rmnet_data0

And select "Developer mode" when pluggin in after reboot.

Full story:

Got it working! Just enable "Developer mode" when it asks what you want after plugging in the USB cable... Nvm, that just shows the rndis0 device. Still doesn't work.

This way you can manually enable it for now (replace device names for what you have):

on sailfish:
devel-su
sysctl net.ipv4.ip_forward=1

iptables -t nat -A POSTROUTING -o rmnet_data0 -j MASQUERADE
iptables -A FORWARD -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
iptables -A FORWARD -i rndis0 -o rmnet_data0 -j ACCEPT

on linux machine:
ip route add default via 192.168.2.15 dev enp0s20f0u3u4u3

Ok... To fix this just add

nat = 1

to bottom of file /etc/usb-moded/dyn-modes/developer_mode-android.ini and reboot. Then it just works. ...

Ok seems it still doesn't work and you need to enable the ipv4 forwarding AND add the iptables rules still after.

But it creates the gateway automatically on the linux computer.

Final fix was to add to /etc/usb-moded/dyn-modes/developer_mode-android.ini

nat_interface = rmnet_data0

Then it works after reboot.

sources for reference

https://git.merproject.org/mer-core/usb-moded/blob/master/src/usb_moded-network.c

https://github.com/philippedeswert/usb-moded

edit flag offensive delete publish link more

Comments

Too bad I don't understand anything about this answer. There should be free Linux lessons for everyone who buys Jolla/Sailfish.

Mukaparska ( 2018-11-12 15:55:57 +0200 )edit
2

Ideally this fix should be incorporated into some package so you could just install the package and be done with it.

ixevix ( 2018-11-12 16:01:17 +0200 )edit

You're my hero. I got it working.

Sinikivi ( 2018-11-16 20:38:39 +0200 )edit

Well, 'usb tethering' should remains a different option than 'developer mode'. The use cases are not the same!

PhixGre ( 2018-11-28 20:00:26 +0200 )edit
1

These edits got it working for me under 3.0.0.8, but now I have updated to 3.0.1.11 it has broken again. The problem seems to be that the required package versions are inconsistent:

[root@Sailfish nemo]# pkcon install usb-moded-connection-sharing-android-connman-config
... snip ....
Fatal error: File './armv7hl/droid-hal-version-f5122-0.2.1-1.2.12.jolla.armv7hl.rpm' not found on medium 'https://store- 
repository.jolla.com/releases/3.0.1.11/jolla-hw/adaptation-qualcomm-f5121/armv7hl/?credentials=store'

The version of droid-hal-version-f5122 that is installed is 0.2.1-1.2.6

Edit: Inspired by this question https://together.jolla.com/question/197626/solved-fatal-error-droid-hal-version-f5121-not-found/ which looks very similar to my problem, I tried "pkcon refresh". usb-moded-connection-sharing-android-connman-config then installed successfully and I could get USB tethering to work again. :)

pakman ( 2019-01-18 01:13:55 +0200 )edit
3

answered 2019-05-19 21:39:29 +0200

Shoppinguin gravatar image

updated 2019-05-19 21:40:11 +0200

For me, installing "usb-moded-connection-sharing-android-config" did work flawlessly on 3.0.3.9. Didn't need to edit any config files. Tried and succeeded on h4233 and JP1301

This is a different package than "pkcon install usb-moded-connection-sharing-android-connman-config", which for me does not work.

edit flag offensive delete publish link more

Comments

Good to know this. Wish I had more time to test this...

Direc ( 2020-02-02 15:13:10 +0200 )edit

I couldn't get it to work, so I just installed both packets. Still didn't work, so I edited the config files again; now it works again. Weird...

Direc ( 2020-02-19 15:57:38 +0200 )edit

Well, FWIW, I have ran my setup (both packages explicitly installed and config files edited) for a few weeks now, and it works rock solid. So well that I actually got rid of my primary Internet SIM card, and now just USB-tether via my router (my phone acts as a mobile broadband device). The only hiccup is that for Windows 8/8.1 hosts I have to change the NDIS driver used (can't recall which one exactly, I think it began with "USB"...) but other than that I have had to restart my phone exactly zero times because of tethering not working anymore. Nice!

Direc ( 2020-03-05 23:00:36 +0200 )edit
3

answered 2020-04-14 09:58:42 +0200

jovirkku gravatar image

USB tethering works again with Sailfish OS 3.3.0 release. There is still no proper GUI for it, so you will need to rely on the CLI. Please read this help article: https://jolla.zendesk.com/hc/en-us/articles/203548266.

See also: https://together.jolla.com/question/209684/31011-usb-tethering-no-longer-working/?answer=225289#post-id-225289

edit flag offensive delete publish link more
2

answered 2018-11-02 09:04:59 +0200

jeskata gravatar image

updated 2018-11-02 09:06:12 +0200

This works as before for me. After a reboot I run a script to set up routing and iptables rules. After that I just "up" the interface on the computer and set it as default route. Same scripts as before.

edit flag offensive delete publish link more

Comments

I'm using windows seven, and usually, i just put the usb cable .. :)

malibu1106 ( 2018-11-03 02:05:49 +0200 )edit
1

answered 2018-11-11 15:22:39 +0200

einmaleins gravatar image

Updated my Xperia X to 3.0.0.8 yesterday successfully. But I'm not able to get internet connection via USB on my Linux PC anymore. I tried to re-install usb-moded-connection-sharing-android-config. After reading that there is also usb-moded-connection-sharing-android-connman-config I tried that instead. No success. lusb gives me ID 05c6:0afe Qualcomm, Inc. Is this the right device information for "modem"-mode? I would be happy if someone has a work-around for this as it is a necessary feature for me since I got used to it when I had my N9.

edit flag offensive delete publish link more
0

answered 2018-11-05 13:39:17 +0200

Andy Roid gravatar image

I too have a Jolla 1, and I too tried to tether to a Windows system via USB & saw this regression in 3.0.0.5. Is it necessary to try USB tethering to a Linux system for reference?

On plugging the USB cable, I get & select the 'Internet sharing' option; but there is no Internet on the Windows system, and the 'USB' section in the 'Settings' says it is in charge-only mode.

FWIW, WiFi hotspot works, but isn't as battery-friendly or as localized as USB tethering.

edit flag offensive delete publish link more

Comments

Are there docs or discussion threads that could help with debugging this? I couldn't get much from dmesg on the Jolla 1.

What's with the packages for this? I had usb-moded-connection-sharing-android-config installed, but now I saw & tried installing usb-moded-connection-sharing-android-connman-config too ... didn't help.

The release notes don't say anything, but the changelog mentions changes in the connman package for tethering.

Andy Roid ( 2018-11-06 05:51:03 +0200 )edit
0

answered 2018-11-05 14:05:15 +0200

jeskata gravatar image

updated 2018-11-05 14:06:09 +0200

Had my Xperia act up the other day, after disconnecting and later reconnecting USB it would no longer forward traffic. Could ssh in and ping out from the phone though. Re-running my iptables script (and flushing tables) did not help, only a reboot did.

OTOH, previous versions have occasionally done the same too but that was after using Flight Mode.

edit flag offensive delete publish link more
0

answered 2018-11-28 08:37:24 +0200

jeskata gravatar image

updated 2018-11-28 08:37:53 +0200

Have had my Xperia X loose tethering once in a while now (using method of run a script to set up routing and iptables rules, after that I just "up" the interface on the computer and set it as default route). Started investigating further and see ip_forwarding is still 1, iptables rules are still there and I can ping out if I ssh into the phone.

But I have an interface rmnet_data1 instead of rmnet_data0 that is configured in iptables script. Will try to make an alternate script for that.

edit flag offensive delete publish link more
0

answered 2019-10-09 12:09:12 +0200

Stanislav1988 gravatar image

I have big problem ... I dont have **connection_sharing-android-connman.ini** in dyn-modes directory ... and I cant uinstall this package because pkcon can`t find this O_O

edit flag offensive delete publish link more

Comments

1

if you can't uninstall then try to install

pkcon install usb-moded-connection-sharing-android-connman-config
Chris_ ( 2019-10-09 17:59:21 +0200 )edit

It works on my Intex indian phone! Thanks a lot.

jchrbe ( 2020-01-31 12:45:38 +0200 )edit
Login/Signup to Answer

Question tools

Follow
22 followers

Stats

Asked: 2018-11-01 12:00:12 +0200

Seen: 5,442 times

Last updated: May 23 '20