Ask / Submit
27

(3.0.0.5) USB tethering not working anymore

Tracked by Jolla

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

6 Answers

Sort by » oldest newest most voted
6

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
1

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

Question tools

Follow
17 followers

Stats

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

Seen: 1,425 times

Last updated: Nov 28