(3.0.0.5) USB tethering not working anymore
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.
We have moved to a new Sailfish OS Forum. Please start new discussions there.
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.
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.
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 )editI'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 )editIt 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
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...
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
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 )editThese 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 )editFor 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.
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 )editUSB 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
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.
I'm using windows seven, and usually, i just put the usb cable .. :)
malibu1106 ( 2018-11-03 02:05:49 +0200 )editUpdated 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.
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.
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 )editHad 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.
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.
This thread is public, all members of Together.Jolla.Com can read this page.
Asked: 2018-11-01 12:00:12 +0200
Seen: 5,456 times
Last updated: May 23 '20
[BUG] [3.0.0.5] [3.0.0.8] [fixed in 3.0.1.11] Display of email-attachments is broken [released]
Bug: [3.0.0.8] E-mail can't read forward as attachment [released]
Jolla Store cannot be reached (internet through USB) [answered] [answered]
[bug] Update 1.1.6.27 breaks unofficial USB tethering [released]
[1.1.7.24] USB connection dialog wrong options.
Internet connection through USB
Camera ambience grid can be misleading [still relevant in 3.0.0.5]
battery drain related to carddav-client
The Internet sharing shortcut on the Event view is not active.
@malibu1106 What device you have?
spiiroin ( 2018-11-02 11:05:30 +0200 )editHi. I have a jp1 .
malibu1106 ( 2018-11-03 14:24:27 +0200 )editSame 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 )editI 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 )editI have this same problem on Jolla C, used to work before.
ixevix ( 2018-11-09 15:11:47 +0200 )edit