Mobile Hotspot USB-tethered as WAN

Just flashed latest snapshot and find everything works -- except the mobile hotspot tether.

When the hotspots (two models) are plugged into Asus / RMerlin router, it initializes properly to provide web access (in lieu of cable), same as when connected to most any linux box. (On routers, WAN ports remain open.)

The hotspots are obviously being recognized as many of the supporting kernel modules are auto-loaded on connection. But alas, no usable internet.

So is this a known issue, then w/ or w/o a workaround?

Finally driven out of lurk mode to make this post as info on this has been hard to find.

Please share device name(s), pick one of them, connect it to the router and show the output of cat /sys/kernel/debug/usb/devices

Make sure there is no IP address conflict between router LAN and hotspot LAN.

Thanks, @AndrewZ , for taking a look.

Started with IP conflict; both the Franklin T10 (4G) and Quanta D53 (5G) are locked to Tmo (US) with LAN sides forced to 192.168.1.x subnet, unconfigurable.

Most posts instruct to scp over /etc/config/network, edit to remove conflict, and copy back. Attempt produced:

ash: /usr/libexec/sftp-server: not found

(Snapshot build, support recently added.)

So considered, realized sed was the better tool anyway:

sed -i s/192.168.1.1/192.168.1.8/ /etc/config/network

