Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Android 2.2 USB Tethering Tips
View unanswered posts
View posts from last 24 hours

Goto page 1, 2  Next  
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
comprookie2000
Retired Dev
Retired Dev


Joined: 25 Jul 2004
Posts: 925
Location: Sun City Center, Florida

PostPosted: Sun Sep 05, 2010 2:01 pm    Post subject: Android 2.2 USB Tethering Tips Reply with quote

With an Android 2.2 (Froyo) it is easy to tether your phone to your Gentoo box.
First enable the modules you need;
Device Drivers
USB Network Adaptors
Code:

Device Drivers --->
  [*] Network device support --->
    USB Network Adapters --->
      [*] Multi-purpose USB Networking Framework
        <*> CDC Ethernet support
        <*> CDC EEM support
        <*> Simple USB Network Links (CDC Ethernet subset)
          [*] Embedded ARM Linux links
  [*] USB Support --->
    <*> USB Modem (CDC ACM) support
    <*> USB Wireless Device Management support

Code:

lsmod
Module                  Size  Used by
rndis_host              5868  0
cdc_ether               4265  1 rndis_host
usbnet                 16196  2 rndis_host,cdc_ether
mii                     4038  1 usbnet

The interface shows up as usb0
Code:

usb0      Link encap:Ethernet  HWaddr fa:c6:01:4c:4b:71 
          BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

dmesg
Code:

scsi 10:0:0:0: Direct-Access     Google,  Inc.Nexus One         PQ: 0 ANSI: 2
sd 10:0:0:0: Attached scsi generic sg3 type 0
sd 10:0:0:0: [sdc] Attached SCSI removable disk
usb 1-7: USB disconnect, address 10
usb 1-7: new high speed USB device using ehci_hcd and address 11
usbcore: registered new interface driver cdc_ether
rndis_host 1-7:1.0: usb0: register 'rndis_host' at usb-0000:00:02.1-7, RNDIS device, fa:c6:01:4c:4b:71
usbcore: registered new interface driver rndis_host

Next on your phone or device enable USB Tethering.
That is when you can see from dmesg that the device changed from a usb storage device to new interface driver.
Then it is as simple as;
Code:

dhcpcd usb0

Thanks to bugmenot :D
https://forums.gentoo.org/viewtopic-t-843045-highlight-usb+tethering.html
_________________
http://dev.gentoo.org/~dabbott/


Last edited by comprookie2000 on Thu May 05, 2011 12:37 am; edited 1 time in total
Back to top
View user's profile Send private message
likewhoa
l33t
l33t


Joined: 04 Oct 2006
Posts: 778
Location: Brooklyn, New York

PostPosted: Sun Sep 05, 2010 3:16 pm    Post subject: Reply with quote

thanks for this.
Back to top
View user's profile Send private message
andriy155
n00b
n00b


Joined: 05 Feb 2006
Posts: 65
Location: Kyiv, Ukraine

PostPosted: Mon Dec 13, 2010 10:47 am    Post subject: Reply with quote

Thanks a lot! This really helped me with my Nokia N900. Apparently, you need the same driver (enable the same module in kernel) for N900 and it works.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


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

PostPosted: Mon Jan 17, 2011 7:34 pm    Post subject: Reply with quote

comprookie2000,

Thanks - I was trying to use the USB Gadget Interface, which always failed to load.
_________________
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
billium
Apprentice
Apprentice


Joined: 22 Mar 2003
Posts: 185

PostPosted: Sat Mar 12, 2011 1:19 am    Post subject: Reply with quote

Thanks comprookie2000 .. this also worked for me on a Nexus One, Gingerbread. :)
Back to top
View user's profile Send private message
stemer
n00b
n00b


Joined: 23 Jul 2005
Posts: 31
Location: Poznań

PostPosted: Tue Mar 22, 2011 2:50 pm    Post subject: Reply with quote

What about reverse USB tethering? Have anyone tried to do that with Network Manager? I.e. I want to share my wire connected laptop with my Android 2.2 phone through USB cable. I have HTC Desire Z and USB tethering works flawlessly, but I cannot do it in the other way.

PS. Sorry for my bad english ;)
_________________
"Lubię dostawać listy. W listach są różne wyrazy."
Back to top
View user's profile Send private message
tbD
n00b
n00b


Joined: 16 Jun 2011
Posts: 1
Location: new york city

PostPosted: Thu Jun 16, 2011 9:58 pm    Post subject: having trouble tethering Reply with quote

