Check Your I/O Usage with Iotop for Android

Ever needed to check the I/O usage of apps? If so, you probably tried searching for an iotop … more

T-Mobile HTC One M8 Gets Selfie-Friendly Android 4.4.4 OTA

The T-Mobie variant of HTC One (M8) just now received an over-the-air update … more

Android L is for Lockdown

Root is, without a doubt, the (un)holy grail of the Android world. Those wonderful permissions that allow you as … more

XDA Xposed Tuesday: XHangouts Will Improve Your Hangouts

Ever since Google started supporting text messaging in Hangouts many people have … more
Post Reply

[Q] [SOLVED] How to enable wifi and 3g/4g simultaneously?

OP redondo_se

13th May 2011, 05:15 PM   |  #1  
OP Junior Member
Thanks Meter: 1
 
21 posts
Join Date:Joined: Nov 2008
Hi,

I am setting up a wifi router in my car. I will have a small network of devices. I want to be able to add my Epic 4g to this network and use it as an internet gateway.

I have wifi tether installed and it works wonderfully, however I don't want my car network to depend on the phone as the wifi hotspot. I need the network to function if the phone is not present.

I would essential like to do this: Tethering via WiFi - Troubleshooting.

However, wlan_loader doesn't seem to exist on my phone. I'm running midnight rom 5.1. When I run wifi tether, netcfg shows me that both ppp0 and eth0 are enabled (along with another iface called wl0.1). However, like I said, I don't want my phone to be the hotspot, I want it to be a client to my other hotspot and 3g (or 4g) simultaneously. If wifi tether can enable both interfaces at the same time, how do I do it. Or, can I just use wifi tether to enable both interfaces, and then use some commands to connect eth0 to the hotspot?

On a side note, the wifi router I'm using is a cradlepoint PHS300. I was hoping I might be able to hook it to my phone by USB and get the direct connection working with either the wired tether or wifi tether, but neither work. It seems you must have the legit Sprint wifi hotspot working for it to work that way. The cradlepoint sees the phone as a ppp device when I run wired tether, but it says it's not configured correctly. If anybody knows how to make that work without using the paid sprint hotspot service, that would be a great alternative.

Thanks!

EDIT: SOLVED
------------------

No thanks to Custodian and nullghost, I got it working. k0nane, thanks for being respectful and for moving my post to the correct location.

Back on topic, I don't really care if I can't use 4G and wifi simultaneously, I don't have 4G service in my area any way. My goal is to use my phone as a gateway, and 3G will serve the purpose. I'll take your word that you can't use 4g and wifi simultaneously. Maybe I'll try sometime when I'm in a 4g town just for fun.

I connected to the AP using the built in wifi gui first and got the settings added to my /data/wifi/bcm_supp.conf file. My phone has several firmware configs on it. The only one of the 3 that works correctly with wpa is bcm4329_sta.bin.

Here's my scripts that I "developed" :

load script:

Code:
#!/system/bin/sh

# need this so getprop and networking stuff to work
export ANDROID_PROPERTY_WORKSPACE=9,32768

# unload and load the wifi driver module
/system/xbin/killall wpa_supplicant
/sbin/rmmod dhd
/sbin/insmod /lib/modules/dhd.ko "firmware_path=/system/etc/wifi/bcm4329_sta.bin nvram_path=/system/etc/wifi/nvram_net.txt dhd_watchdog_ms=200 dhd_poll=1"
/system/bin/wpa_supplicant -B -Dwext -ieth0 -c/data/wifi/bcm_supp.conf

# set ip address
/sbin/ifconfig eth0 192.168.10.2 netmask 255.255.255.0

# set up iptables so we can use device as a gateway
/system/bin/iptables -F FORWARD
/system/bin/iptables -t nat -F POSTROUTING 

/system/bin/iptables -I FORWARD -m state --state ESTABLISHED,RELATED -j ACCEPT
/system/bin/iptables -I FORWARD -s 192.168.10.0/24 -j ACCEPT
/system/bin/iptables -P FORWARD DROP

/system/bin/iptables -t nat -I POSTROUTING -s 192.168.10.0/24 -j MASQUERADE

/system/xbin/echo 1 > /proc/sys/net/ipv4/ip_forward
wifi off script:

Code:
#!/system/bin/sh

# need this so getprop and networking stuff to work
export ANDROID_PROPERTY_WORKSPACE=9,32768