(The hotspots can't connect to other subnets on the LAN side. Did try, in case of some magic internal bridging, but no difference.)

Change made as expected and persists, but still neither device connects.

Using the Quanta:

cat /sys/kernel/debug/usb/devices

T:  Bus=01 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=480  MxCh= 2
B:  Alloc=  0/800 us ( 0%), #Int=  0, #Iso=  0
D:  Ver= 2.00 Cls=09(hub  ) Sub=00 Prot=01 MxPS=64 #Cfgs=  1
P:  Vendor=1d6b ProdID=0002 Rev= 6.06
S:  Manufacturer=Linux 6.6.41 xhci-hcd
S:  Product=xHCI Host Controller
S:  SerialNumber=1e1c0000.xhci
C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=  0mA
I:* If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub
E:  Ad=81(I) Atr=03(Int.) MxPS=   4 Ivl=256ms

T:  Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 12 Spd=480  MxCh= 0
D:  Ver= 2.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  2
P:  Vendor=0e8d ProdID=2028 Rev= 2.23
S:  Manufacturer=Mediatek
S:  Product=mt6890
S:  SerialNumber=D53SEE2354D1B027
C:* #Ifs= 2 Cfg#= 2 Atr=80 MxPwr=500mA
A:  FirstIf#= 0 IfCount= 2 Cls=e0(wlcon) Sub=01 Prot=03
I:* If#= 0 Alt= 0 #EPs= 1 Cls=e0(wlcon) Sub=01 Prot=03 Driver=(none)
E:  Ad=82(I) Atr=03(Int.) MxPS=   8 Ivl=32ms
I:* If#= 1 Alt= 0 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver=(none)
E:  Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
C:  #Ifs= 2 Cfg#= 1 Atr=80 MxPwr=500mA
A:  FirstIf#= 0 IfCount= 2 Cls=02(comm.) Sub=06 Prot=00
I:  If#= 0 Alt= 0 #EPs= 1 Cls=02(comm.) Sub=06 Prot=00 Driver=
E:  Ad=82(I) Atr=03(Int.) MxPS=  16 Ivl=32ms
I:  If#= 1 Alt= 0 #EPs= 0 Cls=0a(data ) Sub=00 Prot=00 Driver=
I:  If#= 1 Alt= 1 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver=
E:  Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms

T:  Bus=02 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=5000 MxCh= 1
B:  Alloc=  0/800 us ( 0%), #Int=  0, #Iso=  0
D:  Ver= 3.00 Cls=09(hub  ) Sub=00 Prot=03 MxPS= 9 #Cfgs=  1
P:  Vendor=1d6b ProdID=0003 Rev= 6.06
S:  Manufacturer=Linux 6.6.41 xhci-hcd
S:  Product=xHCI Host Controller
S:  SerialNumber=1e1c0000.xhci
C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=  0mA
I:* If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub
E:  Ad=81(I) Atr=03(Int.) MxPS=   4 Ivl=256ms

At boot:

dmesg | grep usb
[5.485417] usbcore: registered new interface driver usbfs
[5.496597] usbcore: registered new interface driver hub
[5.507399] usbcore: registered new device driver usb
[5.559525] xhci-mtk 1e1c0000.xhci: supply vusb33 not found, using dummy regulator
[5.692280] usb usb2: We don't know the algorithms for LPM for this host, disabling LPM.
[6.248740] usb 1-1: new high-speed USB device number 2 using xhci-mtk

After some time, with hotspot the only usb device connected:

[ 489.702789] usb 1-1: USB disconnect, device number 2
[ 491.528657] usb 1-1: new high-speed USB device number 3 using xhci-mtk
[ 491.541835] xhci-mtk 1e1c0000.xhci: ERROR: unexpected setup context command completion code 0x11.
[ 491.559538] usb 1-1: hub failed to enable device, error -22
[ 492.898648] usb 1-1: new high-speed USB device number 4 using xhci-mtk
[ 495.566282] usb 1-1: USB disconnect, device number 4
[ 496.088649] usb 1-1: new high-speed USB device number 5 using xhci-mtk
[ 497.432388] usb 1-1: USB disconnect, device number 5
[ 497.948648] usb 1-1: new high-speed USB device number 6 using xhci-mtk
[ 498.638790] xhci-mtk 1e1c0000.xhci: ERROR: unexpected setup address command completion code 0x11.
[ 498.868719] xhci-mtk 1e1c0000.xhci: ERROR: unexpected setup address command completion code 0x11.
[ 499.098636] usb 1-1: device not accepting address 6, error -22
[ 500.658674] usb 1-1: new high-speed USB device number 7 using xhci-mtk
[ 509.458279] usb 1-1: USB disconnect, device number 7
[ 509.968648] usb 1-1: new high-speed USB device number 8 using xhci-mtk
[ 510.128716] xhci-mtk 1e1c0000.xhci: ERROR: unexpected setup address command completion code 0x11.
[ 510.358781] xhci-mtk 1e1c0000.xhci: ERROR: unexpected setup address command completion code 0x11.
[ 510.588639] usb 1-1: device not accepting address 8, error -22
[ 510.968654] usb 1-1: new high-speed USB device number 9 using xhci-mtk
[ 512.882272] usb 1-1: USB disconnect, device number 9
[ 516.318660] usb 1-1: new high-speed USB device number 10 using xhci-mtk
[ 518.410158] usb 1-1: USB disconnect, device number 10
[ 519.518640] usb 1-1: new high-speed USB device number 11 using xhci-mtk
[ 520.159028] usb 1-1: USB disconnect, device number 11
[ 521.908648] usb 1-1: new high-speed USB device number 12 using xhci-mtk
[1056.397955] usb 1-1: USB disconnect, device number 12
[1056.908610] usb 1-1: new high-speed USB device number 13 using xhci-mtk

Any usb plug/unplug or power cycle of the hotspot produces only a single line:
[] usb 1-1: new high-speed USB device number x using xhci-mtk

Any hope for the patient?

This is SCP defaulting SFTP instead of SCP during transfers, solution is posted on the forum.

Snapshot or stable wouldn't had made any difference.

Good to know, thanks. (Still, sed said to be easier.)

Finding the second paragraph of the debug info different for the T10 (paragraphs one and three are same as with the Quanta), here it is:

T:  Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=  3 Spd=480  MxCh= 0
D:  Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  2
P:  Vendor=05c6 ProdID=9057 Rev= 3.18
S:  Manufacturer=Android
S:  Product=MDM9207-MTP _SN:60FFC53C
S:  SerialNumber=0123456789ABCDEF
C:* #Ifs= 2 Cfg#= 1 Atr=a0 MxPwr=500mA
A:  FirstIf#= 0 IfCount= 2 Cls=e0(wlcon) Sub=01 Prot=03
I:* If#= 0 Alt= 0 #EPs= 1 Cls=e0(wlcon) Sub=01 Prot=03 Driver=(none)
E:  Ad=82(I) Atr=03(Int.) MxPS=   8 Ivl=32ms
I:* If#= 1 Alt= 0 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver=(none)
E:  Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
C:  #Ifs= 2 Cfg#= 2 Atr=a0 MxPwr=500mA
A:  FirstIf#= 0 IfCount= 2 Cls=02(comm.) Sub=06 Prot=00
I:  If#= 0 Alt= 0 #EPs= 1 Cls=02(comm.) Sub=06 Prot=00 Driver=
E:  Ad=82(I) Atr=03(Int.) MxPS=  16 Ivl=32ms
I:  If#= 1 Alt= 0 #EPs= 0 Cls=0a(data ) Sub=00 Prot=00 Driver=
I:  If#= 1 Alt= 1 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver=
E:  Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms

The T10 has its battery removed so can not power up until usb is plugged into router.

This is because the necessary modem driver (most likely kmod-usb-net-rndis) is not installed. Either connect the router to the Internet by other means and install it, or make a custom build with it already installed. When the driver is installed there will be additional log entries as the driver attaches to the modem and creates an eth-like interface named either usbX or ethX.

Also make sure that USB Tethering (or similar) has been enabled through the hotspot's user interface.

Use 192.168.8.1 instead of .1.8. All IPs 192.168.1.X will conflict.

After logging in via ssh, you can use vi to edit the file on the router directly. After getting connected to the Internet you can install a more user-friendly editor like nano.

As you're using T-Mobile you should get to know and love IPv6 since their network uses it primarily.

Connect only one hotspot/modem at a time.

For both devices you need to follow these instructions:
https://openwrt.org/docs/guide-user/network/wan/wwan/ethernetoverusb_rndis

You can change the LAN IP from the GUI as well but you will need to use "Apply unchecked" button.

That may not work very well since (depending on your distance from the cell tower) the radio transmitter can need large pulses of power that exceed the 500 mA available from the USB port. The modem may crash without the battery there to provide reserve power. That is likely the reason for the "USB Disconnect" messages in the log.

1 Like

Thanks guys, great help here. I'll work on getting the needed kmods and post back.

Addressing other points:

Tethering is enabled on all four hotspots and they readily connect to all PCs (all LMDE; we run a Microsoft-free ecosystem) and the RMerlin-flashed router mentioned.

Checking kmods on that router, the key line is:
usbnet used by: cdc_mbim, qmi_wwan, cdc_ncm, rndis_host, cdc_ether, and asix (rndis_host needs only cdc_ether).
Names and scheme not exactly same but helps get the idea.

Did forget the non-conflicting subnet I used there was indeed 192.168.8.x, thanks.
(One-liner sed still much easier than editing manually, esp w/ vi lol. Used:
sed -i s/192.168.1.8/192.168.8.1/ /etc/config/network

Don't think usb ports have any problems supplying adequate power as other router runs flawlessly (and no 'disconnect' errors) plugged into either the usb2 or -3 port.

Checking; usb2 can provide 5v x 0.5A = 2.5W power, plenty enough to provide the FCC max allowed for cell signals (w/ reasonable efficiencies in the support circuitry).

Grabbed a little time to work on this, realized a custom snapshot w/ all needed pkgs would be better than installing 1-by-1.

First tried w/ rndis kmod @mk24 mentioned. (Remembered MS rndis itself is reviled in the open source community, hopefully not long before it goes away.)

Build went ok, flashed it, tried it, didn't work, then found why; several kmods missing. One new line was added to log;

rndis_host 1-2:1.0 usb0: register 'rndis_host' at usb-1e1c0000.xhci-2, RNDIS device, [mac].

So brought out earlier notes for a list of modules (not already present) I'd identified as necessary for hotspot connection:

asix
cdc-acm
cdc-ether
cdc-mbim
cdc-ncm
ehci_hcd
ohci_hcd
qmi-wwan
rndis
wdm

As addon text in the (online) custom build box:

kmod-usb-acm kmod-usb-ehci kmod-usb-net-asix kmod-usb-net-cdc-ether kmod-usb-net-cdc-mbim kmod-usb-net-cdc-ncm kmod-usb-net-qmi-wwan kmod-usb-net-rndis kmod-usb-ohci kmod-usb-wdm

Note some packages pull in others (Ex. rndis gets cdc-ether) so there's some redundancy, but the build script takes care of that without complaint. (Also, I'm not certifying that all of these pkgs are needed, or that the list is complete. It's just the best I can see from observation.)

Well so, the build was doing as expected and looked like it was going to finish when an error pooped up:

opkg_download: Failed to download https://downloads.openwrt.org/snapshots/targets/ramips/mt7621/kmods/6.6.45-1-0208f4d0d60db479c0b6ad38a00e7e10/kmod-phylink_6.6.45-r1_mipsel_24kc.ipk`, wget returned 4.`

Quickly found the error was in error; the file downloads fine. It was just corrupt. (Maybe should say "File corrupt," or "invalid," or...

Anyone can verify by downloading and checking it. Maybe a hiccup while it was being built? IDK but extracted file size shows 10.2k while archive is only 989 bytes. That would be some amazing compression, ya? lol

So does one request a manual repair in cases like this? Or what is proper?

There is no need in building custom image and installing all these modules.
Having the standard firmware running on the router, you only need to load kmod-usb-net-rndis, then a few other modules will be installed automatically as dependencies.

@AndrewZ, thanks but as you can read from above, adding rndis alone doesn't bring in the modules needed to make the hotspots work. It did bring cdc_ether and one other, but many more are missing.

I'm in full agreement that only the bare minimum of packages needed to do a job (in general) should be added.

And of course, it's a lot less work flashing FW that allows immediate use.

The whole way of thinking about router FW still centers around cable providers and IPV4 through the WAN port. But now the excess bandwidth from the cellular infrastructure getting built out has made mobile ISPs competitive.

So it seems that now is the time to start including in standard builds all packages to allow either connection, including hotspots or a phone via usb.

It occurred to me that an earlier version -- with a good phylink file -- could be used as a workaround.

Alas, spot-checking among 22 releases all the way back to 5/24 (at (root)/snapshots/targets/ramips/mt7621/kmods/), all the phylink files are corrupt. Strange this hasn't been reported/fixed for that long.

For funsies, I tried both the other hotspot type and an android phone. None of the three connects.

Success! Tried the custom build again, as above; this time it worked! Thought someone must have fixed phylink, but found it still broken. Instead, it seems to have been removed from the configure list, which allowed the build to complete.

To be clear, all I did was include the kmods that are in similar FW that works. No way will this make the router compatible with all hotspots, but maybe a majority of them. With the 3040/3060 for sure.

Here's the snapshot link:
https://sysupgrade.openwrt.org/store/3dd3348a8fde89f7a7d9e37fbf96b77b/openwrt-776f99ba548e-ramips-mt7621-dlink_dir-3040-a1-squashfs-sysupgrade.bin.

After flashing, the hotspot has to be plugged in, then the WAN and WAN6 interfaces pointed to USB0. That's it, web connection was immediate.

Thanks again to all who helped here, and to all who make this FW possible.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.