5,597,354 Members 32,935 Now Online
XDA Developers Android and Mobile Development Forum

[SOLVED] How do I enable Nexus 7 USB tether on Jelly Bean?

Tip us?
 
cbdonohue
Old
(Last edited by cbdonohue; 14th September 2012 at 01:38 PM.) Reason: added code block, and question mark
#1  
cbdonohue's Avatar
Junior Member - OP
Thanks Meter 8
Posts: 23
Join Date: Jun 2012
Plug [SOLVED] How do I enable Nexus 7 USB tether on Jelly Bean?

Is there a way compile the JB source so USB tether is enabled?

I made the following modification to frameworks/base/core/res/res/values/config.xml but the Nexus 7 with JB doesn't bring up any USB network interface or show the tethering option in the menu

Code:
 <!-- List of regexpressions describing the interface (if any) that represent tetherable
         USB interfaces.  If the device doesn't want to support tething over USB this should
         be empty.  An example would be "usb.*" -->
    <string-array translatable="false" name="config_tether_usb_regexs">
        <item>"usb0"</item>
    </string-array>
 
the0bserver
Old
#2  
the0bserver's Avatar
Junior Member
Thanks Meter 3
Posts: 14
Join Date: Sep 2012
Location: Köln
Not to be 'that guy', but could you please add a question mark to the title of your thread? I came in here hoping for a solution, not a question
The Following 2 Users Say Thank You to the0bserver For This Useful Post: [ Click to Expand ]
 
espionage724
Old
#3  
espionage724's Avatar
Senior Member
Thanks Meter 494
Posts: 2,466
Join Date: Feb 2010
Location: Charleroi, PA

 
DONATE TO ME
I asked a similar question http://forum.xda-developers.com/show....php?t=1822788

a 3rd-party app may be able to help, but the kernel apparently has to be compiled with CONFIG_NETFILTER/CONFIG_IP_NF_IPTABLES and/or RNDIS


Device Ownership:
 

Current Devices:
None
Side Devices:
Nexus 7 (grouper) (franco.Kernel + Rasbeanjelly)
Galaxy Rush (SPH-M830) (Stock)

Ex Devices:
Galaxy Tab 7.0 (SGH-T849)
Galaxy Tab 2 7.0 (GT-P3113)
Galaxy Prevail (SPH-M820) (KoumaKernel + CTMod)
Nexus 4 (LGE960/mako) (franco.Kernel + RasSaber)
Nexus 10 (GT-P8110/manta) (franco.Kernel + RasSaber
 
cbdonohue
Old
(Last edited by cbdonohue; 10th September 2012 at 09:29 PM.)
#4  
cbdonohue's Avatar
Junior Member - OP
Thanks Meter 8
Posts: 23
Join Date: Jun 2012
Quote:
Originally Posted by espionage724 View Post
I asked a similar question http://forum.xda-developers.com/show....php?t=1822788

a 3rd-party app may be able to help, but the kernel apparently has to be compiled with CONFIG_NETFILTER/CONFIG_IP_NF_IPTABLES and/or RNDIS
I tried using android-wired-tether with a custom kernel that includes netfilter, iptables, and rndis. This still did not work since the application tries to access usb0 directly and the Nexus 7 never creates that interface even with a customized config.xml
 
cbdonohue
Old
(Last edited by cbdonohue; 13th September 2012 at 02:11 PM.)
#5  
cbdonohue's Avatar
Junior Member - OP
Thanks Meter 8
Posts: 23
Join Date: Jun 2012
I was able to get the USB tethering, Wi-Fi hotspot, and Bluetooth tethering options to come up in the menu on the Nexus 7 using the attached overlay placed in device/asus/grouper/overlay/frameworks/base/core/res/res/values/config.xml
The Wi-Fi hotspot and Bluetooth tethering options appear to work.

However, the USB tethering option unchecks itself after a second when I try to activate it.
I get the following error in logcat:
Code:
09-13 13:10:41.820: E/UsbDeviceManager(331): Failed to switch USB config to rndis,adb
Attached Thumbnails
Click image for larger version

Name:	device-2012-09-13-085841.jpg
Views:	2970
Size:	16.6 KB
ID:	1323547  
Attached Files
File Type: zip config.zip - [Click for QR Code] (3.0 KB, 558 views)
The Following User Says Thank You to cbdonohue For This Useful Post: [ Click to Expand ]
 
cbdonohue
Old
(Last edited by cbdonohue; 13th September 2012 at 02:55 PM.)
#6  
cbdonohue's Avatar
Junior Member - OP
Thanks Meter 8
Posts: 23
Join Date: Jun 2012
I am happy to announce I got native USB tethering working on the Nexus 7

I had to make the changes to the config.xml as shown in the previous post and also had to modify out/target/product/grouper/root/init.usb.rc by adding the following

Code:
on property:sys.usb.config=rndis
    write /sys/class/android_usb/android0/enable 0
    write /sys/class/android_usb/android0/idVendor 18d1
    write /sys/class/android_usb/android0/idProduct 4e23
    write /sys/class/android_usb/android0/functions ${sys.usb.config}
    write /sys/class/android_usb/android0/bDeviceClass 224
    write /sys/class/android_usb/android0/enable 1
    setprop sys.usb.state ${sys.usb.config}

on property:sys.usb.config=rndis,adb
    write /sys/class/android_usb/android0/enable 0
    write /sys/class/android_usb/android0/idVendor 18d1
    write /sys/class/android_usb/android0/idProduct 4e24
    write /sys/class/android_usb/android0/functions ${sys.usb.config}
    write /sys/class/android_usb/android0/bDeviceClass 224
    write /sys/class/android_usb/android0/enable 1
    start adbd
    setprop sys.usb.state ${sys.usb.config}
I'm also using a modified tegra kernel with RNDIS options activated...not sure if this is required (I'm assuming it is). I will try the stock kernel later.
The Following 5 Users Say Thank You to cbdonohue For This Useful Post: [ Click to Expand ]
 
