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

Search This thread

redondo_se

Member
Nov 10, 2008
30
5
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" :rolleyes: :

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:

nullghost

Retired Recognized Developer
Jan 4, 2011
143
209
Oxford, OH
twitter.com
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:
 
  • Like
Reactions: KL4V1CL3

redondo_se

Member
Nov 10, 2008
30
5
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

Senior Member
Feb 27, 2011
2,271
408
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
 

k0nane

Inactive Recognized Developer
Feb 7, 2008
3,991
3,783
127.0.0.1
www.k0nane.info
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).
 

MaxPatlick

Senior Member
Nov 3, 2010
165
13
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.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 2
    This is not development.

    sadly... thats what she said :(


    EDIT: LOL this is my 69th post.
    1
    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: