USB Tethering
#11
I just checked and I could only get the interface up on the braveheart, not the CE :(
I wanted to try reloading the kernel modules.
Code:
sudo modprobe -r g_multi
sudo /usr/sbin/pinephone-usb-gadget.sh

this works on the BH. but hangs on unloading the module on CE :(
#12
Hotspot works well for me - both ssh and data (which is excellent!).

USB tethering worked for me once, about a month ago, but my CE pinephone hasn't been appearing as a USB device on my laptop with any of the images that I have used recently.
#13
(07-31-2020, 08:20 PM)HLing Wrote: ... I am still unable to use USB tethering, ...

I remain absolutely puzzled why for me it is "easy" and yet others are struggling, so to test my sanity I have just
  1. Downloaded mobian-pinephone-20200802.img.gz & gunzip'd it
  2. dd to an SDcard
  3. Booted the card in my bog standard/no modifications BraveHeart
  4. Noted the root filesystem is automatically resized to the full size of the card
  5. sudo apt update
  6. sudo apt upgrade
  7. sudo apt install pinephone-devtools
  8. rebooted
  9. ip a shows the usb0 device
  10. sudo nmcli connection modify USB-gadget ipv4.method shared
plugged the phone into a laptop running Ubuntu focal - I can now ssh to the pinephone at 10.0.0.2.
The PinePhone has
Code:
$ ip a
...
3: usb0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether b6:37:63:14:4e:67 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::a968:57cb:9c6c:3b2d/64 scope l

The laptop has
Code:
$dmesg
...
[17314.973998] usb 1-1: new high-speed USB device number 4 using xhci_hcd
[17315.123668] usb 1-1: New USB device found, idVendor=1d6b, idProduct=0104, bcdDevice= 5.07
[17315.123672] usb 1-1: New USB device strings: Mfr=3, Product=4, SerialNumber=0
[17315.123675] usb 1-1: Product: Multifunction Composite Gadget
[17315.123677] usb 1-1: Manufacturer: Linux 5.7-pinephone with musb-hdrc
[17315.126977] usb 1-1: can't set config #2, error -71
[17315.127087] usb usb1-port1: disabled by hub (EMI?), re-enabling...
[17315.127117] usb 1-1: USB disconnect, device number 4
[17315.542050] usb 1-1: new high-speed USB device number 5 using xhci_hcd
[17315.690516] usb 1-1: New USB device found, idVendor=1d6b, idProduct=0104, bcdDevice= 5.07
[17315.690519] usb 1-1: New USB device strings: Mfr=3, Product=4, SerialNumber=0
[17315.690521] usb 1-1: Product: Multifunction Composite Gadget
[17315.690522] usb 1-1: Manufacturer: Linux 5.7-pinephone with musb-hdrc
[17315.694571] usb-storage 1-1:2.4: USB Mass Storage device detected
[17315.694727] scsi host2: usb-storage 1-1:2.4
[17315.729564] cdc_acm 1-1:2.2: ttyACM0: USB ACM device
[17315.729836] usbcore: registered new interface driver cdc_acm
[17315.729838] cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters
[17315.736390] cdc_ether 1-1:2.0 usb0: register 'cdc_ether' at usb-0000:00:14.0-1, CDC Ethernet Device, fe:ed:de:ad:be:ef
[17315.736573] usbcore: registered new interface driver cdc_ether
[17315.759643] cdc_ether 1-1:2.0 enxfeeddeadbeef: renamed from usb0
[17315.857865] IPv6: ADDRCONF(NETDEV_CHANGE): enxfeeddeadbeef: link becomes ready
[17316.710926] scsi 2:0:0:0: Direct-Access     Linux    File-Stor Gadget 0507 PQ: 0 ANSI: 2
[17316.711390] sd 2:0:0:0: Attached scsi generic sg0 type 0
[17316.713962] sd 2:0:0:0: Power-on or device reset occurred
[17316.714680] sd 2:0:0:0: [sda] 30785536 512-byte logical blocks: (15.8 GB/14.7 GiB)
[17316.714843] sd 2:0:0:0: [sda] Write Protect is off
[17316.714847] sd 2:0:0:0: [sda] Mode Sense: 0f 00 00 00
[17316.715009] sd 2:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[17316.747322]  sda: sda1 sda2
[17316.748691] sd 2:0:0:0: [sda] Attached SCSI removable disk
[17317.527501] EXT4-fs (sda1): mounted filesystem with ordered data mode. Opts: (null)
[17317.527508] ext4 filesystem being mounted at /media/jane/boot supports timestamps until 2038 (0x7fffffff)
[17317.557582] EXT4-fs (sda2): warning: mounting fs with errors, running e2fsck is recommended
[17317.558659] EXT4-fs (sda2): mounted filesystem with ordered data mode. Opts: (null)
and
Code:
$ ip a
...
3: enxfeeddeadbeef: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP 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 noprefixroute enxfeeddeadbeef
       valid_lft 2316sec preferred_lft 2316sec
    inet6 fe80::3065:79c:94a8:d55a/64 scope link noprefixroute
       valid_lft forever preferred_lft forever

and tethering of my phone data works just fine.

@devrtz - you shouldn't need to assign an ip address to your PC - my phone (after above steps) has dnsmasq-base installed and so is a DNS. But bizarre that your BraceHeart & CE are apparently behaving differently.

For the WiFi hotspot I only need pinephone-devtools installed on a fresh install. (Yup the phosh selections/options can be a pain, switching of fWiFi enables Flight mode, switching off Flight mode enables BlueTooth etc, just cycle round the same screens and you can eventually get it to do what you want!)
  • 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
#14
Hello, folks,

I have this exact problem, and after blowing a weekend on it, I think it's a problem with the 5.7 kernel.

The problem is that the Pinephone would not show up at all in dmesg, nor in the lsusb listings, of the host PC, when it's plugged into USB. The usb0 interface does show up on the phone side, can be configured with an ip address, and the interface can be set to "up", but "ip addr" and ifconfig will still show it as either "state DOWN" or "NO-CARRIER" no matter what.

My Pine Phone is a ubports CE - hardware rev 1.2 - shipped with Ubuntu Touch
My host PC is an amd64 system running Ubuntu Bionic.

There are two ways I //have// gotten this to work with a 5.7 kernel:
* The jumpdrive image works perfectly, as advertised. This uses a configfs implementation, which is completely different than the "g_multi" module most distros seem to be using.
* booting the Ubuntu Touch installed on emmc using volume up + power, which boots the phone into a rescue mode. it looks an awful lot like the Jump drive distro, so it's probably a modification of that.

What hasn't worked:
* postmarketos - with phosh, plasma mobile, fbkeyboard, and shelli interfaces (I was distro-hopping, since I just got my phone last week).
* Mobian image from July 16, using the scripts from the pinephone-devtools package
* Manjaro Alpha1 image from early July
* Attempting to backport the jumpdrive's USB configfs implementation into a Mobian system. It would not produce errors, and would create the usb0 interface, but it would still always be "state DOWN". I was able to blacklist the g_multi kernel module, but that did not help.

The Ubuntu touch distro that shipped with the phone happens to have a 5.6 kernel, but frankly, that distro is so alien to me that I have given even getting an openssh server working on it.

Since a few of you folks thought this used to work, I backtracked and pulled down the Mobian image from Jun 11th. It had the 5.6 kernel. The usb networking worked perfectly!

I'm pleased to know that this is definitely not a hardware issue. I'll leave my results here, and hope more adept kernel hackers than I can make use of it.
#15
Out of curiosity, I did the ip a...

usb0 showed up, <NO-CARRIER, BROADCAST,MULTICAST,UP>
mtu 1500 qdisc pfifo_fast state DOWN group default glen 1000

it's connected to my Mint desktop, so I figured I'd give it a shot ssh 10.0.0.2...
nothing. The terminal just... does nothing til I hit ctrl-C.

I tried pinging 10.0.0.2, and I got ping back with a 13-19 ms ping time.

I did dmesg on my desktop (why not?) and amid the bazillion "irq 4: Affinity broken due to vector space exhaustion, I got 1 message that said:
usb 2-1: reset high-speed USB device number 45 using ehci-pci.
#16
(07-31-2020, 08:20 PM)dukla2000 Wrote: I remain absolutely puzzled why for me it is "easy" and yet others are struggling


I took the comment from @devrtz to indicate that maybe it works with the latest kernel for BH but not for CE?


I submitted an issue for Mobian (https://gitlab.com/mobian1/issues/-/issues/57), but from @Nato's comments looks like it also affects other distributions.
#17
I still have not been able to get my laptop online with USB tethering, even though the web surfing on the pine phone is working flawlessly now. I was reminded of the time when I was trouble shooting the USB tethering of Nokia N9 to the laptop. After trying to create a wired Mobile Broadband access point and failing. I read on the Meego forum to enable developer mode, then with the three option that popped up, select "sync and connect", instead of SDK mode. I tried it. and it connected without any more prompting. No pre-configuring of the Network connections were needed. Might there be a similar way with the Pine phone that I'm not seeing?
#18
(08-28-2020, 12:29 PM)HLing Wrote: I still have not been able to get my laptop online with USB tethering, even though the web surfing on the pine phone is working flawlessly now.  I was reminded of the time when I was trouble shooting the USB tethering  of Nokia N9 to the laptop.  After trying to create a wired  Mobile Broadband access point and failing.  I read on the Meego forum to enable developer mode, then with the three option that popped up, select "sync and connect", instead of SDK mode. I tried it. and it connected without any more prompting.  No pre-configuring of the Network connections were needed.  Might there be a similar way with the Pine phone that I'm not seeing?

Could this relate to the attempts to fix the battery draining by the anx7688 chip?

Apparently in the Braveheart the chip/usb c tethering seems reported to work no problem. However the chip 'hogged the battery' (according to the link below). And it would make sense to disable (I have noticed anx7688 errors in dmesg).

Could there a tradeoff to prevent battery drain from happening when phone is off? Just a theory.

If this were the case it would make sens for usb c tethering to work on Braveheart (with battery drain relation) and not to work to Community Edition UT.

https://xnux.eu/devices/feature/anx7688.html has some info on the hardware issue.
- RTP

"In the beginner's mind there are many possibilities, in the expert's mind there are few." -Shunryu Suzuki


[ Pinephone Original | Pinetab v1 / v2 Enjoyer ]


Linux Device Privacy / Security Playlist



#19
(08-02-2020, 03:23 PM)dukla2000 Wrote:
(07-31-2020, 08:20 PM)HLing Wrote: ... I am still unable to use USB tethering, ...



[*]sudo apt install pinephone-devtools


Code:
   
[*]

i get package 'pinephone-devtools' has no installation candidate
#20
(10-22-2020, 06:34 AM)SJSEng Wrote: ...
i get package 'pinephone-devtools' has no installation candidate
...

If you are running a recent Mobian image (say since 1 October) you don't need to do anything any more: tethering another computer to the PinePhone internet via the PinePhone USB works "out of the box".
  • 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


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

Forum Jump:


Users browsing this thread: 1 Guest(s)