Running 3G and WiFi connections simultaneously

Search This thread

hkultraman

Senior Member
Nov 27, 2005
162
4
It's possible with a rooted phone.



Read here:
http://xdaforums.com/showthread.php?t=2197776



Actually it is, I found this thread that describes how to do it on an optimus G phone, and based on that I was able to do in on vanilla android 4.3 as well (my rooted nexus 4).
You need to put a couple of scripts together, since you need a series of shell commands for turning this on and off, I recommend the wonderful SH Script Runner for this.
Here is what I did on my Nexus 4. It works perfectly but note that you don't actually see the wifi icon turning on, but if you run "netcfg | grep UP" you will see that the wlan0 interface is up and running (as well as the rmnet_usb0 mobile data interface, both of them will be up and will have the expected IP addresses) and you can access your local LAN while your mobile data 3g/4g whatever provides your default route to the outside world.

Code:
# enable dual-networking:
pkill dhcpcd
svc wifi disable
svc data enable
netcfg wlan0 up
cd /data/misc/wifi/.
wpa_supplicant -B -Dnl80211 -iwlan0 -c/data/misc/wifi/wpa_supplicant.conf
dhcpcd wlan0
ip route add x.x.x.x via x.x.x.y # add any desired local route

# disable dual-networking:
ip route del x.x.x.x/x via x.x.x.y
pkill dhcpcd
pkill wpa_supplicant 
rm -rf /data/misc/wifi/wlan0
netcfg wlan0 down
svc wifi disable
svc data disable

Hi, Thanks for your share, I am currently developing an Internal app which need to have wifi and 3G/4G at the same time. I am using LG G2 and I have rooted it.

I try to follow the script you posted step by step here. However, it seems that right after pkill dhcpdc, svc wifi disable and svc data enable, when I execute netcfg wlan0 up,, it states that wlan0 not found.

I suspect I need to load the wifi driver first before execute netcfg wlan0 up, isn't?

(BTW, are you installing busybox on your phone so that you can have the pkill command)?


And also, by following the link you posted, the LG guy seems have loaded 2 drivers as well.

insmod /system/lib/modules/cfg80211.ko
insmod /system/lib/modules/wlan.ko

Should I also need to load these 2 files as well?

Many thanks.
 
Last edited:

sordna

Senior Member
Dec 12, 2012
1,262
647
Depending on your phone/ROM/kernel you may need to load drivers/kernel modules. I'm on stock nexus 4, with Franco kernel.
And yes, I am using busybox by sterickson.
 
  • Like
Reactions: hkultraman

hkultraman

Senior Member
Nov 27, 2005
162
4
Depending on your phone/ROM/kernel you may need to load drivers/kernel modules. I'm on stock nexus 4, with Franco kernel.
And yes, I am using busybox by sterickson.


Thanks so much. I manage to have both WIFI and 3G/4G at the same time by following your steps.

But I have to make sure to load my driver first. From case, I have to run:

insmod /system/lib/modules/bcmdhd.ko

And right after I finished using wifi, I have to run following cmd to unload my driver in order to resume normal wifi behavior.

rmmod bcmdhd

Working great!
 
Last edited:
  • Like
Reactions: sordna

Captus

Senior Member
Mar 17, 2007
62
9
Thanks so much. I manage to have both WIFI and 3G/4G at the same time by following your steps.

But I have to make sure to load my driver first. From case, I have to run:

insmod /system/lib/modules/bcmdhd.ko

And right after I finished using wifi, I have to run following cmd to unload my driver in order to resume normal wifi behavior.

rmmod bcmdhd

Working great!

I'm running P.A.C on Galaxy S4. I have tried to look in the same folder for modules. I don't see clearly what i should be loading.
Any ideas?

I get the error wlan0 interface not found.
 

hkultraman

Senior Member
Nov 27, 2005
162
4
I'm running P.A.C on Galaxy S4. I have tried to look in the same folder for modules. I don't see clearly what i should be loading.
Any ideas?

I get the error wlan0 interface not found.

Did you try dhd.ko?

---------- Post added at 02:47 PM ---------- Previous post was at 02:43 PM ----------

I'm running P.A.C on Galaxy S4. I have tried to look in the same folder for modules. I don't see clearly what i should be loading.
Any ideas?

I get the error wlan0 interface not found.

You may also check the link below:
http://blog.csdn.net/roger__wong/article/details/9131421
 
  • Like
Reactions: undoubledgoose

eledra

New member
Feb 14, 2014
2
0
Tried to follow this tutorial for a week. The idea is to create a program which connect to an internal network while keeping connection to the internet so that I can send command from server to that internal network.

However i still have problem :(

My device:
Samsung Galaxy S3 LTE - I9305
I have tried both vanilla 4.3 and stable version of Cyanogen Mod.

My commands:

Code:
pkill dhcpcd
svc wifi disable
svc data enable
netcfg wlan0 up
cd /data/misc/wifi/
insmod /system/lib/modules/dhd.ko "firmware_path=/system/etc/wifi/bcmdhd_apsta.bin nvram_path=/system/etc/wifi/nvram_net.txt"
wpa_supplicant -B -Dnl80211 -iwlan0 -c/data/misc/wifi/wpa_supplicant.conf -d
dhcpcd wlan0

However, it stucked:

Code:
dhcpcd[5397]: version 5.5.6 starting
dhcpcd[5397]: wlan0: waiting for carrier

It seems there is something wrong with wpa_supplicant. Here is the log:

Code:
/wpa_supplicant( 5235): wpa_supplicant v2.0-devel-4.2.2
D/wpa_supplicant( 5235): random: Trying to read entropy from /dev/random
I/wpa_supplicant( 5235): Successfully initialized wpa_supplicant
D/wpa_supplicant( 5235): Initializing interface 'wlan0' conf '/data/misc/wifi/wpa_supplicant.conf' driver 'nl80211' ctrl_interface 'N/A' bridge
D/wpa_supplicant( 5235): Configuration file '/data/misc/wifi/wpa_supplicant.conf' -> '/data/misc/wifi/wpa_supplicant.conf'
D/wpa_supplicant( 5235): Reading configuration file '/data/misc/wifi/wpa_supplicant.conf'
D/wpa_supplicant( 5235): ctrl_interface='wlan0'
D/wpa_supplicant( 5235): update_config=1
D/wpa_supplicant( 5235): device_name='m3xx'
D/wpa_supplicant( 5235): manufacturer='samsung'
D/wpa_supplicant( 5235): model_name='GT-I9305'
D/wpa_supplicant( 5235): model_number='GT-I9305'
D/wpa_supplicant( 5235): serial_number='42f7426e1456afbb'
D/wpa_supplicant( 5235): config_methods='physical_display virtual_push_button keypad'
D/wpa_supplicant( 5235): p2p_listen_reg_class=81
D/wpa_supplicant( 5235): p2p_listen_channel=1
D/wpa_supplicant( 5235): p2p_oper_reg_class=115
D/wpa_supplicant( 5235): p2p_oper_channel=48
D/wpa_supplicant( 5235): Priority group 1
D/wpa_supplicant( 5235):    id=0 ssid='Long'
D/wpa_supplicant( 5235): nl80211: interface wlan0 in phy phy0
I/wpa_supplicant( 5235): rfkill: Cannot open RFKILL control device
D/wpa_supplicant( 5235): nl80211: RFKILL status not available
D/wpa_supplicant( 5235): nl80211: Set mode ifindex 8 iftype 2 (STATION)
D/wpa_supplicant( 5235): nl80211: Subscribe to mgmt frames with non-AP handle 0x41dee21
...................
#####  a bunch of Registerframe ####
..................
D/wpa_supplicant( 5235): nl80211: Register frame type=0xd0 nl_handle=0x41dee210           
D/wpa_supplicant( 5235): nl80211: Register frame match - hexdump(len=2): 0a 07            
D/wpa_supplicant( 5235): netlink: Operstate: linkmode=1, operstate=5                      
D/wpa_supplicant( 5235): nl80211: Using driver-based off-channel TX                       
D/wpa_supplicant( 5235): nl80211: TDLS supported                                          
D/wpa_supplicant( 5235): nl80211: Supports Probe Response offload in AP mode              
D/wpa_supplicant( 5235): nl80211: Driver is new enough to support monitor-less mode       
D/wpa_supplicant( 5235): nl80211: driver param='(null)'                                   
D/wpa_supplicant( 5235): nl80211: Regulatory information - country=00                     
D/wpa_supplicant( 5235): nl80211: 2402-2472 @ 40 MHz                                      
D/wpa_supplicant( 5235): nl80211: 2457-2482 @ 40 MHz                                      
D/wpa_supplicant( 5235): nl80211: 2474-2494 @ 20 MHz                                      
D/wpa_supplicant( 5235): nl80211: 5170-5250 @ 40 MHz                                      
D/wpa_supplicant( 5235): nl80211: 5735-5835 @ 40 MHz                                      
D/wpa_supplicant( 5235): nl80211: Added 802.11b mode based on 802.11g information         
D/wpa_supplicant( 5235): wlan0: Own MAC address: 90:18:7c:4a:61:56                        
D/wpa_supplicant( 5235): wpa_driver_nl80211_set_key: ifindex=8 alg=0 addr=0x0 key_idx=0 set_tx=0 seq_len=0 key_len=0
D/wpa_supplicant( 5235): wpa_driver_nl80211_set_key: ifindex=8 alg=0 addr=0x0 key_idx=1 set_tx=0 seq_len=0 key_len=0
D/wpa_supplicant( 5235): wpa_driver_nl80211_set_key: ifindex=8 alg=0 addr=0x0 key_idx=2 set_tx=0 seq_len=0 key_len=0
D/wpa_supplicant( 5235): wpa_driver_nl80211_set_key: ifindex=8 alg=0 addr=0x0 key_idx=3 set_tx=0 seq_len=0 key_len=0
D/wpa_supplicant( 5235): wlan0: RSN: flushing PMKID list in the driver                                              
D/wpa_supplicant( 5235): nl80211: Flush PMKIDs                                                                      
D/wpa_supplicant( 5235): wlan0: Setting scan request: 0 sec 100000 usec                                             
D/wpa_supplicant( 5235): WPS: Set UUID for interface wlan0                                                          
D/wpa_supplicant( 5235): WPS: UUID based on MAC address - hexdump(len=16): b7 c8 22 f4 13 ac 55 83 99 f0 1a f0 a2 2d 95 8a
D/wpa_supplicant( 5235): EAPOL: SUPP_PAE entering state DISCONNECTED                                                      
D/wpa_supplicant( 5235): EAPOL: Supplicant port status: Unauthorized                                                      
D/wpa_supplicant( 5235): EAPOL: KEY_RX entering state NO_KEY_RECEIVE                                                      
D/wpa_supplicant( 5235): EAPOL: SUPP_BE entering state INITIALIZE                                                         
D/wpa_supplicant( 5235): EAP: EAP entering state DISABLED                                                                 
D/wpa_supplicant( 5235): EAPOL: Supplicant port status: Unauthorized                                                      
D/wpa_supplicant( 5235): EAPOL: Supplicant port status: Unauthorized                                                      
D/wpa_supplicant( 5235): Using existing control interface directory.                                                      
D/wpa_supplicant( 5235): wlan0: Added interface wlan0                                                                     
D/wpa_supplicant( 5235): wlan0: State: DISCONNECTED -> DISCONNECTED
 
Last edited:

abur787

New member
May 7, 2014
1
0
Hi

Can someone help me? I am trying to run your commands to enable dual networks, only While trying to load this command: busybox insmod /system/lib/modules/cfg80211.kobusybox insmod /system/lib/modules/wlan.ko
It states not found.

Can any explain how to do this for me?
I'm rooted on stock 4.1 rom with busybox pro installed.

Sent from my SGH-T599N using XDA Free mobile app
 

jorgenbl

New member
May 20, 2014
1
0
It's possible with a rooted phone.



Read here:
http://xdaforums.com/showthread.php?t=2197776



Actually it is, I found this thread that describes how to do it on an optimus G phone, and based on that I was able to do in on vanilla android 4.3 as well (my rooted nexus 4).
You need to put a couple of scripts together, since you need a series of shell commands for turning this on and off, I recommend the wonderful SH Script Runner for this.
Here is what I did on my Nexus 4. It works perfectly but note that you don't actually see the wifi icon turning on, but if you run "netcfg | grep UP" you will see that the wlan0 interface is up and running (as well as the rmnet_usb0 mobile data interface, both of them will be up and will have the expected IP addresses) and you can access your local LAN while your mobile data 3g/4g whatever provides your default route to the outside world.

Code:
# enable dual-networking:
pkill dhcpcd
svc wifi disable
svc data enable
netcfg wlan0 up
cd /data/misc/wifi/.
wpa_supplicant -B -Dnl80211 -iwlan0 -c/data/misc/wifi/wpa_supplicant.conf
dhcpcd wlan0
ip route add x.x.x.x via x.x.x.y # add any desired local route

# disable dual-networking:
ip route del x.x.x.x/x via x.x.x.y
pkill dhcpcd
pkill wpa_supplicant 
rm -rf /data/misc/wifi/wlan0
netcfg wlan0 down
svc wifi disable
svc data disable

Hi,

I tried the similar as you did above with my nexus 4 but it seems to disconnect immediately after connecting:

Output of script:

1|root@mako:/mnt/sdcard/Scripts # sh dualnet_enable.sh
dhcpcd[27977]: version 5.5.6 starting
dhcpcd[27977]: wlan0: waiting for carrier
dhcpcd[27977]: wlan0: carrier acquired
dhcpcd[27977]: wlan0: rebinding lease of 192.168.64.124
dhcpcd[27977]: wlan0: carrier lost
dhcpcd[27977]: wlan0: carrier acquired
dhcpcd[27977]: wlan0: rebinding lease of 192.168.64.124
dhcpcd[27977]: wlan0: NAK: requested address not available from 192.168.64.1
dhcpcd[27977]: wlan0: broadcasting for a lease
dhcpcd[27977]: wlan0: offered 192.168.64.125 from 192.168.64.1
dhcpcd[27977]: wlan0: acknowledged 192.168.64.125 from 192.168.64.1
dhcpcd[27977]: wlan0: checking for 192.168.64.125
dhcpcd[27977]: wlan0: carrier lost
dhcpcd[27977]: wlan0: removing interface


Logcat:

I/wpa_supplicant(28194): wlan0: Trying to associate with SSID 'enga'
I/wpa_supplicant(28194): wlan0: Associated with 70:73:cb:b5:11:c1
I/wpa_supplicant(28194): wlan0: WPA: Key negotiation completed with 70:73:cb:b5:11:c1 [PTK=CCMP GTK=CCMP]
I/wpa_supplicant(28194): wlan0: CTRL-EVENT-CONNECTED - Connection to 70:73:cb:b5:11:c1 completed (auth) [id=0 id_str=]
I/wpa_supplicant(28194): wlan0: CTRL-EVENT-DISCONNECTED bssid=70:73:cb:b5:11:c1 reason=0 locally_generated=1
I/wpa_supplicant(28331): Successfully initialized wpa_supplicant
I/wpa_supplicant(28331): rfkill: Cannot open RFKILL control device
I/wpa_supplicant(28331): rfkill: Cannot open RFKILL control device
W/wpa_supplicant(28331): wlan0: Failed to initiate AP scan
W/wpa_supplicant(28331): wlan0: Failed to initiate AP scan
W/wpa_supplicant(28331): wlan0: Failed to initiate AP scan
I/wpa_supplicant(28331): CTRL_IFACE monitor[0]: 2 - No such file or directory
I/wpa_supplicant(28194): wlan0: Trying to associate with SSID 'enga'
I/wpa_supplicant(28194): wlan0: Associated with 70:73:cb:b5:11:c1
I/wpa_supplicant(28331): wlan0: No network configuration found for the current AP
I/wpa_supplicant(28331): wlan0: CTRL-EVENT-DISCONNECTED bssid=70:73:cb:b5:11:c1 reason=3 locally_generated=1
I/wpa_supplicant(28194): wlan0: CTRL-EVENT-DISCONNECTED bssid=70:73:cb:b5:11:c1 reason=0 locally_generated=1
I/wpa_supplicant(28194): wlan0: WPA: 4-Way Handshake failed - pre-shared key may be incorrect
I/wpa_supplicant(28194): wlan0: CTRL-EVENT-SSID-TEMP-DISABLED id=0 ssid="enga" auth_failures=1 duration=10
W/wpa_supplicant(28194): wlan0: Failed to initiate AP scan

I tried both android 4.3 and 4.4.2, same error.

Jørgen
 

sordna

Senior Member
Dec 12, 2012
1,262
647
I tried both android 4.3 and 4.4.2, same error.

Not sure what the reason could be. I'm on stock android, and have been using this since 4.3, and it worked in 4.3, 4.4, and now in 4.4.2. I just tried it and it still works. I get "carrier acquired" and I don't lose it afterwards. I get a dhcp lease for my wlan0 interface, and then dhcpcd forks in the background. I can ssh to my phone on my wifi LAN, and from there traceroute to external websites over my phone's cellular network verifying it uses that and not my home ISP.
"netcfg | grep UP" shows both my wlan0 and rmnet_usb0 interfaces having IP addresses and being up.
I can even proxy between my home wifi and my celullar carrier as if doing tethering, only using a proxy server on my phone instead (and specifying the phone's IP as the proxy in my home computers' browsers).

I also need to mention I use Franco kernel. Not sure if it makes a difference, but I believe franco kernel has the modules compiled in, and I don't need to "insmod" anything like some other folks seem to be doing.
 
Last edited:

undoubledgoose

New member
Jun 27, 2014
1
0
problems with loading Wlan module

Hello guys,
i'm new here and found this helpful thread a few days ago. I hope the thread is not too old for posting a question.
The little hint from sordna is very interesting and sounds very easy... Unfortunately, i have a little problem with bringing up the wlan kernel module when 3g-data is active.

But at first i will show you my phone properties:
Model: Samsung GT-I9001
Android Version: 4.3.1
Kernel Version: 3.4.70-cyanogenmod
Cyanogenmod Version: 10.2-20131125

The initial situation is that the phone is connnected to a Wlan-AP (Rasperry Pi) without internet gateway, so the phone isn't connected to the internet while connected to the AP. My target is to enable 3g-data while being connected to the AP and route it to the Rasperry Pi.

But at first i want to enable 3g... so i followed sordna's steps and it failed of course because i have a different phone model.
My Wlan interface is named wlan0 and the dhd.ko is located in /system/lib/modules/dhd.ko

When i tried "insmod /system/lib/modules/dhd.ko" over ADB Shell (with su at first) there comes <no such device> error message.

According to Roger Wongs article on page 3 posted from hkultraman
there must be a wifi.conf file located in /system/etc/wifi/ but there is only the wpa_supplicant.conf. Is this my "wifi.conf" file?

I know the the insmod command must be placed with expressions like "insmod /system/lib/modules/dhd.ko "firmware_path=/system/etc/wifi/bcm4329_sta.bin nvram_path=/system/etc/wifi/nvram_net.txt iface_name=eth0" but i dont know which expression fits for my model...

In the article is java code posted from Wifi Tether... can i use this for my problem and if yes how?

I searched for the problem in this forum but the postings where only about compiling a custom kernel with wlan-module and so on...

Edit: i checked with lsmod wich modules are loaded, this is the output with enabled wifi:
dhd 375610 0 - Live 0x00000000

maybe its helpful....

Thanks in advance for your help.
 
Last edited:

brfe

New member
Mar 12, 2015
4
1
Technique not working on Lollipop

I've been using the technique in this thread successfully, on Android 4 (4.0, 4.4.4).
However on Android 5.0.2, I am finding that it hangs for a long time and eventually fails on "dhcpcd wlan0". I am also seeing the "no carrier" error message.

Can anyone confirm whether or not this technique should be expected to work on Android 5?
 

axelxxxxx

Member
Feb 25, 2016
19
5
Košice
It's possible with a rooted phone.



Read here:
http://xdaforums.com/showthread.php?t=2197776



Actually it is, I found this thread that describes how to do it on an optimus G phone, and based on that I was able to do in on vanilla android 4.3 as well (my rooted nexus 4).
You need to put a couple of scripts together, since you need a series of shell commands for turning this on and off, I recommend the wonderful SH Script Runner for this.
Here is what I did on my Nexus 4. It works perfectly but note that you don't actually see the wifi icon turning on, but if you run "netcfg | grep UP" you will see that the wlan0 interface is up and running (as well as the rmnet_usb0 mobile data interface, both of them will be up and will have the expected IP addresses) and you can access your local LAN while your mobile data 3g/4g whatever provides your default route to the outside world.

Code:
# enable dual-networking:
pkill dhcpcd
svc wifi disable
svc data enable
netcfg wlan0 up
cd /data/misc/wifi/.
wpa_supplicant -B -Dnl80211 -iwlan0 -c/data/misc/wifi/wpa_supplicant.conf
dhcpcd wlan0
ip route add x.x.x.x via x.x.x.y # add any desired local route

# disable dual-networking:
ip route del x.x.x.x/x via x.x.x.y
pkill dhcpcd
pkill wpa_supplicant 
rm -rf /data/misc/wifi/wlan0
netcfg wlan0 down
svc wifi disable
svc data disable



hi i am really gratefull for this scripts BUT i have a problem with running them. I have rooted Xperia mini Pro mango sk17i runnig on CM 10.2 (android 4.3 i downloaded the same android as you to run this script :D ) when i start the scripts it show me some text but i cant doo anything neither i cant run wifi and 3g at same time. Did you used some NET CFG scripts or anything else. Please help me. Thanx
 

baharxy

New member
Mar 8, 2016
2
1
I've been using the technique in this thread successfully, on Android 4 (4.0, 4.4.4).
However on Android 5.0.2, I am finding that it hangs for a long time and eventually fails on "dhcpcd wlan0". I am also seeing the "no carrier" error message.

Can anyone confirm whether or not this technique should be expected to work on Android 5?

Did you ever find an alternative solution? I experience the same problem with Android 6.0
 

minglongDai

New member
Jul 9, 2016
1
0
I have tried those cmd lines in terminal, and the 3G interface & Wifi interface have been turned on simultaneously successfully. But when I use socket = new Socket(url,remote port, wifi local address , 36666) to bind a socket to the wifi interface, it didn't work. what should I do?
 

Top Liked Posts

  • There are no posts matching your filters.
  • 5
    Does anyone know anything about using 3G and WiFi at the same time? Is it even possible?

    It's possible with a rooted phone.

    Hello from me. I done the same job with you! And the Service.jar was created and i pushed to my mobile phone. But still the same default use of the connectivity. You managed to do something?

    Read here:
    http://xdaforums.com/showthread.php?t=2197776

    No it is not possible.

    Actually it is, I found this thread that describes how to do it on an optimus G phone, and based on that I was able to do in on vanilla android 4.3 as well (my rooted nexus 4).
    You need to put a couple of scripts together, since you need a series of shell commands for turning this on and off, I recommend the wonderful SH Script Runner for this.
    Here is what I did on my Nexus 4. It works perfectly but note that you don't actually see the wifi icon turning on, but if you run "netcfg | grep UP" you will see that the wlan0 interface is up and running (as well as the rmnet_usb0 mobile data interface, both of them will be up and will have the expected IP addresses) and you can access your local LAN while your mobile data 3g/4g whatever provides your default route to the outside world.

    Code:
    # enable dual-networking:
    pkill dhcpcd
    svc wifi disable
    svc data enable
    netcfg wlan0 up
    cd /data/misc/wifi/.
    wpa_supplicant -B -Dnl80211 -iwlan0 -c/data/misc/wifi/wpa_supplicant.conf
    dhcpcd wlan0
    ip route add x.x.x.x via x.x.x.y # add any desired local route
    
    # disable dual-networking:
    ip route del x.x.x.x/x via x.x.x.y
    pkill dhcpcd
    pkill wpa_supplicant 
    rm -rf /data/misc/wifi/wlan0
    netcfg wlan0 down
    svc wifi disable
    svc data disable
    1
    Hello to all.

    I was trying to start this thread in Android Software and Hacking General, but got a warning about not having enough posts to submit a thread there, so I'm going to try here.

    I have a Samsung Galaxy S II phone with the newest Android version. My goal is to modify the system so that 3G and WiFi are able to run together, side-by-side, simultaneously without 3G being turned off. Now, every time I connect to a WLAN, 3G cuts.

    [OK, the spam police won't let me post outside links; Google Mobisocial 3G Wifi Stanford to find the article I'm talking about.]
    MobiSocial News wrote about a hack that modifies ConnectivityService.java in a rather crude way, but according to the author of that article, it works on a 2.x Android system. There's not much info about the hack, but it's at least something and sounds plausible.

    I tried to follow the instructions; I downloaded newest Android source codes, modified ConnectivityService.java and built the kernel by following these instructions: [a link to source.android.com "Building the System"]. But unfortunately, make didn't produce a services.jar mentioned in the article.

    ---

    Does anyone know anything about using 3G and WiFi at the same time? Is it even possible?

    Every piece of information is valuable, so don't be afraid to post. Thanks!
    1
    First try the commands on the terminal (adb shell, or terminal app) and make sure to type "su" first, so that all commands get executed with root permissions. After you get things working without errors on the terminal, you can put these commands in script runner.
    The x.x.x stuff needs to be replaced with the subnet/netmask of your home LAN, such as 10.0.0.0/24 or whatever and the default gateway (your wireless router) to reach it via.The route stuff assumes a basic understanding of networking... Actually you can remove the route statements, they are only needed if your home LAN is on a different subnet than your WiFi subnet... most home routers put everything on the same subnet.

    What is the end goal you are trying to achieve by connecting to 2 networks?
    1
    OK. Please hit the thanks buttons :)
    1
    When i run the code line by line in terminal, i get an error message wlan0: interface not found or invalid

    Do I run the code when connected to my hardisk hotspot? When exactly do I run the code.

    If you try to understand the code you will notice it turns off your Wi-Fi and then turns it on. So actually you don't need to connect to the hotspot first.
    Regarding the interface name, here is where you need to do your own investigation and figure the WiFi interface name for your own phone.
    The netcfg command without any arguments displays all interfaces, and whenever you are on Wi-Fi, the relevant interface will be UP and will have your assigned IP address next to it.

    Look at how much stuff I changed compared to the things posted by the other guy for the optimus phone. Look at his solution and be prepared to investigate and come up with similar amount of changes for your phone. I spent several hours trying different stuff for my Nexus 4, with my only info being the other guy's post. I read about netcfg and everything else googling various websites. You need to do the same and learn a bit about that stuff.

    For all I know, the Optimus phone method could be closer to your phone than my method, perhaps. You have to do your own research and figure out the differences, then post them here to help other owners with the same device as yours.