# unload and load the wifi driver module
/system/xbin/killall wpa_supplicant
/sbin/rmmod dhd
I'm using GScript to launch these from the Android GUI.
Last edited by redondo_se; 17th May 2011 at 04:52 PM.
13th May 2011, 05:28 PM   |  #2  
Senior Member
Thanks Meter: 346
 
1,945 posts
Join Date:Joined: Feb 2011
FINISH HIM!!!!!

Sent from my SPH-D700 using XDA Premium App
13th May 2011, 05:55 PM   |  #3  
nullghost's Avatar
Retired Recognized Developer
Flag Oxford, OH
Thanks Meter: 207
 
143 posts
Join Date:Joined: Jan 2011
More
Quote:
Originally Posted by Custodian

FINISH HIM!!!!!

Sent from my SPH-D700 using XDA Premium App

Seriously.

To the OP:

REALLY? Do you not read stickies?
1. This is Android Development, this is for DEVELOPMENT.
2. There is an Android Questions and Answers subforum. How could you have missed it? Unless you deliberately posted here to draw attention to your post. Then sir, you have succeeded. That is, succeeded in making a post that will get trolled because of your failure to read the stickies! And we've gone in a circle!
:golfclap:
The Following User Says Thank You to nullghost For This Useful Post: [ View ]
13th May 2011, 06:39 PM   |  #4  
OP Junior Member
Thanks Meter: 1
 
21 posts
Join Date:Joined: Nov 2008
Jeez guys. I intentionally posted here because this seems more like a development type question than general Q/A type question. My sincerest apologies. Could a mod please move it?

How is this a bad question to ask here when there is a HUGE thread about TV-out on the epic 4g that is just full of people saying "any updates on this?" ... "what's the status?"

Thanks.
13th May 2011, 08:26 PM   |  #5  
Senior Member
Thanks Meter: 346
 
1,945 posts
Join Date:Joined: Feb 2011
Quote:
Originally Posted by redondo_se

Jeez guys. I intentionally posted here because this seems more like a development type question than general Q/A type question. My sincerest apologies. Could a mod please move it?

How is this a bad question to ask here when there is a HUGE thread about TV-out on the epic 4g that is just full of people saying "any updates on this?" ... "what's the status?"

Thanks.

Where the hell is konane. He's still breathing!

Sent from my SPH-D700 using XDA Premium App
13th May 2011, 08:58 PM   |  #6  
theimpaler747's Avatar
Retired Forum Moderator / Retired Recognized Developer
Flag The Ninth Circle of Dante's Inferno
Thanks Meter: 2,674
 
21,289 posts
Join Date:Joined: Mar 2010
Donate to Me
More
This is not development. Moved to Q&A.
13th May 2011, 09:04 PM   |  #7  
k0nane's Avatar
Recognized Developer
Flag 127.0.0.1
Thanks Meter: 3,768
 
3,981 posts
Join Date:Joined: Feb 2008
More
Questions belong in Question & Answer.

Before you post in Development, ask yourself, "what am I developing?" - not suggesting to develop, not requesting, not asking questions about developing... actually developing.

Now, as far as your question goes... not happening. There's a reason Samsung blocks 4G and WiFi operating at the same time. You can certainly use WiFi Tether with it, but it may reboot your device (there's a very good chance of it).
13th May 2011, 09:06 PM   |  #8  
steviee7's Avatar
Senior Member
Flag TX
Thanks Meter: 60
 
803 posts
Join Date:Joined: Nov 2010
More
Quote:
Originally Posted by theimpaler747

This is not development.

sadly... thats what she said


EDIT: LOL this is my 69th post.
The Following 2 Users Say Thank You to steviee7 For This Useful Post: [ View ]
13th May 2011, 09:21 PM   |  #9  
k0nane's Avatar
Recognized Developer
Flag 127.0.0.1
Thanks Meter: 3,768
 
3,981 posts
Join Date:Joined: Feb 2008
More
Quote:
Originally Posted by steviee7

sadly... thats what she said


EDIT: LOL this is my 69th post.

That one didn't work. Fail, sir, fail.
14th May 2011, 12:00 AM   |  #10  
Senior Member
Thanks Meter: 13
 
165 posts
Join Date:Joined: Nov 2010
I thought wifi and 4G wimax used the same radio and that's why you could only use one or the other but not both at the same time.

Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes