USB Tethering
#1
I've tried to get USB tethering working on the pinephone without much success.

I followed the steps here (https://wiki.mobian-project.org/doku.php?id=tweaks) a while ago (I think with the 5.6 kernel) and I was able to SSH into the pinephone via USB, but couldn't actually get my laptop to access the internet through the pinephone.

Since installing the new 5.7 kernel, the laptop no longer even sees the pinephone. Is it possible to have USB tethering / SSH access, or is this now not possible with the current kernel? My pinephone is fully updated using apt upgrade and I also have pinephone-devtools installed.
#2
(07-19-2020, 12:22 AM)scott_VYuCAbn3k1NFK Wrote: I've tried to get USB tethering working on the pinephone without much success.

I followed the steps here (https://wiki.mobian-project.org/doku.php?id=tweaks) a while ago (I think with the 5.6 kernel) and I was able to SSH into the pinephone via USB, but couldn't actually get my laptop to access the internet through the pinephone.

Since installing the new 5.7 kernel, the laptop no longer even sees the pinephone. Is it possible to have USB tethering / SSH access, or is this now not possible with the current kernel? My pinephone is fully updated using apt upgrade and I also have pinephone-devtools installed.

Sorry so long to reply - tethering your mobile data connection via USB to your PC still works just fine. In addition to installing pinephone-devtools, type
Code:
sudo nmcli connection modify USB-gadget ipv4.method shared
in a Kings Cross terminal session.
  • ROCKPro64 v2.1 2GB, 16Gb eMMC for rootfs, SX8200Pro 512GB NVMe for /home, HDMI video & sound, Bluetooth keyboard & mouse. Arch (6.2 kernel, Openbox desktop) for general purpose daily PC.
  • PinePhone Pro Explorer Edition, daily driver, rk2aw & U-boot on SPI, Arch/SXMO & Arch/phosh on eMMC
  • PinePhone BraveHeart now v1.2b 3/32Gb, Tow-boot with Arch/SXMO on eMMC
#3
Thanks for your reply - I've tried that but it hasn't changed anything.
(An apt autoremove somehow deleted kings cross - but I have installed xfce terminal, which seems to work, and I've been running the commands in that.)

When running `dmesg -w` (on the laptop) and connecting the pinephone there is no output at all - nor is there any change to `lsusb`.

I've also tried connecting with a different uSB cable with no difference.

On the pinephone, the gadget device is present when running `ip a`.

Is there anything else I can try / check to debug this issue?
#4
(07-22-2020, 03:44 AM)scott_VYuCAbn3k1NFK Wrote: ...
On the pinephone, the gadget device is present when running `ip a`.

Is there anything else I can try / check to debug this issue?

It shouldn't be too complicated - all I do to get it working is
  1. Fresh Mobian install
  2. Install pinephone-devtools
  3. Set to USB-gadget sharing with the nmcli command
And no, I don't do any of the other stuff in the wiki! I have a BraveHeart, and have no hardware mods.

A newly booted pinephone will show the usb0 device as DOWN. As soon as I plug into any PC it goes to state UP and takes IP (v4) address 10.0.0.2. If I plug it into my RockPro64 directly I get (on the RockPro)
Code:
$ dmesg
...
[ 4082.325663] rockchip-vop ff900000.vop: [drm:vop_crtc_enable] Update mode to 1920x1080p60, type: 11
[ 9960.730261] usb 3-1: new high-speed USB device number 2 using xhci-hcd
[ 9960.859278] usb 3-1: New USB device found, idVendor=1d6b, idProduct=0104
[ 9960.859313] usb 3-1: New USB device strings: Mfr=3, Product=4, SerialNumber=0
[ 9960.859336] usb 3-1: Product: Multifunction Composite Gadget
[ 9960.859358] usb 3-1: Manufacturer: Linux 5.7-pinephone with musb-hdrc
[ 9960.868821] cdc_ether 3-1:2.0 usb0: register 'cdc_ether' at usb-xhci-hcd.10.auto-1, CDC Ethernet Device, fe:ed:de:ad:be:ef
[ 9960.934008] usb usb3-port1: disabled by hub (EMI?), re-enabling...
[ 9960.934613] usb 3-1: USB disconnect, device number 2
[ 9960.935041] cdc_ether 3-1:2.0 usb0: unregister 'cdc_ether' usb-xhci-hcd.10.auto-1, CDC Ethernet Device
[ 9960.970722] usbcore: registered new interface driver cdc_acm
[ 9960.970733] cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters
[ 9960.976004] usbcore: registered new interface driver usb-storage
[ 9960.979307] usbcore: registered new interface driver uas
[ 9961.302267] usb 3-1: new high-speed USB device number 3 using xhci-hcd
[ 9961.431268] usb 3-1: New USB device found, idVendor=1d6b, idProduct=0104
[ 9961.431304] usb 3-1: New USB device strings: Mfr=3, Product=4, SerialNumber=0
[ 9961.431327] usb 3-1: Product: Multifunction Composite Gadget
[ 9961.431349] usb 3-1: Manufacturer: Linux 5.7-pinephone with musb-hdrc
[ 9961.441621] cdc_ether 3-1:2.0 usb0: register 'cdc_ether' at usb-xhci-hcd.10.auto-1, CDC Ethernet Device, fe:ed:de:ad:be:ef
[ 9961.447195] cdc_acm 3-1:2.2: ttyACM0: USB ACM device
[ 9961.458100] usb-storage 3-1:2.4: USB Mass Storage device detected
[ 9961.459005] scsi host0: usb-storage 3-1:2.4
[ 9961.498205] cdc_ether 3-1:2.0 enxfeeddeadbeef: renamed from usb0
[ 9961.603690] cdc_ether 3-1:2.0 enxfeeddeadbeef: kevent 12 may have been dropped
[ 9962.460707] scsi 0:0:0:0: Direct-Access     Linux    File-Stor Gadget 0507 PQ: 0 ANSI: 2
[ 9962.471889] sd 0:0:0:0: [sda] 30785536 512-byte logical blocks: (15.8 GB/14.7 GiB)
[ 9962.472521] sd 0:0:0:0: [sda] Write Protect is off
[ 9962.472553] sd 0:0:0:0: [sda] Mode Sense: 0f 00 00 00
[ 9962.473155] sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[ 9962.487454]  sda: sda1 sda2
[ 9962.492952] sd 0:0:0:0: [sda] Attached SCSI removable disk
[ 9966.031388] EXT4-fs (sda2): warning: mounting fs with errors, running e2fsck is recommended
[ 9966.038344] EXT4-fs (sda2): Errors on filesystem, clearing orphan list.

[ 9966.038375] EXT4-fs (sda2): recovery complete
[ 9966.040604] EXT4-fs (sda2): mounted filesystem with ordered data mode. Opts: (null)

and
Code:
$ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UNKNOWN group default qlen 1000
    link/ether 4e:d9:eb:5f:b2:85 brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.154/24 brd 192.168.1.255 scope global dynamic eth0
       valid_lft 33219sec preferred_lft 33219sec
    inet6 fd12:dca2:57f1::197/128 scope global noprefixroute
       valid_lft forever preferred_lft forever
    inet6 fd12:dca2:57f1:0:4cd9:ebff:fe5f:b285/64 scope global mngtmpaddr noprefixroute
       valid_lft forever preferred_lft forever
    inet6 fe80::4cd9:ebff:fe5f:b285/64 scope link
       valid_lft forever preferred_lft forever
4: enxfeeddeadbeef: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UNKNOWN group default qlen 1000
    link/ether fe:ed:de:ad:be:ef brd ff:ff:ff:ff:ff:ff
    inet 10.0.0.142/8 brd 10.255.255.255 scope global dynamic enxfeeddeadbeef
       valid_lft 3568sec preferred_lft 3568sec
    inet6 fe80::fced:deff:fead:beef/64 scope link
       valid_lft forever preferred_lft forever

I did see some suggestion that the red USB-C cable that ships with the PinePhone is power only: certainly in my case that is NOT true. Indeed the above result was with my red cable. But in case there were different batches maybe try another cable? Otherwise I am at a loss.
  • ROCKPro64 v2.1 2GB, 16Gb eMMC for rootfs, SX8200Pro 512GB NVMe for /home, HDMI video & sound, Bluetooth keyboard & mouse. Arch (6.2 kernel, Openbox desktop) for general purpose daily PC.
  • PinePhone Pro Explorer Edition, daily driver, rk2aw & U-boot on SPI, Arch/SXMO & Arch/phosh on eMMC
  • PinePhone BraveHeart now v1.2b 3/32Gb, Tow-boot with Arch/SXMO on eMMC
#5
(07-22-2020, 03:44 AM)scott_VYuCAbn3k1NFK Wrote: ...
On the pinephone, the gadget device is present when running `ip a`.

Is there anything else I can try / check to debug this issue?

On my phone, after I have plugged it into anything I have
Code:
$ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: wlan0: <BROADCAST,MULTICAST> mtu 1500 qdisc mq state DOWN group default qlen 1000
    link/ether 6e:5e:ab:da:0d:5e brd ff:ff:ff:ff:ff:ff permaddr 02:ba:27:38:4f:69
3: usb0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether a2:3d:b0:20:50:72 brd ff:ff:ff:ff:ff:ff
    inet 10.0.0.2/8 brd 10.255.255.255 scope global noprefixroute usb0
       valid_lft forever preferred_lft forever
    inet6 fe80::67a8:4afd:c24c:a76b/64 scope link noprefixroute
       valid_lft forever preferred_lft forever
4: wwan0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1358 qdisc pfifo_fast state UNKNOWN group default qlen 1000
    link/none
    inet 10.71.124.196/29 brd 10.71.124.199 scope global noprefixroute wwan0
       valid_lft forever preferred_lft forever

and can of course ssh to mobian@10.0.0.2 just fine as well.
  • ROCKPro64 v2.1 2GB, 16Gb eMMC for rootfs, SX8200Pro 512GB NVMe for /home, HDMI video & sound, Bluetooth keyboard & mouse. Arch (6.2 kernel, Openbox desktop) for general purpose daily PC.
  • PinePhone Pro Explorer Edition, daily driver, rk2aw & U-boot on SPI, Arch/SXMO & Arch/phosh on eMMC
  • PinePhone BraveHeart now v1.2b 3/32Gb, Tow-boot with Arch/SXMO on eMMC
#6
Thanks for your help - unfortunately I'm still not having any luck with this.

I re-flashed the mobian 16/7 image, and then ran `sudo apt update && sudo apt upgrade`. There were a few issues with this process however, apt hung at some point, and I had to do a `dpkg-reconfigure -a` and then continue installing.

The red cord that I have definitely has data connections -  when I booted the UT bootloader (UT is still on the internal MMC, remove SD card, hold volume up + power), the mmc drives show up on my laptop as mountable devices.

My output on the phone is different to yours,
`ip a` shows
"3: usb0: <NO_CARRIER,BROADCAST,MULTICAST,UP>" - then the rest looks the same except for "state DOWN".

This doesn't change when I connect the cable.

I also had a pmOS sd card that I booted (by accident) but the laptop seemed to immediately register that as a USB device, so I don't think there are hardware problems.
#7
Am following with interest. I am unable to do USB tethering to get my laptop online. I do not have the USB pins modified, so am relieved that Dukla22000 mentioned he doesn't, either. so, do I have to update the AANX7688 firm ware as stated on this page? https://xnux.eu/devices/feature/anx7688.html
Thank you!
#8
(07-27-2020, 09:48 PM)HLing Wrote: ...
so,  do I have to update the AANX7688 firm ware as stated on this page? https://xnux.eu/devices/feature/anx7688.html
No - just install pinephone-devtools and use nmcli to update the USB-gadget permissions as per post #2 above.
  • ROCKPro64 v2.1 2GB, 16Gb eMMC for rootfs, SX8200Pro 512GB NVMe for /home, HDMI video & sound, Bluetooth keyboard & mouse. Arch (6.2 kernel, Openbox desktop) for general purpose daily PC.
  • PinePhone Pro Explorer Edition, daily driver, rk2aw & U-boot on SPI, Arch/SXMO & Arch/phosh on eMMC
  • PinePhone BraveHeart now v1.2b 3/32Gb, Tow-boot with Arch/SXMO on eMMC
#9
(07-31-2020, 02:04 AM)Olsyri Wrote: Hi,

I tried to create a WiFi Hotspot (from Mobian WiKi considering USB tethering is not working and will probably not work on the Community Edition) and I can connect to the new created hotspot to share the 4G Internet access but there is no Internet access from the WiFi hotspot (and like for USB tethering, there will probably not work on the Community Edition). The only 4G access working is from the Pinephone himself, trying to share using USB tethering or WiFi hotspot failed. Is there another way to get access to my 4G data from the Pinephone?

Thanks
Olsyri, I am still unable to use USB tethering, but I was once able to use my cell phone as  WIFI Hotspot to get my laptop on the internet. It was pretty fast, too.  I enabled it by going to the 3 dot menu on the upper right corner, and select the middle option: "Turn on Wifi Hotspot", it generates a password, I somehow tap it again, and it generated another password which I used to get on line.  Alas, the next day, when I went to do it, the middle option was grayed out. I'm not sure what happened.  Just now, (this afternoon I had to take out my sim from the pinephone because it wasn't receiving text) as I looked at that option (without a sim card in it) it was again selectable (not grayed out).  I will have to try it again once I get my phones charged.
#10
Regarding usb0 being DOWN: I just had to add an ip address to the usb interface on my PCs side:
sudo ip addr add dev usb0 10.0.0.3/8
This worked for my Pinephone being connected to the Pinebook


Possibly Related Threads…
Thread Author Replies Views Last Post
  sharing mobile data through usb tethering deb75 7 5,435 02-26-2022, 08:52 AM
Last Post: Zebulon Walton
  need my usb tethering back HLing 12 11,246 08-02-2021, 10:13 AM
Last Post: biketool

Forum Jump:


Users browsing this thread: 8 Guest(s)