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

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>

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

I asked a similar question http://forum.xda-developers.com/showthread.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

espionage724 said:
I asked a similar question http://forum.xda-developers.com/showthread.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
Click to expand...
Click to collapse
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

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

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.

That is good news indeed

Props to You!
cbdonohue said:
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
Click to expand...
Click to collapse
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 :laugh: I think a bit of cross device hacking is in order there
cbdonohue said:
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.
Click to expand...
Click to collapse
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.
:good:

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

espionage724 said:
So does this require both a modified (before compile) Kernel and ROM?
Click to expand...
Click to collapse
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.

cbdonohue said:
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
Click to expand...
Click to collapse
Would love to use your overlay.
Where exactly do I find the above mentioned path?
When I connect Nexus 7 to my Mac and see the file structure, it is missing the device/asus/grouper/overlay/frameworks/base/core/res/res/values/config.xml

retfeg said:
Would love to use your overlay.
Where exactly do I find the above mentioned path?
When I connect Nexus 7 to my Mac and see the file structure, it is missing the device/asus/grouper/overlay/frameworks/base/core/res/res/values/config.xml
Click to expand...
Click to collapse
You need to modify the files in the Jelly Bean source code and recompile the operating system.

@cbdonohue:
Hey! Do you think you could upload your kernel/framework files to use in the mean time?

I'm very curious and I have asked this so many times and no one has answered me.
Why would you want to tether your device? your device cant and does note generate its own Mobile internet service like a 3G/4G device. its wifi only so why would you want to share your devices wireless connectivity?
the only thing I can think of is if you have a desktop or laptop that does NOT have a wireless card and you want to use your Nexus 7 as a wireless card essentially and then plugging it in via USB to your desktop/laptop?
what other reason could you have for wanting to share your devices wireless connectivity?

nextelbuddy said:
I'm very curious and I have asked this so many times and no one has answered me.
Why would you want to tether your device? your device cant and does note generate its own Mobile internet service like a 3G/4G device. its wifi only so why would you want to share your devices wireless connectivity?
the only thing I can think of is if you have a desktop or laptop that does NOT have a wireless card and you want to use your Nexus 7 as a wireless card essentially and then plugging it in via USB to your desktop/laptop?
what other reason could you have for wanting to share your devices wireless connectivity?
Click to expand...
Click to collapse
You can reverse-tether a device in order to get connectivity from your PC. This is what I'm looking to accomplish with my device while I'm at work so I can access the company intranet.

ObsidianX said:
You can reverse-tether a device in order to get connectivity from your PC. This is what I'm looking to accomplish with my device while I'm at work so I can access the company intranet.
Click to expand...
Click to collapse
^ This.

ObsidianX said:
@cbdonohue:
Hey! Do you think you could upload your kernel/framework files to use in the mean time?
Click to expand...
Click to collapse
1. Download the tegra kernel branch android-tegra3-grouper-3.1-jb-fr2 and compile using the attached defconfig. (This enables the RNDIS driver)
2. Download grouper branch android-4.1.1_r1.1 and copy the compiled tegra kernel into it.
3. Modify the following grouper file with the attached config.xml (This allows the 'Tether to USB' option to come up in the settings')
device/asus/grouper/overlay/frameworks/base/core/res/res/values/config.xml
4. Compile grouper
5. Modify the following file with the attached init.usb.rc (This allows the OS to enable RNDIS USB tethering)
out/target/product/grouper/root/init.usb.rc
6. Flash to device.
At some point in the future I can make a flashable image or patch that will make this easier. In the mean time these steps should do it. Let me know if you have any issues.

nextelbuddy said:
I'm very curious and I have asked this so many times and no one has answered me.
Why would you want to tether your device? your device cant and does note generate its own Mobile internet service like a 3G/4G device. its wifi only so why would you want to share your devices wireless connectivity?
the only thing I can think of is if you have a desktop or laptop that does NOT have a wireless card and you want to use your Nexus 7 as a wireless card essentially and then plugging it in via USB to your desktop/laptop?
what other reason could you have for wanting to share your devices wireless connectivity?
Click to expand...
Click to collapse
One reason would be If you wanted to communicate between a PC and an Android device without being wireless. This could be to hide the connection or reduce the impact of RF interference. Not all applications need internet access...it might be just to send data between two end points.

USB interface and addressing specifics
For those of you who are interested...
If the Nexus 7 is acting as a USB device you can turn USB tethering on from the settings menu. The Android device automatically assigns its USB interface a hard coded IP address and starts DHCP server to hand out an address to the USB host at the other end.
If you want to change the IP address that the Android assigns itself you can modifiy the USB_NEAR_IFACE_ADDR constant in following file:
frameworks/base/services/java/com/android/server/connectivity/Tethering.java
If you want to disable the DHCP server, you can simply remove the address space you are using from the mDhcpRange array in the same file.
If the Nexus 7 is acting as a USB host (using USB OTG) then you must manually bring up the USB interface (ifconfig rndis0 x.x.x.x) since the USB menu settings will not do anything.
As an aside, am I the only one surprised to find hard coded IP addresses deep in the Android code?! haha
I've found some other gems like "shoud not get here" lines and c/c++ goto statements.

Hey folks,
I took cbdonohue's modifications and built them into CM10 and it works like a charm! I took the liberty of uploading the ZIP to dev-host:
http://d-h.st/KIr
All credit goes to cbdonohue for finding and creating the modification. I just built it

Related

Internet Tethering via USB??

Internet Tethering over USB? Is that something that was added with 1.6 or is that Eclair functionality? I notice it is in the CyanogenMod latest builds.
How does it work in comparison to bluetooth or wifi tether?
Does it require root?
TIA
What do you mean work in comparison, it's wired and the others are wireless. Speeds shouldn't depend on connection.
If you install cyanogen's build, then you have root so it shouldn't matter as you have it already. There is an application wired tether for root users, name explains.
I don't think it is in the AOSP build, so it was added by him or whoever he gives credit to.
There are 2 different Tethers for root users
Wired - Means u gotta connect your usb to your computer
Wireless - This will create an Ad Hoc wireless connection to your computer (no cable required)
This was added by cyanogen and is not part of eclair
nephron said:
There are 2 different Tethers for root users
Wired - Means u gotta connect your usb to your computer
Wireless - This will create an Ad Hoc wireless connection to your computer (no cable required)
This was added by cyanogen and is not part of eclair
Click to expand...
Click to collapse
What I was originally asking I guess was if the Wired USB tethering was now standard issue in Android 1.6 or 2.0 and as such was available to non-root users. From your response, I understand that is incorrect, and that wired tethering via USB was added by CM in the CM builds and therefore implicitly requires root.
Thanks for clarifying that for me!
If you wanted a non rooted version, search the market -there are several that don't require root.
so...
how is this done exactly on cyanogens rom? i cant find anything about it after searching for about an hour...
mr_brain said:
how is this done exactly on cyanogens rom? i cant find anything about it after searching for about an hour...
Click to expand...
Click to collapse
Yeah me and some people on another thread figured it out......
But first things first you need Windows XP service pack 3 or Windows Vista or Windows 7... I dont know about Mac.....
but Windows Xp is different than Vista or 7 because you need to download HTC sync to get the drivers for your G1 to be reconized as a modem..... Do not mount your G1..... once you have HTC sync installed you do not need to run it..... but now when you connect your G1 just check the internet tethering box and it should work(unless I missed a step)...
OK With Vista and Windows 7 the drivers are preloaded into the OS s do NOT need to download HTC synce... You just need to connect your phone do NOT mount and check the tehtering box... it should work....
is there a certain version for the G1 that I need?
Reverse tether g1 to pc network over usb cable
My android os is CyanogenMod 4.2.14.1,
1.Enable "Settings\Wireless controls\Internet tethering"
2.Install HTC Remote NDIS based Device driver(View attachment 277122)
3.Set the HTC adapter as: IP:192.168.2.1, Mask:255.255.255.0
4.Set the PC ethercard as shared connection
5.Run these codes in terminal:
su
ifconfig usb0 192.168.2.2 netmask 255.255.255.0
busybox route delete default
iptables -F
iptables -F -t nat
busybox route add default gw 192.168.2.1
setprop net.dns1 8.8.8.8
setprop "net.gprs.http-proxy" ""
6.Now your g1 could open browser to view any web pages on the internet, and update apps in the Market.
for diyism
just wanted to say that
This works on Nexus One as well!
The routing stuff disuse posted, I mean.
The only problem is that I can't download stuff from the market yet. But hopefully I'll find a solution to this soon.
Thanks a lot! I've been looking for this for like a whole week.
I think I'll write an app which will just run this as a shell script.
thanks again!
XBOX PS3 Wii anyone????
can someone please tell us or provide a step-by-step on how to have gaming consoles tether the device's web connectivity...or in other words how to make my xbox 360 connect to the web by tethering my device's internet....PLEASE PLEASE...I SWEAR I BUY BEER...I BUY BEER !!!
Reverse tethering not working with Play Store
GuShPaNdA said:
This works on Nexus One as well!
The routing stuff disuse posted, I mean.
The only problem is that I can't download stuff from the market yet. But hopefully I'll find a solution to this soon.
Thanks a lot! I've been looking for this for like a whole week.
I think I'll write an app which will just run this as a shell script.
thanks again!
Click to expand...
Click to collapse
Sure, I've seen before two attempts of reverse tethering with this approach with the same problem: Play Store stays "Downloading" or "Waiting for network" but It doesn't work. I've tried also my own method with the same results: Play Store is not working.
I think this has something to do with the way Play Store app is testing for Internet conectivity. Since it doesn't know if you've got one, it doesn't let you download nothing.
Maybe there is some Android SDK API call to flag the system that Internet connection is up? Any other clue?

TBH NVRAM Hack and USB Tether

Since the TBH (thank you!!) NVRAM hack fixes the NAI that gets created for your MIP profile, there is no need for NAI manipulation at the application level with apps such as easytether.
My question is:
What is the suggested method for USB tether after removing the ".dun" from your NAI?
Ideally Im looking for RNDIS based tethering since its built into Windows 7 and most flavors of Linux. Its also simple to install a RNDIS driver on XP. It seems way less invasive to me then having to install a client application.
I have done some searching but have not found any USB RNDIS based tethering solution that works. Have working kernel modules been created (like the working tun.ko) that can be used to enable this?
Thanks
PleaseStirMe
Yes, search this forum for tun.ko as there is a post a few under yours where someone posted a working version of the tun.ko and a config.ko file as well.
Sent from my DROIDX using XDA App
Thanks SysAdmin but tun.ko is the not kernel module I am looking for. tun.ko is used to enable VPN. I am wondering if anyone has made a similar kernel module to enable RNDIS tether.
PleaseStirMe
All you need to do to enable USB tethering in Windows is edit the build.prop to get Phone as Modem to be included in the USB notification dropdown menu.
Simply edit the line ro.modem_available=0 to ro.modem_available=1.
Then reboot and connect the phone to the PC and select Phone as Modem from the drop menu.
You will get a notification that internal data will be disabled.
Open Network and Sharing Center and create a new DialUpNetworking connection and configure as follows:
User Name: [email protected] where the Xs are your 10 digit MDN.
Password: vzw
Number to Dial: #777
Save and hit connect and you're done.
cellzealot
Thanks for your reply. Pretty sure you have helped me in the past too.
That was not the exact solution I was looking for but it is a nice option since in windows can automatically open the connection when you launch your browser. I used to use that same DUN method with my e815.
PleaseStirMe
I realize that it's not RNDIS but it works fine and no client is required.
And yes, this hack dates back to the old days of e815 hacking and if you were hanging around the VZW Motorola forum on HoFo back then you might know me as kbman.
PleaseStirMe said:
Thanks SysAdmin but tun.ko is the not kernel module I am looking for. tun.ko is used to enable VPN. I am wondering if anyone has made a similar kernel module to enable RNDIS tether.
PleaseStirMe
Click to expand...
Click to collapse
You're right, my apologies! I believe that was for openVPN, and I had read something else similar earlier that day! Thnx to cellzealot for the info as well!
Sent from my DROIDX using XDA App

[GUIDE] Reverse Tethering Wildfire --> Internet Pass Through

My First Guide. Hope it Helps..
HOW TO REVERSE TETHER YOUR PHONE / INTERNET PASS THROUGH​
Reverse Tethering / Internet Pass through is the method in which you can make your android phone use the internet connection of your computer without a WIFI and by using a usb cable. It is helpful for those people who don’t have a WIFI at their place and for those who don’t have a good internet plan for their mobile.
BASIC REQUIREMENTS​
Rooted Phone With S-OFF
SuperUser [QR Code]
BusyBox [QR Code]
Terminal Emulator [QR Code]
Windows O.S. [I am using Win-7]
USB Cable for your phone
THE PROCESS​
Connect Your Android Phone to your PC. Make sure you are rooted and have terminal emulator installed. Turn on USB Tethering from
SETTINGS -> WIRELESS AND NETWOKRS -> TETHERING AND PORTABLE HOTSPOT -> USB TETHERING.
Screen
Next you will get a new connection in your PC. Open Networking and Sharing Center from
CONTROL PANEL -> NETWORK AND SHARING CENTER
You get a scene in a similar manner.
Screen
Now There will be one connection which will be your Main Net Connection and the Other one will be your Android Phone’s Created Connection for tethering. Click on your main net connection i.e. the one you use for Connecting to net Local Area Connection(in my case).
You will get the following screen.
Screen
Now click on Properties.After this click on sharing and tick on Allow other network users to connect through this computer’s internet connection and click ok for any dialog box shown and click ok to come back to the main networking screen.
Screen
Now click on the new connection made by the android phone Local Area Connection 2 (in my case)
You will get the following screen
Screen
Click on properties. Then go to Internet Protocol version 4(TCP/IPv4) and click on properties.
Screen
Now You need to enter 192.168.2.1 in IP address and enter 255.255.255.0 in Subnet mask and keep remaining things empty.
Screen
PART ON THE PHONE​
NOTE:- ALL CODES HAVE TO BE WRITTEN WITHOUT QUOTES
Open Android Terminal on the Phone and type "su". Provide it superuser permissions.
Screen
Now type “ifconfig usb0 192.168.2.2 netmask 255.255.255.0”
Screen
“busybox route delete default”
Screen
You may get an error here but it does not matter.
Now type “iptables –F –t nat”(* -F in caps is must)
Then type “busybox route add default gw 192.168.2.1”
Screen
“setprop net.dns1 8.8.8.8”
Next (setprop “net.gprs.http-proxy” “” ) [*Note :- here the code is written in bracket to avoid confusion.. The quotes(“”) are required.
Screen
CONGRATS.... YOU ARE DONE!!
RESULTS​
Works on Android Browser.(FOR ME)
Works on Opera & Opera Mini.
Works on XDA Premium App.
DOES NOT Work on Android Market.(Finding a Solution... if anyone gets it working please tell)
You may need to repeat this process each time you connect the phone to PC.
Works even without a SIM inserted.
Nice guide
To enable the market click settings under the sharing tab and add a new service called market with the port number 5228.
how use other app for internet
No resolution
currently m using a wildfire and cannot switch on USB tethering until mobile network is connected followed all the steps but no luck
I am also a wildfire user. I did so many searching for reverse usb tethering, what I searched for were similar to the script of this thread. I follow all the steps but also not success.
I did do some searching, I just GUESS the main problem is the router at my home. My computer access the modem via router, maybe the router cannot give my WF a IP so my WF cannot access the internet? I dunno.
I didn't try access the internet with my computer connecting directly via modem without router since my home wire connection is so so so so complicated, but I believe that it will success. Would somebody try it and share your experience?
I think you can write a batch file for this. Using netsh and adb it would be easily done just from PC
thanks for the guide worked for me.
Problem though is that after i turned off the tethering and disconnected my phone from the pc then reconnect it again just to check if it works the 2nd time, if found that usb tethering is having an error and does not turn on.
question is how to disable this or how i disconnect my phone from pc the right way? well after restarting, tethering is again ok and
I did it on linux!
The configuration on the PC is next:
Code:
echo 1 > /proc/sys/net/ipv4/ip_forward
ifconfig usb0 192.168.2.1 netmask 255.255.255.0
iptables -A POSTROUTING -t nat -s 192.168.2.1/24 -o wlan0 -j MASQUERADE
On the phone same az you did, but I had to edit
Code:
setprop net.dns1 8.8.8.8
to match my DNS server i.e.
Code:
setprop net.dns1 87.120.131.2
worked !!!!!!!!!!!!!
After about two months of searching I finally found this guide which makes it work. Thanks a lot! Surfing everything is fine but downloads just don't start (market or browser) I'm using G2x by the way so I guess this should work for most people.
meknb said:
Nice guide
To enable the market click settings under the sharing tab and add a new service called market with the port number 5228.
Click to expand...
Click to collapse
I did this which enabled me to browse the market. It won't download anything. I even forwarded the port on my broadband modem and the downloads don't start. Just keep saying "Starting downloading..."
How to make a script for apps like script manager so we do not have to keep typing the configs everytime we restart our phone?
URLs instead of QR Codes, please.
rahuliyer95 said:
[*]SuperUser [QR Code]
[*]BusyBox [QR Code]
[*]Terminal Emulator [QR Code]
Click to expand...
Click to collapse
Anyone with URLs to the above, please? I don't have a QR code scanner
mnongkhlaw said:
Anyone with URLs to the above, please? I don't have a QR code scanner
Click to expand...
Click to collapse
https://market.android.com/details?...wsMSwxLDEsImNvbS5ub3NodWZvdS5hbmRyb2lkLnN1Il0.
https://market.android.com/details?...t=W251bGwsMSwxLDEsInN0ZXJpY3Nvbi5idXN5Ym94Il0.
https://market.android.com/details?...251bGwsMSwxLDEsImphY2twYWwuYW5kcm9pZHRlcm0iXQ..
Thank you!
rahulparekh said:
https://market.android.com/details?...wsMSwxLDEsImNvbS5ub3NodWZvdS5hbmRyb2lkLnN1Il0.
https://market.android.com/details?...t=W251bGwsMSwxLDEsInN0ZXJpY3Nvbi5idXN5Ym94Il0.
https://market.android.com/details?...251bGwsMSwxLDEsImphY2twYWwuYW5kcm9pZHRlcm0iXQ..
Click to expand...
Click to collapse
Thanks, does it work with Market, email etc? Have you used it with Samsung Galaxy S2?
mnongkhlaw said:
Thanks, does it work with Market, email etc? Have you used it with Samsung Galaxy S2?
Click to expand...
Click to collapse
This method actually stopped working for me after I reflashed CM7 on my phone. (TMobile G2X). It doesn't work with market but I think ASProxy makes it work.
rahulparekh said:
It doesn't work with market but I think ASProxy makes it work.
Click to expand...
Click to collapse
What is ASProxy ?
method worked good all apps working...
i can browse through market also but when select download option downloading and freezes.. what could be problem ??
mnongkhlaw said:
What is ASProxy ?
Click to expand...
Click to collapse
It's a proxy app which supposedly allows all Google apps to work on reverse tethering and such. Search the market for it.
rahulparekh said:
It's a proxy app which supposedly allows all Google apps to work on reverse tethering and such. Search the market for it.
Click to expand...
Click to collapse
Do you mind a tutorial on how to get ASProxy to work?
mudkipstar said:
Do you mind a tutorial on how to get ASProxy to work?
Click to expand...
Click to collapse
I haven't had a chance to use the app as reverse tethering stopped working for me before I got the app.

Nexus 7 - WiFi Ad-Hoc fix for wpa_supplicant?

Update March 25, 2013:
Solved!! The folks over at Thinktube Inc. have developed a fix and submitted it to CyanogenMod and AOSP for merging into their code:
http://b-real.org/2013/ad-hoc-ibss-m...h-cyanogenmod/
http://www.thinktube.com/android-tech/46-android-wifi-ibss
Essentially the EASIEST solution is to ROOT your phone, and install the CyanogenMod nightly as of March 25 or later (note: you will have to wait until the nightly is actually BUILT, since as of today it is not ready yet).
I have not tested this solution out myself, however others within this thread have confirmed it working.
Please if anyone develops a easier patch or a step-by-step for people who do NOT want to use CyanogenMod, post and I will update the OP
Cheers!
WiKiD24
-------------------------------------------------------
Update Oct 9, 2012:
- Nexus 7 v4.1.2 did not add Wi-Fi Ad-Hoc Support with the stock update from Google.
To do: Check if any WPA-Supplicant changes previously tested in v4.1.1 now work in 4.1.2
- Workaround (Recommended): Bluetooth Tethering to Nexus 7 Tablet (via Bluetooth DUN Profile). "BlueVPN" from Google Play Store.
Tested successfully on many Nokia Symbian phones (N7, E71, E72), and others.
However, many applications on Nexus 7 Tablet do not support it (without fixes from the developers)
Confirmed working applications:
- Pulse
- Google Chrome
- Dolphin Browser
- Facebook
- Ebuddy
- Youtube
- Others (I am too lazy to add them all)
Confirmed NOT working applications:
- Gmail
- Email
- Google Search
- Google Play Store
- Dropbox
- Words with Friends
- Scramble with Friends
- Others (I am too lazy to add them all)
More details can be found here: http://forum.xda-developers.com/showpost.php?p=29763582&postcount=27
Issue: Sometimes the phone/tablet do not connect (randomly), due to issues with either the phone or the tablet.
To resolve: Turn on and off bluetooth on phone, Turn on & off bluetooth on tablet. Try again. If does not work, reboot phone and tablet and try again. Should work.
-Workaround: Android Phone to Nexus 7 Tablet (via "FoxFI" App on Phone, "FoxFi Addon" App on Tablet, or via "PDANet", or via "Wireless Tether App")
http://forum.xda-developers.com/showpost.php?p=29763582&postcount=27
- Workaround: USB Tethering ANY Phone to Nexus 7 Tablet (via "PPP Widget" App on Tablet, requires rooted Nexus 7)
http://forum.xda-developers.com/showpost.php?p=32431103&postcount=51
- Workaround: Windows WiFi Laptop Tethering to Nexus 7 Tablet
http://www.youtube.com/watch?v=klHzMyYFGeQ
-------------------------------------------------------
Hi All,
I've just recently gotten a Nexus 7 and need to be able to enable Ad-Hoc wifi on the tablet.
I also own a Asus TF101 and previously had the same problem however there was a fix for that.
The solution was to replace the wpa_supplicant file in the /system/bin folder, however I do not know the code to change it.
If anyone has the technical know-how, they would be able to reverse-engineer it and apply the same fix.
http://forum.xda-developers.com/showthread.php?t=1370955
http://szym.net/2010/12/adhoc-wifi-in-android/
http://www.slatedroid.com/topic/2752...less-hotspots/
http://www.olsr.org/?q=olsr_on_android
http://hostap.epitest.fi/gitweb/gitw...upplicant.conf
I posted a possible solution in QnA section. Thread title is similar to this one. Check it out. Doesn't involve any coding. Prime had a similar issue on a few firmware updates. This was solved for us(before Asus came around to enabling it themselves) by adding in a wifi supplicant file and renaming an older one. Then setting permissions on the new file. Here is the link to that thread. There's a good chance it will work without the file needing to be modded. It came from a galaxy tab LR something and worked fine on prime. Its worth checking out.
http://forum.xda-developers.com/showthread.php?t=1438297
thanks for the tip and I tried it out, which is essentially the same type of solution but it didn't think work as there is no wpa_supplicant2 file in the nexus 7.
http://forum.xda-developers.com/showthread.php?t=1777413
here's some more useful information for enabling ad hoc:
http://szym.net/2010/12/adhoc-wifi-in-android/
http://www.slatedroid.com/topic/27522-howto-connect-to-ad-hoc-wireless-hotspots/
http://www.olsr.org/?q=olsr_on_android
http://hostap.epitest.fi/gitweb/git...ob_plain;f=wpa_supplicant/wpa_supplicant.conf
I'm doing what I can right now to try and enable it.
Some more experienced android users whom know what they're doing would be better than me trying it out, though!!
Did any of those sources of information get you any closer to enabling ad-hoc?
Just FYI that Nexus S "ad hoc enabling file" doesn't work on NS with Jelly Bean.
nexususer0101 said:
Did any of those sources of information get you any closer to enabling ad-hoc?
Click to expand...
Click to collapse
None yet, I need some help to do so. There is a file called "wpa_cli" that I need copied from another device, because I can't find it on the internet.
If anyone could find it in their "/system/bin" folder and attach it to this tread, I could certainly try it.
I've also requested the same thing in the Q&A forum here: http://forum.xda-developers.com/showthread.php?t=1793437
Bumping; I have the same condition. I'm in Italy and bought an internet package for my laptop--I'm sharing it with all my other devices but the N7 doesn't see the adhoc connection. Like OP said, I had a Transformer TF101 and remember flashing a file to fix it.
Thanks in advance.
Just an FYI: Also checked my GNex for a wpa_cli and came up empty.
Just wanted to give quick update, i have not been able to find anyone to help me and also my life is kinda hectic right now... Hopefully someone will be able to pick up where I left off, in the meantime my nexus 7 is pretty much useless to me until resolved.
One more "me too".
I'm here to share my sympathy to everyone else's pain as I have a nexus 7 that I can't connect to my phone's adhoc Hotspot. I have also posted my query in Android Central, but no one seems to have been able to know a fix as of yet. (topic can be found here: Android Forums at AndroidCentral.com > Google Nexus 7 Tablet Forum > Nexus 7 Rooting ROM's & Hack's > *** CONNECTING TO Adhoc WiFi WITH THE NEXUS 7 ***)
As I said in that thread.. not being able to connect to phones hotspot makes my beautiful nexus 7 feel like a handicapped tablet.
wikid24 said:
Just wanted to give quick update, i have not been able to find anyone to help me and also my life is kinda hectic right now... Hopefully someone will be able to pick up where I left off, in the meantime my nexus 7 is pretty much useless to me until resolved.
Click to expand...
Click to collapse
I haven't seen any reports/posts of people checking out or trying what I mentioned in post #2..lol. on prime we had this exact same problem. Then we found the supplicant file to replace one we had and then adhoc tethering worked after that. You only need to be rooted to do this as you need to rename a file and insert new supplicant in there and set permissions. You can always backup and rename original file. So if it doesn't work, you can easily revert back to stock file. I have a feeling this new file will work. Just haven't tried myself yet as I haven't brought tablet outdoors yet to need tethering. I might eventually see if it works if no one else does.
Look at the thread I linked in second post and you will see prime owners had exact same problem and we solved it. It worked for the transformer 300 also. Will likely work for nexus 7 also. The file is, in a sense, universal.
demandarin said:
I haven't seen any reports/posts of people checking out or trying what I mentioned in post #2..lol. .
Click to expand...
Click to collapse
I have tried. It does not work -- WiFi refuses to turn back on with this new supplicant file. And yes, I made sure to follow your instructions exactly as described in the procedure.
With the N7, there is no such thing as a wpa_supplicant2 file originally in /system/bin (only the one without the '2' exists in the N7 which is the one running the show here, I know this for a fact as when restoring this file, the WiFi in the N7 becomes functional again). So I tried this same file you provide both with and without the '2', with no better results.
I suspect that only a developer that knows what he's doing would be able to come up with a new wpa_supplicant file specifically tweaked for the N7 (as opposed to using one that did the trick for the Prime or for the Xoom or whathaveyou).
Thanks for the suggested idea though... anything else you think we should try?
rdelfin said:
I have tried. It does not work -- WiFi refuses to turn back on with this new supplicant file. And yes, I made sure to follow your instructions exactly as described in the procedure.
With the N7, there is no such thing as a wpa_supplicant2 file originally in /system/bin (only the one without the '2' exists in the N7 which is the one running the show here, I know this for a fact as when restoring this file, the WiFi in the N7 becomes functional again). So I tried this same file you provide both with and without the '2', with no better results.
I suspect that only a developer that knows what he's doing would be able to come up with a new wpa_supplicant file specifically tweaked for the N7 (as opposed to using one that did the trick for the Prime or for the Xoom or whathaveyou).
Thanks for the suggested idea though... anything else you think we should try?
Click to expand...
Click to collapse
They likely will implement it through a future update. Hopefully that's sooner than later. Ill ask motley, kernel developer.
I toyed with this for a while...
If you install Power Controls (Power Controls) you can add a button that turns on the Wifi Hotspot.
Problems:
you cant change any settings in current settings UI
Appears to be default "Android_AP" SSID and whatever the default password is (i dont recall if this is a random code or not)
Its a start!
Demented-Idiot said:
I toyed with this for a while...
If you install Power Controls you can add a button that turns on the Wifi Hotspot.
Problems:
you cant change any settings in current settings UI
Appears to be default "Android_AP" SSID and whatever the default password is (i dont recall if this is a random code or not)
Its a start!
Click to expand...
Click to collapse
Could you explain exactly what this does? I didn't understand what it is being implied with this being a start? with this you can actually connect to adhoc?
idk if anyone has looked...but has anyone looked into editing the Wifi-Direct api to make adhoc networks visible in there? Since wifi-direct is made for p2p connections. it's android.net.wifi.p2p.WifiP2pManager info about it is here http://developer.android.com/guide/topics/connectivity/wifip2p.html like I said...don't know if it's much help
I also wanted to post a quick reply, since I've been an insomniac yesterday.
From my previous posts I posted this link here as well, I edited the wpa_supplicant.conf file from the /system/etc/wifi folder and modified with the following settings, however I don't think that it even reads the wpa_supplicant.conf file either. Can anyone either confirm or deny that the wpa_supplicant.conf file is being used on the N7??
-------------------
update_config=1
ctrl_interface=wlan0
eapol_version=1
ap_scan=2
fast_reauth=1
network={
ssid="Bondphone"
mode=1
frequency=2412
key_mgmt=NONE
wep_key0="1234567890123"
wep_key1=1234567890123
wep_tx_keyidx=1
priority=3
auth_alg=SHARED
}
------------------------
wikid24: I don't know if N7 (or my NS) reads this file but it definitely reads /data/misc/wifi/wpa_supplicant.conf. Only problem is that I can't turn wifi on after ANY change in this file. Sometimes even if I revert my backup file, wifi won't launch and I must delete it to make wifi working again.
I found this thread on XDA
http://forum.xda-developers.com/showthread.php?t=1806937
It is edited wpa_supplicant file for Asus Transformer but it allows me to turn on wifi even on NS. But it doesn't show me any ad hoc networks. Maybe with non-stock kernel...?
And I also found ad hoc patch for source code of older version of wpa_supplicant. But I'm not able to try if it is possible to apply it on JB version too.
http://szym.net/android/wpa_supplicant-ibss.patch
jenda.69 said:
wikid24: I don't know if N7 (or my NS) reads this file but it definitely reads /data/misc/wifi/wpa_supplicant.conf. Only problem is that I can't turn wifi on after ANY change in this file. Sometimes even if I revert my backup file, wifi won't launch and I must delete it to make wifi working again.
I found this thread on XDA
http://forum.xda-developers.com/showthread.php?t=1806937
It is edited wpa_supplicant file for Asus Transformer but it allows me to turn on wifi even on NS. But it doesn't show me any ad hoc networks. Maybe with non-stock kernel...?
And I also found ad hoc patch for source code of older version of wpa_supplicant. But I'm not able to try if it is possible to apply it on JB version too.
http://szym.net/android/wpa_supplicant-ibss.patch
Click to expand...
Click to collapse
jenda, I think you may have solved a big piece to the puzzle!!
You can copy the file to another directory, and THAN you can open the file! I noticed I had all my pre-saved wifi addresses in this file!
If someone can please copy the "/data/misc/wifi/wpa_supplicant.conf" file to another directory, modify it, than overwrite the old file, it should work!! *fingers crossed*
(unfortunately I am busy for a few days, don't know if I'll be able to make the change for a while)

[Guide][Linux] Reverse-tethering + working app store over USB.

After a few evenings of searching, reading and testing, I finally found a solution for setting up a reverse-tether connection between my Droid 3 and my Ubuntu box over a USB cable, which I can use to download apps and app updates from Google Play without eating up my mobile data credit. And since it seems to me that complete and clear explanations of how to do this with USB and Ubuntu are not available anywhere, I want to detail here all the steps of my connection setup process, in a way that will hopefully be accessible to most users of Android and Ubuntu. So here goes:
Prerequisites:
- a PC that is connected to the Internet and running Ubuntu, where you have root access and a free USB port
- a rooted Android device (in my case the Motorola Droid 3) with a SIM and an active mobile subscription
- a USB cable (I have the one that came with the phone).
Setup:
#1. Disconnect your Android device's data connection from your mobile carrier by touching the corresponding icon in the notifications tray (2 parallel vertical arrows pointing in opposite directions) or by switching your phone to Airplane Mode.
#2. Launch the Terminal emulator app on your Android device and enter this command:
ifconfig
You should get a response that shows only one network interface, named "lo" or "lo0" or something like that, with an information field that says "inet addr:127.0.0.1". This is the local loopback connection. We will not be using it - just know that it's always there in responses to "ifconfig" and ignore it from now on.
#3. Re-enable your Android device's data connection by reversing what you did at #1. Go back to the Terminal and do another
ifconfig
This time, in addition to the "lo" interface, you should see another interface that is used to communicate with the Internet through your mobile carrier. For me this interface is called "ppp0"; you may have something else, but just remember what it is because you will have to use it later wherever you see me use ppp0 in the commands below.
#4. Now connect your Android device to your Ubuntu PC using the USB cable. Access the USB connection notification in your Android notifications tray and select "PC Mode" as your USB Mode. (If you don't have this option, then I don't know what to say, you will probably have to try them all, but in that case I wouldn't start with the "Mass storage" option - that's the least likely one to work for this.)
#5. Still on the Android, open Settings -> Wireless & networks -> Tethering & Mobile Hotspot and enable "USB tethering". You should get a second, green USB icon on your status bar after tethering is enabled.
#6. Go back to the Terminal app on your Android device and do yet another
ifconfig
This time you should receive information for 3 network interfaces: in addition to "lo" and "ppp0" you should now see a new interface that corresponds to your USB. For me it's called "gether0"; remember what yours is and use it wherever I use gether0 in the commands below.
Also, look at the "inet addr:" specification of your gether0 interface and remember this IP address because we will need it later. (My USB tether interface always gets the same IP address - 192.168.42.129 - so this is what I will be using in my example commands below.)
#7. Now let's look at the PC's network interfaces. Open a terminal emulator (I use Ctrl-Alt-T to do this; depending on what launchers, shortcuts or desktop environments you have, you may need to find it in a menu or do something else to get to it) and type
ifconfig
This response depends a lot on how your PC is set up, but generally I'd expect to see at least a "lo" (local loopback) interface, a "usb0" interface, one or more "eth0", "eth1" etc. interfaces and maybe a "ppp0" interface. The "ppp0" and "eth0" type interfaces will be for your PC's Internet connection and the "usb0" interface will correspond to the USB cable connecting you to the Android device. If you have a "ppp0", that's probably the one you should use in all setup commands to be run on the PC where I will use ppp0. Otherwise if you only have "lo", "usb0" and "eth0", your PC's Internet is probably on "eth0", so use that one in place of my ppp0 in commands run on the PC. (If you have any other combinations without a "ppp0", I don't know what to suggest except try them all one by one, everything you have besides "lo" and "usb0".)
#8. Back to the Android device. What we want here is for the ppp0 interface to remain enabled - because that's the only way the app store will agree to download any apps - but all our Internet communication to actually go through the gether0 interface, i.e. through the USB tether. To do this, we need to change the default route Android apps use to send data, namely to delete the default route that points to ppp0 and add a new default route that points to gether0 and that uses as a gateway the IP address of the Ubuntu PC (an address we will set up on the PC at the end of this process). So run these commands in the Terminal on the Android:
su
route del default
route add default gw 192.168.42.1 dev gether0
setprop net.dns1 8.8.8.8
Notice that the gateway IP address we will be using is made up of the first 3 numbers from our USB tether interface's IP from step #6, followed by a ".1" instead of whatever the 4th group was in the original IP.
#9. On the PC we want to set up standard Internet connection sharing between usb0 and ppp0 according to the instructions from the Ubuntu manual, so we will run these commands in the terminal window:
sudo su -
(enter your password here to get root access and then do 5 more lines)
iptables -A FORWARD -o ppp0 -i usb0 -s 192.168.42.0/24 -m conntrack --ctstate NEW -j ACCEPT
iptables -A FORWARD -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
iptables -t nat -F POSTROUTING
iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE
echo 1 > /proc/sys/net/ipv4/ip_forward
Here again you can see we're using the first 3 numbers from the USB tether interface's IP, but adding a ".0" and a "/24" at the end to specify an entire class of IPs we're going to accept packets from over the USB, a class that includes our Android's actual IP, 192.168.42.129. (We could probably just use that single IP without a "/24", but whatever, this class stuff is usually the way it's done.)
#10. Finally, we will set our PC's usb0 interface IP to the gateway IP we already told the Android to send everything to, i.e. 192.168.42.1, after which we need to quickly check that the connection is working and jump right into Google Play to download some apps. I say "quickly" because in my case, for whatever reason, after I set the gateway IP on the PC I can only leave the connection unused for about 1 minute before it drops on its own. So don't wait too much after #10.1 to do the rest:
#10.1. Enter this into your PC's terminal:
ip addr add 192.168.42.1/24 dev usb0
#10.2. Check that the connection is up by entering this into your Android's terminal first:
ping -c 3 google.com
If you get 3 responses from Google, you're all set to launch Google Play and download some apps:victory:. If there's no response, go back to #10.1 and try again.
Another indication that the PC has dropped the connection is that you get a notification popup on the PC that says "Wired network/ Disconnected". That tells you you need to jump back to #10.1 to get the USB link working again.
Also, you will know you need to do this again if you find Google Play is suddenly refusing to load apps or pages even though it was loading them before - you probably waited too long between clicks and allowed the connection to drop.
#11. To reset all the connections to normal when you're done, make sure to
#11.A. Go to Settings -> Wireless & networks -> Tethering & Mobile Hotspot and disable "USB tethering" before you unplug the USB cable from either device, otherwise the gether0 interface may remain active and interfere with your ability to get back your data link to your mobile carrier.
#11.B. Do steps #1 and #3 again to get your Android to automatically re-establish the proper settings for the link to your mobile carrier.
Final remarks:
- In order to streamline this process, especially steps #8-#10, you should probably put these commands and your specific interface names and IP addresses in some scripts - one on the PC, one on the Android device - that you can then launch more easily. I'm a newbie at both Ubuntu and Android, so I have to do some more searching to figure out how to do this properly.
- Keeping the connection up even if you're idle - e.g. while reading app descriptions and deciding what to download - is probably a matter of sending some dummy packets periodically through the USB, which would probably involve another script running in the background - again something I haven't taken the time to figure out how to set up yet.
- Anytime you get paranoid about whether the apps are being downloaded through the USB cable or your mobile data plan, go to your Android terminal and check whether your default network route is still pointing to your gateway PC by running:
route
This will show you all the routes that are configured on your Android. The last line in the table should say "default", then "192.168.42.1" and end with "gether0". This means the data is still going through the USB and not eating up your mobile data credit.
Enjoy!
It seems to work, but I'm still not sure whether my phone uses my computer's internet connection or my 3G. Upon executing:
Code:
busybox route
I get a lot of lines instead of just "192.168.42.1" ended with "rndis0" (this is how its named on my device) though this "192.168.42.1" exists.
leledumbo said:
It seems to work, but I'm still not sure whether my phone uses my computer's internet connection or my 3G.
Click to expand...
Click to collapse
The simple way I confirm it is by looking at the 3G icon at the top: during normal usage the two arrows in the icon light up depending on whether I'm transmitting or receiving or both; when I'm reverse-tethered they never light up at all.
I get a lot of lines instead of just "192.168.42.1" ended with "rndis0" (this is how its named on my device) though this "192.168.42.1" exists.
Click to expand...
Click to collapse
Well, in principle you should only need to care about the "default" line, but if by any chance you have some rule in that table that specifies a non-default route for exactly the websites you're trying to access in all this and that rule happens to specify a different interface than "rndis0", then yes - you might be using your mobile data plan after all. But I wouldn't bet on it. I have a few routes on there, but I think they're just related to services my carrier is offering at some specific IPs it has.
If you can't confirm the 3G is being bypassed by looking at the icon and if you can't spare the traffic to do a direct consumption test (query how much traffic is left/spent, use some more traffic through this setup, query again and compare), then the only other way to make sure that I can think of is to clean up the whole routing table ("route del" everything) and leave only the "default" rule from the instructions above. Then there really won't be any other path for your network packets to take but through the USB. But then you have to hope the routing table will get rebuilt as it was after you reset everything. Or you could just write down all the rules you had before so you can reconfigure them if they don't get re-created automatically at reset.
In fact - what am I talking about? - there's another way you can make sure your Android is really trying to go through the USB to get to the Internet: when you do step #10.1 on the PC just set up a wrong gateway IP, for example 192.1.1.1. If your Android fails to open any webpages or the app store and then if you do #10.1 properly it starts working (again), then it's clear that it's trying to go through the USB cable and isn't using any alternate route.
Weird, the method doesn't work anymore for the subsequent trials. I'll try rebooting the phone.
Works for Windows too
I mixed the instructions found in this thread with another thread here in xda and it worked well under Windows 7.
Thank you for the excelent guide!
donjoe0 said:
After a few evenings of searching, reading and testing, I finally found a solution for setting up a reverse-tether connection between my Droid 3 and my Ubuntu box over a USB cable, which I can use to download apps and app updates from Google Play without eating up my mobile data credit. And since it seems to me that complete and clear explanations of how to do this with USB and Ubuntu are not available anywhere, I want to detail here all the steps of my connection setup process, in a way that will hopefully be accessible to most users of Android and Ubuntu. So here goes:
[guide goes here, edited quote]
Enjoy!
Click to expand...
Click to collapse
So I tried everything on a LG Phoenix running Kitkat and no go. All the commands go through except the ping command. Any suggestions?
AndrMatr said:
So I tried everything on a LG Phoenix running Kitkat and no go. All the commands go through except the ping command. Any suggestions?
Click to expand...
Click to collapse
All I can say is this method continued to work for me pretty much the same as described when I switched to KitKat on an ASUS Padfone 2 with two minor exceptions:
- busybox was no longer set up to be invoked automatically on this other custom ROM so I had to prefix some commands with "busybox " (e.g. the "route" commands)
- my USB tether connection is now named "rndis0" instead of "gether0"; I had to fiddle around a bit with the "netcfg" command to figure that out.

Categories

Resources