Welcome to XDA

Search to go directly to your device's forum

Register an account

Unlock full posting privileges

Ask a question

No registration required
Post Reply

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

OP cbdonohue

10th September 2012, 02:15 PM   |  #1  
cbdonohue's Avatar
OP Junior Member
Thanks Meter: 8
 
25 posts
Join Date:Joined: Jun 2012
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>
Last edited by cbdonohue; 14th September 2012 at 02:38 PM. Reason: added code block, and question mark
10th September 2012, 04:44 PM   |  #2  
the0bserver's Avatar
Junior Member
Flag Köln
Thanks Meter: 3
 
19 posts
Join Date:Joined: Sep 2012
Smile
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: [ View ]
10th September 2012, 10:14 PM   |  #3  
espionage724's Avatar
Senior Member
Flag Charleroi, PA
Thanks Meter: 521
 
2,524 posts
Join Date:Joined: Feb 2010
Donate to Me
More
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
10th September 2012, 10:23 PM   |  #4  
cbdonohue's Avatar
OP Junior Member
Thanks Meter: 8
 
25 posts
Join Date:Joined: Jun 2012
Quote:
Originally Posted by espionage724

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
Last edited by cbdonohue; 10th September 2012 at 10:29 PM.
13th September 2012, 02:59 PM   |  #5  
cbdonohue's Avatar
OP Junior Member
Thanks Meter: 8
 
25 posts
Join Date:Joined: 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:	3229
Size:	16.6 KB
ID:	1323547  
Attached Files
File Type: zip config.zip - [Click for QR Code] (3.0 KB, 630 views)
Last edited by cbdonohue; 13th September 2012 at 03:11 PM.
The Following User Says Thank You to cbdonohue For This Useful Post: [ View ]
13th September 2012, 03:45 PM   |  #6  
cbdonohue's Avatar
OP Junior Member
Thanks Meter: 8
 
25 posts
Join Date:Joined: 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.
Last edited by cbdonohue; 13th September 2012 at 03:55 PM.
The Following 5 Users Say Thank You to cbdonohue For This Useful Post: [ View ]
13th September 2012, 03:53 PM   |  #7  
espionage724's Avatar
Senior Member
Flag Charleroi, PA
Thanks Meter: 521
 
2,524 posts
Join Date:Joined: Feb 2010
Donate to Me
More
That is good news indeed
13th September 2012, 04:25 PM   |  #8  
Recognized Developer
Flag Hull
Thanks Meter: 1,193
 
876 posts
Join Date:Joined: Jul 2011
Donate to Me
More
Props to You!
Quote:
Originally Posted by cbdonohue

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

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.

14th September 2012, 03:42 AM   |  #9  
espionage724's Avatar
Senior Member
Flag Charleroi, PA
Thanks Meter: 521
 
2,524 posts
Join Date:Joined: Feb 2010
Donate to Me
More
So does this require both a modified (before compile) Kernel and ROM?
14th September 2012, 02:32 PM   |  #10  
cbdonohue's Avatar
OP Junior Member
Thanks Meter: 8
 
25 posts
Join Date:Joined: Jun 2012
Quote:
Originally Posted by espionage724

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, 399 views)
Last edited by cbdonohue; 14th September 2012 at 02:45 PM.

Post Reply Subscribe to Thread

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

Advanced Search
Display Modes