Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Android USB Tethering [SOLVED]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
Efo
Guru
Guru


Joined: 23 Jun 2005
Posts: 494

PostPosted: Thu Aug 21, 2014 3:00 am    Post subject: Android USB Tethering [SOLVED] Reply with quote

Hi guys,

I am trying to set up usb tethering with my android phone (motorola moto g 4.4.2).

I tried to follow wiki , but ifconfig -a does not show any usb network.

dmesg:
Code:

[77714.237978] usb 1-6: new high-speed USB device number 7 using ehci-pci


lsusb -v:
Code:

Bus 001 Device 007: ID 22b8:2e82 Motorola PCS
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0
  bDeviceProtocol         0
  bMaxPacketSize0        64
  idVendor           0x22b8 Motorola PCS
  idProduct          0x2e82
  bcdDevice            2.28
  iManufacturer           1 motorola
  iProduct                2 XT1032
  iSerial                 3 #########
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           39
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0
    bmAttributes         0x80
      (Bus Powered)
    MaxPower              500mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           3
      bInterfaceClass       255 Vendor Specific Class
      bInterfaceSubClass    255 Vendor Specific Subclass
      bInterfaceProtocol      0
      iInterface              4 MTP
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x01  EP 1 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x82  EP 2 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x001c  1x 28 bytes
        bInterval               6
Device Qualifier (for other device speed):
  bLength                10
  bDescriptorType         6
  bcdUSB               2.00
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0
  bDeviceProtocol         0
  bMaxPacketSize0        64
  bNumConfigurations      1
Device Status:     0x0000
  (Bus Powered)


Here something that may be relevant:
If I use my usb port with a memory stick I find the device in /dev/sdb1; if I plug the phone in the same port to access the storage I cannot find the device.

As usual, any help is highly appreciated.

Efo


Last edited by Efo on Fri Mar 06, 2015 6:13 am; edited 1 time in total
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54216
Location: 56N 3W

PostPosted: Thu Aug 21, 2014 5:15 pm    Post subject: Reply with quote

Efo,

The easy one first. Your phone uses the FAT filesystem. You cannot have it mounted in two places at the same time.
To see the phone as USB storage, you need to unmount the storage from the phone.

My HTC raises a pop up to ask what I want to do when I connect it to my PC.

USB tethering is harder. You will need CDC support, PPP support and either Ethernet over USB support or usbserial support.
Your phone will either show up as a couple of USB serial ports, one of which acts like a 56k modem, only faster, or you will get a new interface in ifconfig -a.
Normally it would bu usb0 but udev is sure to rename for you.

Its possible that the kernel does not know your Vendor and 0x22b8 and Product 0x2e82 IDs, so you may need a small kernel patch.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
s4e8
Guru
Guru


Joined: 29 Jul 2006
Posts: 311

PostPosted: Thu Aug 21, 2014 11:59 pm    Post subject: Reply with quote

Your phone provide a MTP device only, you need to enable USB network sharing under the WIFI-AP menu. On Linux side, you should enable CONFIG_USB_NET_CDCETHER and CONFIG_NET_RNDIS_HOST.
Back to top
View user's profile Send private message
Efo
Guru
Guru


Joined: 23 Jun 2005
Posts: 494

PostPosted: Fri Aug 22, 2014 3:43 am    Post subject: Reply with quote

Hi all and thank you for your help,

s4e8:
thank you for the tip, it looks like it is MTP and PTP only. CONFIG_USB_NET_CDCETHER and CONFIG_NET_RNDIS_HOST were alreade set as modules.

I ended up using mtpfs:
1) connected moto g to my computer and made sure it was on MTP in settings -> storage -> "USB computer connection" (from top right menu)
2) got product and vendor id (can use lsusb -v or mtp-detect), my device is 22b8:2e82 (see above)
3) added
SUBSYSTEM=="usb", ATTR{idVendor}=="22b8", ATTR{idProduct}=="2e82", MODE="0666"
to /etc/udev/rules.d/80-android.rules
4) uncommented "user_allow_other" in /etc/fuse.conf
5) rebooted
6) now I can mount it as: mtpfs -o allow_other /mnt/usb


NeddySeagoon:
thanks for the info here is what I have:

grep CDC .config
Code:

CONFIG_USB_NET_CDCETHER=m
CONFIG_USB_NET_CDC_EEM=m
CONFIG_USB_NET_CDC_NCM=m
# CONFIG_USB_NET_HUAWEI_CDC_NCM is not set
# CONFIG_USB_NET_CDC_MBIM is not set
CONFIG_USB_NET_CDC_SUBSET=m


grep PPP .config
Code:
 
CONFIG_PPP=m
CONFIG_PPP_BSDCOMP=m
CONFIG_PPP_DEFLATE=m
CONFIG_PPP_FILTER=y
CONFIG_PPP_MPPE=m
CONFIG_PPP_MULTILINK=y
CONFIG_PPPOATM=m
CONFIG_PPPOE=m
CONFIG_PPP_ASYNC=m
CONFIG_PPP_SYNC_TTY=m
CONFIG_HDLC_PPP=m


Something missing?

By the way, if you know how to tether over bluetooth it is even better. I tried that first with butbluetoothctl, but I just couldnt connect it (it would pair easily, but not connect).
Back to top
View user's profile Send private message
s4e8
Guru
Guru


Joined: 29 Jul 2006
Posts: 311

PostPosted: Fri Aug 22, 2014 5:15 am    Post subject: Reply with quote

You must enable ethernet sharing on the phone side. When you plug you phone, you may
1. pop up a choice of MTP, PTP, USB storage, or mobile network, etc.., you should choose mobile network.
2. or enable USB tethering inside system settings --> more --> tethering & mobile hotspot.
Back to top
View user's profile Send private message
Efo
Guru
Guru


Joined: 23 Jun 2005
Posts: 494

PostPosted: Fri Aug 22, 2014 5:28 am    Post subject: Reply with quote

s4e8,

when I plug the phone in I have only MTP and PTP options (carriers tend to block tethering and such on the phones that they provide nowadays), same for settinge --> more (no tethering and mobile hotspot)

I am just trying to get some tethering working for very occasional use. I am not sure whether these options are disabled in the kernel or not...
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum