Is it possible to have both 3G and Wifi connections up and running? I want to transmit at the same time through both interfaces.
However, I've noticed that when Wifi is up, 3G is going down. Actually, it seems that the routing table is updated on on/off of the interfaces.
Route table UMTS on / Wifi on
a.b.c.1 dev rmnet0
a.b.c.0/24 dev rmnet0 src a.b.c.2
default via a.b.c.1 dev rmnet0
Route table Wifi on / UMTS on
192.168.1.0/24 dev eth0 src 192.168.1.147
default via 192.168.1.1 dev eth0
With wifi on I have run:
ip link set rmnet0 up
ip route
192.168.1.0/24 dev eth0 src 192.168.1.147
a.b.c.0/24 dev rmnet0 src a.b.c.2
default via 192.168.1.1 dev eth0
When I saw that I thought that I have managed to put both devices up and running. However, this is not the case. When I ping a public internet address (a.b.c.3), in case 1) and 2) everything goes well. In case 3) I get no answer.
Where on earth does Android set that only one device can be available at a time? How can I make both interfaces to be up and available, like on an ordinary Linux box?
P.S.: I have tried the solution in [1] to enable the data connection when wifi is on, and no way.
[1] How to enable data connection on Android 2.3
[2] How to block calls in android --> using ITelephony to get the telephonyService.enableDataConnectivity(); but I get an exception.
This is not going to be possible... unless you are will to go to great lengths to make it work. You are essentially asking for you device to become a router.
To do this you will need to find a program (sorry can't remember any names at the moment) that will accomplish this on a normal linux distro. Then recompile it to fit the Android OS and install is into the native system.
This explanation may make a little more sense to you. If you go to your ADB shell and run netcfg (or ifconfig to verbose this) you will see the devices networking options. You can run an ifconfig command to set the device or change its state - but you cannot have multiple devices route data to and from the phone at the same time I wouldn't think.
This would be my best guess...
Related
I'm trying to debug Flutter apps with ADB over TCP, so tried the following (Android connected with USB) according to this:
adb tcpip 5555
adb connect <Android-ip-address>:5555
But I always get unable to connect to <Android-ip-address>:5555: No route to host.
I installed the plugin Android WiFi ADB to Android Studio, but...no hope.
After that, I tried to ping my Android phone from PC with that command ping <Android-ip-address>, but again it failed with that output From <PC-ip-address> icmp_seq=1 Destination Host Unreachable.
Now I tried to do the same thing (PC & phone), however on an another router (Tenda) and it worked like a charm.
So the problem is from my router, which is a D-Link with a firmware version ME_1.03. I searched for "Port Forwarding" and stuff like that, but I don't know what I'm doing and I didn't come up with any result.
What can I do to solve it.
It's not about router type (in case it doesn't use something different from TCP/IP, Lol). You need to double check, that both devices inside one local network.
Without any additional settings on router, your IP address could be like this xxx.xxx.xxx.***. Where part with xxx should be same both both device. When this is done, follow instruction from the source. Please note, you will need to connect devices with USB, before using TCP.
The firmware can be found here below DSL > 2750U, while there are 2-3 different hardware revisions, therefore it is rather unclear which device it actually is - for some revisions there is newer firmware. Generally, the router's network bridge in between wired LAN and WiFi needs to be enabled, in order to connect. Just see the router's manual on page 33 and 45. Without that bridge, you could only connect adb from a notebook, through the same wireless network segment, as the smartphone is connected to (unless "User Isolation" is enabled on the router).
Finally I found it. It's because of a feature (as others said) called WIFI/User Isolation in routers. But in my case, it's called Relay Blocking. Anyway, you have to disable it.
In D-Link (DSL-2740U) - Firmware Version ME_1.03:
Main Page ---> Advanced ---> Advanced Wireless Settings ---> Relay Blocking.
Check disabled choice.
I'm developing a platform using ODROID U3 with Android for a custom application. I merged the MPTCP Kernel Source with Android Kernel Source to get a MPTCP Enabled Kernel for Android.
The only thing is that Android by default disables the 3G Connection when a Wireless is available, and I want it to be both available to MPTCP work by share-loading it.
I can manually manage all stuff, but I didnt find what disables the 3G Connection and how to bypass it. I also have BSP if needed to bypass it.
Anyone knows where I can bypass or where it does the 3G Disconnection?
PS: I already saw Android High Priority Connection, and this doesnt apply to me. I need both connections working for I make the MPTCP routes transparently for the Network Access. Also I'm aware that this is not something I can do in non-rooted devices. I have root, and I can also recompile entire Android System from the BSPs. I searched all over the internet and I didnt find anything about that (only the High Priority Connection)
What I already have tryed:
1 - High Priority Connection: Works fine, but the application needs to be open. And I want the MPTCP system-aware not application-aware.
2 - Turn on Wifi, connect. And them manually bring up the Mobile Connection Interface via terminal: Doesn't work. For some reason the Mobile Connection doesn't get IP from DHCP.
3 - Search on Android BSP anything and anywhere it could switch off/on the Mobile Connection: Didn't find anything specific.
Thanks!
I found the solution here: https://sites.google.com/site/lotuseaterarpit/news/3g4gwififorandroidconcurrently
So basicly you need to disable wifi service from android (using svc wifi disable and them manually configure the Wireless Network as so:
Lets supose we have the wireless internet at wlan0, we will do:
Disable the Wifi Interface Service
svc wifi disable
Bring up Wifi Interface
busybox ifconfig wlan0 up
Configure wlan interface
iwconfig wlan0 mode managed essid YOUR_SSID
iwconfig wlan0 key s:WIRELESS_KEY
iwconfig wlan0 commit
DHCP interface to get IP
dhcpcd eth0
So with this, you can have your 3G Connection online together with Wireless Network. You need to configure the routes by yourself, but this will make you able to do that.
Hope it helps!
sometimes I have to connect my Nexus 5 to a WiFi network only to share some files with other devices, but this network does not have Internet access. I would like to use 3G for data connection while the phone is connected. Obviously I have root access. Is there any way to achieve this? (Not necessary a simple way)
My phone isn't rooted and I don't have a shell installed on it to test, but off the top of my head maybe this could help?
route -n - determine what routes are available
route add default gw <<ip address>> - replace with the gateway's IP address that you want to be the default. Make sure to run this command as root or with sudo.
I'm not familiar with Android shell access or the internals of how Android manages its networking. For all I know, the entire 3G Internet connection may shut down by default when you are on wifi. If all else fails, you could also consider a "mobile hotspot" app for your phone, and have the devices connect to you (as a bonus, they would have Internet access too).
More information on viewing default gateway with route command
I am developing a webpage in django (on my pc with windows 7) and now i need to test some pages in tablet pcs. suddenly the thought came if i can have an access to my localhost in windows from android tablet. is that possible? I am in the same wifi connection in both devices at home.
i read a lot questions and answers regarding this issue in stackoverflow and other places, but none of them gave me some concrete solutions.
I have samsung tab 2 10.1 with android 4.0.4.
appreciate any help, thanks
So, there are a couple of issues it seems. The question most of the answers are addressing is "how do you connect to another server in your local network?" (or variants). There are two answers, you can use the computer's IP directly, or you can use the computer's name (you may need to append .local). For example, my computer is xavier.local.
The second issue is that you seem to be addressing is that runserver is not accessible via other computers on the network (this is your actual question). The reason is that by default Django's runserver will only acknowledge requests from the machine which is calling them. This means that the default settings would make it so that you would only be able to access the server from Windows (and they did this on purpose for security reasons). In order for it to listen to other requests you have two options:
runserver 192.168.1.101:8000
# Only handle requests which are made to the IP address 192.168.1.101
Or (and this is easier when dealing with more than one environment):
runserver 0.0.0.0:8000 # handle all requests
So, if your IP address is 192.168.1.101:
runserver # only requests made on the machine will be handled
runserver 127.0.0.1 # only requests made on the machine will be handled
runserver 192.168.1.101 # handles all requests (unless IP changes)
runserver 192.168.1.100 # does not handle any requests (wrong IP)
runserver 0.0.0.0 # handles all requests (even if the IP changes)
I do think it important to note that 0.0.0.0 is realistically not a security question when dealing with a local, development machine. It only becomes a significant problem when working on a large app with a machine which can be addressed from the outside world. Unless you have port forwarding (I do), or something wonky like that, you should not be too concerned.
Though this thread was active quite a long time ago. This is what worked for me on windows 10. Posting it in details. Might be helpful for the newbies like me.
Add ALLOWED_HOSTS = ['*'] in django settings.py file
run django server with python manage.py 0.0.0.0:YOUR_PORT. I used 9595 as my port.
Make firewall to allow access on that port:
Navigate to control panel -> system and Security -> Windows Defender Firewall
Open Advanced Settings, select Inbound Rules then right click on it and then select New Rule
Select Port, hit next, input the port you used (in my case 9595), hit next, select allow the connections
hit next again then give it a name and hit next for the last time.
Now find the ip address of your PC.
Open Command Promt as adminstrator and run ipconfig command.
You may find more than one ip addresses. As I'm connected through wifi I took the one under Wireless LAN adapter WiFi. In my case it was 192.168.0.100
Note that this ip may change when you reconnect to the network. So you need to check it again then.
Now from another device (pc, mobile, tablet etc.) connected to the same network go to ip_address:YOUR_PORT (in my case 192.168.0.100:9595)
Hopefully you'll be good to go !
You can find out what the ip address of your PC is with the ipconfig command in a Windows command prompt. Since you mentioned them being connected over WiFi look for the IP address of the wireless adapter.
Since the tablet is also in this same WiFi network, you can just type that address into your tablet's browser, with the :8000 appended to it and it should pull up the page.
127.0.0.1 is a loopback address that means, roughly, "this device"; your PC and your android tablet are separate devices, so each of them has its own 127.0.0.1. In other words, if you try to go to 127.0.0.1 on your Android tab, it's trying to connect to a webserver on the Android device, which is not what you want.
However, you should be able to connect over the wifi. On your windows box, open a command prompt and execute ipconfig. Somewhere in the output should be your windows box's address, probably 192.168.1.100 or something similar. You tablet should be able to see the Django server at that address.
need to know the ip address of your machine ..
Make sure both of your machines (tablet and computer) connected to same network
192.168.0.22 - say your machine address
do this :
192.168.0.22:8000 -- from your tablet
this is it !!!
If both are connected to the same network, all you need to do is provide the IP address of your server (in your network) in your Android app.
Tested using easy EasyPHP DevServer 14.1.
The trick is you must first add your local ip address to the Apache server to listen to it.
Right click on the tray icon, go to "Configuration" -> "Apache" in the "httpd.config"
# Change this to Listen on specific IP addresses as shown below to
# prevent Apache from glomming onto all bound IP addresses.
#
#Listen 12.34.56.78:80
Listen 127.0.0.1:80
Listen 192.168.0.201:80 <<-- ADD THIS LINE
Then go to your Control Panel and deactivate your Windows Firewall or add your Smartphone/Tablet Ip Address to the exception.
That's it. I hope it helps.
The IP Address 192.168.0.201 may be different from yours. 192.168.0.X
I've struggled with this problem myself, and I couldn't figure out what it was, since it worked perfectly on my iPhone, I decided to look into the problem and find a quick solution.
My local machine is a Mac OSX 10.10+, one option would have been to start an Apache server, but that's super unhandy - changing the DocumentRoot every time you want to check something quickly on your Android device. Besides that, changing the DocumentRoot is a pain in the a** on Mac OSX 10.10.
If you want to use:
python -m SimpleHTTPServer
on your Android, do this:
sudo python -m SimpleHTTPServer [ANY PORT YOU WANT, BUT NOT 8000]
I hope this helps.
cheerz -Pit
Try this
python manage.py runserver
then connect both tablet and system to same wifi and browse in the address
eg: python manage.py runserver 192.168.0.100:8000
In tablet type that url in adress bar
In my case I was required to disconnect and reconnect to the same network (both phone and pc), after changing the firewall settings.
So, I'm running Ubuntu Linux on my laptop, and Android 4.0.4 on my mobile (I don't think this is relevant, but just in case). I've got my laptop unassociated from any networks, and my mobile is on my network and has been assigned (by DHCP) the IP of 192.168.0.109.
On my laptop, I did this:
ifconfig wlan0 down && airmon-ng start wlan0 && ifconfig wlan0 up .. this created my mon0 interface for promiscuous mode, if I'm not mistaken.
I fired up Wireshark, attached it to mon0 and assigned a display filter of ip.addr == 192.168.0.109, go back to my mobile, and navigate to a few websites. I get absolutely nothing.
The step listed here - unable to read packets captured from wifi network using wireshark - do not help either.
Anyone tell me what I'm doing wrong? :(
Thanks!
Set the WPA or WPA2 key by going to:
Edit ยป Preferences
Protocols
IEEE 802.11
Enable decryption
Enter the WPA or WPA2 key in Key #1 or the next field, or in more recent versions use the "Edit" button to add a key of type wpa-pwd with a value like myPassword:mySSID.
You might need monitor mode (promiscuous mode might not be sufficient). Also, make sure the device connects after you started monitoring (as Wireshark needs the handshake packets to decrypt).
See also these instructions.
The problem I was having was that the wifi card I was using wasn't giving errors when I switched modes, but it didn't support them none-the-less.
Using another card worked.
Thanks!