I have enabled all the kernel option mentioned. I first did them inline as the post showed * not M.
I also tried modules since the post showed lsmod.

In both cases the usb interface was not established (I did make the net.usb0-->net.lo symlink).

When I tell the phone to connect as a disk, that works perfectly. But when I tell it to support mobile broadband, I do not get the dmesg output shown and dhcpcd usb0 fails. I believe this is all due to my not getting the usb0 interface. I am running 2.6.39 on a ~amd64 gentoo system.

My phone is an htc droid incredible.

Any help would be greatly appreciated.
allan
Back to top
View user's profile Send private message
Gusar
Advocate
Advocate


Joined: 09 Apr 2005
Posts: 2665
Location: Slovenia

PostPosted: Fri Jun 17, 2011 5:52 pm    Post subject: Reply with quote

Ah, so that's how this works with Android - rndis_host (with it's dependencies cdc_ether and usbnet). Good to know in case I'll need it. On my old Nokia phone you'd instead use usbserial, which would give you a /dev/ttyUSB0 and then you'd use ppp with that. Worked with bluetooth to, except the device was /dev/rfcomm0 in that case.

Quite funny, considering the text in the kernel config says rndis shouldn't be used because it's some evil Microsoft thingy.
Back to top
View user's profile Send private message
swathe
n00b
n00b


Joined: 04 Jul 2011
Posts: 73

PostPosted: Thu Jul 07, 2011 9:41 am    Post subject: Reply with quote

I normally use the wifi tether but I will definitely give this a go, thanks.
Back to top
View user's profile Send private message
Martux
Veteran
Veteran


Joined: 04 Feb 2005
Posts: 1917

PostPosted: Thu Jul 07, 2011 6:22 pm    Post subject: Reply with quote

Very nice, thanks. I also compiled everything into the kernel but usb0 isn't showing up.
Dmesg is not showing any switch when tethering is enabled.
Android 2.3.4 CM7 and gentoo-sources-2.6.39-r2 ~amd64 here.
Anything missing?
_________________
"Coincidence is God's way of remaining anonymous."
Albert Einstein
"The road to success is always under construction"
Back to top
View user's profile Send private message
stelth
n00b
n00b


Joined: 25 May 2006
Posts: 45

PostPosted: Mon Jul 11, 2011 5:38 pm    Post subject: Reply with quote

Martux wrote:
Very nice, thanks. I also compiled everything into the kernel but usb0 isn't showing up.
Dmesg is not showing any switch when tethering is enabled.
Android 2.3.4 CM7 and gentoo-sources-2.6.39-r2 ~amd64 here.
Anything missing?


I had enabled all of the modules in the original post and couldn't get usb0 to show up either. I slimmed it down to just:
Code:
CONFIG_USB_USBNET=m
CONFIG_USB_NET_CDCETHER=m
CONFIG_USB_NET_RNDIS_HOST=m

and it came right up.

They're the options under:
Code:
│     -> Device Drivers                                                           
│       -> Network device support (NETDEVICES [=y])
│         -> USB Network Adapters


EDIT:
If you get the choice on the phone for either Mac OSX or Windows tethering, choose Windows tethering.
_________________
Quote:
And on the 3rd day, God created the Remington bolt-action rifle; so that man could fight the dinosaurs and the homosexuals. AMEN.
Back to top
View user's profile Send private message
Martux
Veteran
Veteran


Joined: 04 Feb 2005
Posts: 1917

PostPosted: Fri Jul 15, 2011 8:07 am    Post subject: Reply with quote

Thanks!
Even if I compile in as modules, everything loads fine except rndis_host.
I cannot seem to find this one. Even a grep over the kernel config file showed no result.
Where is this little bugger hidden?
_________________
"Coincidence is God's way of remaining anonymous."
Albert Einstein
"The road to success is always under construction"
Back to top
View user's profile Send private message
Gusar
Advocate
Advocate


Joined: 09 Apr 2005
Posts: 2665
Location: Slovenia

PostPosted: Fri Jul 15, 2011 11:48 am    Post subject: Reply with quote

Martux wrote:
Where is this little bugger hidden?

Code:
-> Device Drivers
  -> Network device support
    -> USB Network Adapters
      -> Multi-purpose USB Networking Framework
        -> Host for RNDIS and ActiveSync devices (EXPERIMENTAL)
Back to top
View user's profile Send private message
Martux
Veteran
Veteran


Joined: 04 Feb 2005
Posts: 1917

PostPosted: Sat Jul 16, 2011 2:52 am    Post subject: Reply with quote

There is no such option under my 2.6.39-gentoo-r2 kernel :(
_________________
"Coincidence is God's way of remaining anonymous."
Albert Einstein
"The road to success is always under construction"
Back to top
View user's profile Send private message
comprookie2000
Retired Dev
Retired Dev


Joined: 25 Jul 2004
Posts: 925
Location: Sun City Center, Florida

PostPosted: Sat Jul 16, 2011 8:25 am    Post subject: Reply with quote

How about this;
http://linuxcrazy.com/downloads/Screenshot-root@amd64testbox:-usr-src-linux.png
_________________
http://dev.gentoo.org/~dabbott/
Back to top
View user's profile Send private message
SlashBeast
Retired Dev
Retired Dev


Joined: 23 May 2006
Posts: 2922

PostPosted: Sat Jul 16, 2011 1:32 pm    Post subject: Reply with quote

Click '/' in menuconfig and type what you are looking for, like RNDIS_HOST then look at 'depends on' line, here you see what you need to enable to have it, sometimes option may be not visiable in menuconfig until you enable some deps. Very common.
Back to top
View user's profile Send private message
phd
n00b
n00b


Joined: 12 Oct 2005
Posts: 68
Location: Warszawa (Poland)

PostPosted: Sat Jul 23, 2011 12:58 pm    Post subject: Reply with quote

I confirm that the usb tethering from HTC WildFire works.
For a new udev I have a symlink net.lo to net.enp0s29f7u2 . I activate internet by means
Code:
dhcpcd enp0s29f7u2

By the way, in my case the following options are not essential
Quote:

[] USB Support --->
<> USB Modem (CDC ACM) support
<> USB Wireless Device Management support


Last edited by phd on Thu May 02, 2013 7:43 pm; edited 3 times in total
Back to top
View user's profile Send private message
Martux
Veteran
Veteran


Joined: 04 Feb 2005
Posts: 1917

PostPosted: Sat Aug 06, 2011 4:53 pm    Post subject: Reply with quote

Back from vacation.
Well, I can search the kernel config for
CONFIG_USB_NET_RNDIS_HOST
and it will show where to find it:
Code:

Symbol: USB_NET_RNDIS_HOST [=n]                                            │   
  │ Type  : tristate                                                           │   
  │ Prompt: Host for RNDIS and ActiveSync devices (EXPERIMENTAL)               │   
  │   Defined at drivers/net/usb/Kconfig:277                                   │ 
  │   Depends on: NETDEVICES [=y] && USB [=y] && NET [=y] && USB_USBNET [=y] & │   
  │   Location:                                                                │   
  │     -> Device Drivers                                                      │   
  │       -> Network device support (NETDEVICES [=y])                          │   
  │         -> USB Network Adapters                                            │   
  │           -> Multi-purpose USB Networking Framework (USB_USBNET [=y])      │   
  │   Selects: USB_NET_CDCETHER [=y]                                           │   
  │   Selected by: USB_NET_RNDIS_WLAN [=n] && NETDEVICES [=y] && WLAN [=y]


But when I browse there, it isn't there :(
I suppose my config is somewhat broken, I always generate a new kernel config with "make oldconfig".
Is there any way to repair it, without having to configure the whole kernel?
_________________
"Coincidence is God's way of remaining anonymous."
Albert Einstein
"The road to success is always under construction"
Back to top
View user's profile Send private message
comprookie2000
Retired Dev
Retired Dev


Joined: 25 Jul 2004
Posts: 925
Location: Sun City Center, Florida

PostPosted: Sat Aug 06, 2011 5:47 pm    Post subject: Reply with quote

Are you sure you are satisfying;
"Depends on: NETDEVICES [=y] && USB [=y] && NET [=y] && USB_USBNET [=y] "
_________________
http://dev.gentoo.org/~dabbott/
Back to top
View user's profile Send private message
Martux
Veteran
Veteran


Joined: 04 Feb 2005
Posts: 1917

PostPosted: Sat Aug 06, 2011 5:53 pm    Post subject: Reply with quote

Seems so:
cat/usr/src/linux/.config gave this:
Code:

CONFIG_USB_USBNET=y
CONFIG_NET=y
CONFIG_NETDEVICES=y

_________________
"Coincidence is God's way of remaining anonymous."
Albert Einstein
"The road to success is always under construction"
Back to top
View user's profile Send private message
Martux
Veteran
Veteran


Joined: 04 Feb 2005
Posts: 1917

PostPosted: Sat Aug 06, 2011 5:55 pm    Post subject: Reply with quote

A grep for CONFIG_USB_NET_RNDIS_HOST gives nothing.
_________________
"Coincidence is God's way of remaining anonymous."
Albert Einstein
"The road to success is always under construction"
Back to top
View user's profile Send private message
comprookie2000
Retired Dev
Retired Dev


Joined: 25 Jul 2004
Posts: 925
Location: Sun City Center, Florida

PostPosted: Sat Aug 06, 2011 6:36 pm    Post subject: Reply with quote

try;
<M> Multi-purpose USB Networking Framework
that should then open up so you can see;
<M> Host for RNDIS and ActiveSync devices (EXPERIMENTAL)

This is from 3.0.0
_________________
http://dev.gentoo.org/~dabbott/
Back to top
View user's profile Send private message
Martux
Veteran
Veteran


Joined: 04 Feb 2005
Posts: 1917

PostPosted: Sat Aug 06, 2011 6:43 pm    Post subject: Reply with quote

Yes, I believe you that it should be there, but it isn't :(
This is all I get to see under "USB Network Adapters ":
Code:

<M> Multi-purpose USB Networking Framework                                                           │ │   
  │ │                               < >   ASIX AX88xxx Based USB 2.0 Ethernet Adapters                                                   │ │   
  │ │                               <M>   CDC Ethernet support (smart devices such as cable modems)                                      │ │   
  │ │                               <M>   CDC NCM support                                                                                │ │   
  │ │                               < >   Davicom DM9601 based USB 1.1 10/100 ethernet devices                                           │ │   
  │ │                               < >   SMSC LAN75XX based USB 2.0 gigabit ethernet devices                                            │ │   
  │ │                               < >   SMSC LAN95XX based USB 2.0 10/100 ethernet devices                                             │ │   
  │ │                               < >   GeneSys GL620USB-A based cables                                                                │ │   
  │ │                               < >   NetChip 1080 based cables (Laplink, ...)                                                       │ │   
  │ │                               < >   MosChip MCS7830 based Ethernet adapters                                                        │ │   
  │ │                               <M>   Simple USB Network Links (CDC Ethernet subset)                                                 │ │   
  │ │                               [ ]     ALi M5632 based 'USB 2.0 Data Link' cables                                                   │ │   
  │ │                               [ ]     AnchorChips 2720 based cables (Xircom PGUNET, ...)                                           │ │   
  │ │                               [*]     eTEK based host-to-host cables (Advance, Belkin, ...)                                        │ │   
  │ │                               [*]     Embedded ARM Linux links (iPaq, ...)                                                         │ │   
  │ │                               [ ]     Epson 2888 based firmware (DEVELOPMENT)                                                      │ │   
  │ │                               < >   Sharp Zaurus (stock ROMs) and compatible                                                       │ │   
  │ │                               < >   Conexant CX82310 USB ethernet port                                                             │ │   
  │ │                               < >   Samsung Kalmia based LTE USB modem                                                             │ │   
  │ └───────────────────────────────v(+)───────────────────────────────────────────────────────────
< >   Samsung Kalmia based LTE USB modem                                                             │ │   
  │ │                               < > Option USB High Speed Mobile Devices                                                             │ │   
  │ │                               < > Intellon PLC based usb adapter                                                                   │ │   
  │ │                               < > Apple iPhone USB Ethernet driver                                                                 │ │   
  │ │                               < > USB-to-WWAN Driver for Sierra Wireless modems                                                    │ │   
  │ │                               < > LG VL600 modem dongle           

Probably my config is really messed, this is from 3.9 too... Is there a way to insert those options manually in the configuration file?
_________________
"Coincidence is God's way of remaining anonymous."
Albert Einstein
"The road to success is always under construction"
Back to top
View user's profile Send private message
comprookie2000
Retired Dev
Retired Dev


Joined: 25 Jul 2004
Posts: 925
Location: Sun City Center, Florida

PostPosted: Sat Aug 06, 2011 8:48 pm    Post subject: Reply with quote

do any (EXPERIMENTAL) drivers show up, maybe there is an option to open them up not sure
_________________
http://dev.gentoo.org/~dabbott/
Back to top
View user's profile Send private message
Martux
Veteran
Veteran


Joined: 04 Feb 2005
Posts: 1917

PostPosted: Sun Aug 07, 2011 6:49 pm    Post subject: Reply with quote

There are only those options available that are shown in my last post :(
_________________
"Coincidence is God's way of remaining anonymous."
Albert Einstein
"The road to success is always under construction"
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
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