espionage724
Old
#7  
espionage724's Avatar
Senior Member
Thanks Meter 494
Posts: 2,466
Join Date: Feb 2010
Location: Charleroi, PA

 
DONATE TO ME
That is good news indeed


Device Ownership:
 

Current Devices:
None
Side Devices:
Nexus 7 (grouper) (franco.Kernel + Rasbeanjelly)
Galaxy Rush (SPH-M830) (Stock)

Ex Devices:
Galaxy Tab 7.0 (SGH-T849)
Galaxy Tab 2 7.0 (GT-P3113)
Galaxy Prevail (SPH-M820) (KoumaKernel + CTMod)
Nexus 4 (LGE960/mako) (franco.Kernel + RasSaber)
Nexus 10 (GT-P8110/manta) (franco.Kernel + RasSaber
 
trevd
Old
#8  
Recognized Developer
Thanks Meter 1132
Posts: 862
Join Date: Jul 2011
Location: Hull

 
DONATE TO ME
Default Props to You!

Quote:
Originally Posted by cbdonohue View Post
I was able to get the USB tethering, Wi-Fi hotspot, and Bluetooth tethering options to come up in the menu on the Nexus 7 using the attached overlay placed in device/asus/grouper/overlay/frameworks/base/core/res/res/values/config.xml
The Wi-Fi hotspot and Bluetooth tethering options appear to work.

However, the USB tethering option unchecks itself after a second when I try to activate it.
I get the following error in logcat:
Code:
09-13 13:10:41.820: E/UsbDeviceManager(331): Failed to switch USB config to rndis,adb
Nice work and quick as well, I do like those overlays, there is plenty of nice tweaks to be had out of them if folks are willing to put the effort in.

I built my own overlay earlier on after you planted the seed and was quite surprised to get Wifi-Hotspot for free. It does work, well my HTC Sensation connects to it, which is quite amusing as Cm10 on the sensation doesn't have a working WifiHotspot I think a bit of cross device hacking is in order there

Quote:
Originally Posted by cbdonohue View Post
I'm also using a modified tegra kernel with RNDIS options activated...not sure if this is required (I'm assuming it is). I will try the stock kernel later.
I think this is my missing link, I was going to have a proper look at some point and you've saved me a job there, I'll build myself a fresh kernel now and see if it is the case.

Don't forget to click Thanks If this post has helped. It gives me a little warm feeling inside

I WILL NOT RESPOND TO PM'S REQUESTING TECHNICAL SUPPORT


Development Work: Git Hub (https://github.com/trevd) | Huawei Dongle Support : Archos G9 , Asus Nexus 7 | adb extended version ( adbx ) [Always WIP] | The No Script, No Cygwin Standalone Boot Image Utility [WIP]
Other Work : Custom framework-res.apk resources.arsc using vendor overlays | [GUIDE][HACK]Cross Compiling for OSX on Linux with AOSP

A bug report without logs is just trivia!

Code:
adb shell dmesg ; adb logcat -b system -b radio -b events -b main
 
espionage724
Old
#9  
espionage724's Avatar
Senior Member
Thanks Meter 494
Posts: 2,466
Join Date: Feb 2010
Location: Charleroi, PA

 
DONATE TO ME
So does this require both a modified (before compile) Kernel and ROM?


Device Ownership:
 

Current Devices:
None
Side Devices:
Nexus 7 (grouper) (franco.Kernel + Rasbeanjelly)
Galaxy Rush (SPH-M830) (Stock)

Ex Devices:
Galaxy Tab 7.0 (SGH-T849)
Galaxy Tab 2 7.0 (GT-P3113)
Galaxy Prevail (SPH-M820) (KoumaKernel + CTMod)
Nexus 4 (LGE960/mako) (franco.Kernel + RasSaber)
Nexus 10 (GT-P8110/manta) (franco.Kernel + RasSaber
 
cbdonohue
Old
(Last edited by cbdonohue; 14th September 2012 at 01:45 PM.)
#10  
cbdonohue's Avatar
Junior Member - OP
Thanks Meter 8
Posts: 23
Join Date: Jun 2012
Quote:
Originally Posted by espionage724 View Post
So does this require both a modified (before compile) Kernel and ROM?
After talking with trevd, I am pretty confident you need to modify the .config created by "make tegra3_android_defconfig" so the RNDIS driver is in the kernel. I won't be able to compare the stock kernel to my modified one until the weekend (I only have one Nexus 7 and have to do other testing with it). The .config file I used for my modified tegra kernel is attached.

So yes, modify the kernel and Jelly Bean source. I can certainly help anyone if they run into trouble.

I plan on putting up flashable images when I can and submitting a patch to cyanogen.
Attached Files
File Type: zip tegra_config.zip - [Click for QR Code] (20.0 KB, 364 views)

Tags
bluetooth, jelly bean, tethering, usb, wi-fi
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes