Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,736,660 Members 53,899 Now Online
XDA Developers Android and Mobile Development Forum

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

Tip us?
 
redondo_se
Old
(Last edited by redondo_se; 17th May 2011 at 04:52 PM.)
#1  
Junior Member - OP
Thanks Meter 1
Posts: 16
Join Date: Nov 2008
Default [Q] [SOLVED] How to enable wifi and 3g/4g simultaneously?

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.
 
Custodian
Old
#2  
Senior Member
Thanks Meter 346
Posts: 1,945
Join Date: Feb 2011
FINISH HIM!!!!!

Sent from my SPH-D700 using XDA Premium App
 
nullghost
Old
#3  
nullghost's Avatar
Retired Recognized Developer
Thanks Meter 207
Posts: 143
Join Date: Jan 2011
Location: Oxford, OH
Quote:
Originally Posted by Custodian View Post
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:
Epic 4G Developer || NOOKcolor User || CR48 User || GENTOO Linux User

Want to donate? Donate to Electronic Frontier Foundation, the people that protect our rights on the internet.

Follow me on Twitter @nullghost and Google Plus +nullghost
The Following User Says Thank You to nullghost For This Useful Post: [ Click to Expand ]
 
redondo_se
Old
#4  
Junior Member - OP
Thanks Meter 1
Posts: 16
Join Date: 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.
 
Custodian
Old
#5  
Senior Member
Thanks Meter 346
Posts: 1,945
Join Date: Feb 2011
Quote:
Originally Posted by redondo_se View Post
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
 
theimpaler747
Old
#6  
theimpaler747's Avatar
Retired Forum Moderator / Retired Recognized Developer
Thanks Meter 2658
Posts: 21,289
Join Date: Mar 2010
Location: The Ninth Circle of Dante's Inferno

 
DONATE TO ME
This is not development. Moved to Q&A.
 
k0nane
Old
#7  
k0nane's Avatar
Recognized Developer
Thanks Meter 3759
Posts: 3,981
Join Date: Feb 2008
Location: 127.0.0.1
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).





Have I helped? Enjoy my network's fast downloads? Hit the Thanks button!



Follow me on Twitter @k0nane / @publik0! Chat with the OUDHS: irc.freenode.net #oudhitsquad (webchat)
 
steviee7
Old
#8  
steviee7's Avatar
Senior Member
Thanks Meter 60
Posts: 803
Join Date: Nov 2010
Location: TX
Quote:
Originally Posted by theimpaler747 View Post
This is not development.
sadly... thats what she said


EDIT: LOL this is my 69th post.
Samsung Galaxy Note II Sph-L900
Stock Rooted Jellybean

The Following 2 Users Say Thank You to steviee7 For This Useful Post: [ Click to Expand ]
 
k0nane
Old
#9  
k0nane's Avatar
Recognized Developer
Thanks Meter 3759
Posts: 3,981
Join Date: Feb 2008
Location: 127.0.0.1
Quote:
Originally Posted by steviee7 View Post
sadly... thats what she said


EDIT: LOL this is my 69th post.
That one didn't work. Fail, sir, fail.





Have I helped? Enjoy my network's fast downloads? Hit the Thanks button!



Follow me on Twitter @k0nane / @publik0! Chat with the OUDHS: irc.freenode.net #oudhitsquad (webchat)
 
MaxPatlick
Old
#10  
Senior Member
Thanks Meter 13
Posts: 165
Join Date: 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.

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


XDA PORTAL POSTS

Get Your Cargo to its Destination in 4×4 Military Operations Reborn

Racing games have evolved quite a bit since the days of Pole … more

Automate Your Device with Sfen

Changing the profile of yourdevice manually is now long forgotten. Since the advent of Android automation … more

Galaxy Photo Screen Lock Displays a Photo Slideshow on Your Lock Screen

Being the most often looked at part of our devices UI, the lock … more