0

I'm would like to use local Wi-Fi Hotspot with no Internet access to connect to multiple Android phones. The problem is, even though is a local network with only a few phones connected and no Internet connection, the phones are a few centimeters away from the hotspot, yet cummunication seems slow/unreliable.

Here are a couple of ping results from a computer to the phone IPs:

PING 192.168.0.100 (192.168.0.100): 56 data bytes
64 bytes from 192.168.0.100: icmp_seq=0 ttl=64 time=393.810 ms
64 bytes from 192.168.0.100: icmp_seq=1 ttl=64 time=158.493 ms
64 bytes from 192.168.0.100: icmp_seq=2 ttl=64 time=181.057 ms
Request timeout for icmp_seq 3
Request timeout for icmp_seq 4
64 bytes from 192.168.0.100: icmp_seq=4 ttl=64 time=1006.483 ms
64 bytes from 192.168.0.100: icmp_seq=5 ttl=64 time=37.513 ms
64 bytes from 192.168.0.100: icmp_seq=6 ttl=64 time=64.257 ms
64 bytes from 192.168.0.100: icmp_seq=7 ttl=64 time=93.225 ms
64 bytes from 192.168.0.100: icmp_seq=8 ttl=64 time=111.115 ms
64 bytes from 192.168.0.100: icmp_seq=9 ttl=64 time=139.826 ms
^C
--- 192.168.0.100 ping statistics ---
10 packets transmitted, 9 packets received, 10.0% packet loss
round-trip min/avg/max/stddev = 37.513/242.864/1006.483/286.991 ms
PING 192.168.0.101 (192.168.0.101): 56 data bytes
64 bytes from 192.168.0.101: icmp_seq=0 ttl=64 time=385.699 ms
64 bytes from 192.168.0.101: icmp_seq=1 ttl=64 time=203.539 ms
64 bytes from 192.168.0.101: icmp_seq=2 ttl=64 time=151.443 ms
64 bytes from 192.168.0.101: icmp_seq=3 ttl=64 time=232.699 ms
64 bytes from 192.168.0.101: icmp_seq=4 ttl=64 time=219.184 ms
64 bytes from 192.168.0.101: icmp_seq=5 ttl=64 time=262.831 ms
64 bytes from 192.168.0.101: icmp_seq=6 ttl=64 time=249.220 ms
64 bytes from 192.168.0.101: icmp_seq=7 ttl=64 time=266.070 ms
64 bytes from 192.168.0.101: icmp_seq=8 ttl=64 time=471.806 ms
64 bytes from 192.168.0.101: icmp_seq=9 ttl=64 time=114.990 ms
^C
--- 192.168.0.101 ping statistics ---
10 packets transmitted, 10 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 114.990/255.748/471.806/99.526 ms
PING 192.168.0.103 (192.168.0.103): 56 data bytes
64 bytes from 192.168.0.103: icmp_seq=0 ttl=64 time=319.546 ms
64 bytes from 192.168.0.103: icmp_seq=1 ttl=64 time=137.394 ms
64 bytes from 192.168.0.103: icmp_seq=2 ttl=64 time=160.845 ms
64 bytes from 192.168.0.103: icmp_seq=3 ttl=64 time=184.010 ms
64 bytes from 192.168.0.103: icmp_seq=4 ttl=64 time=206.503 ms
64 bytes from 192.168.0.103: icmp_seq=5 ttl=64 time=24.546 ms
64 bytes from 192.168.0.103: icmp_seq=6 ttl=64 time=47.437 ms
64 bytes from 192.168.0.103: icmp_seq=7 ttl=64 time=69.973 ms
64 bytes from 192.168.0.103: icmp_seq=8 ttl=64 time=93.257 ms
64 bytes from 192.168.0.103: icmp_seq=9 ttl=64 time=730.538 ms
^C
--- 192.168.0.103 ping statistics ---
11 packets transmitted, 10 packets received, 9.1% packet loss
round-trip min/avg/max/stddev = 24.546/197.405/730.538/195.910 ms

I've used a macbook to ping with a D-Link DIR-505 set to Wi-Fi Hotspot to Xperia phones with the shipped Android OS 4.1.2.

I think the ping responses are slow and inconsistent. Has anyone else experienced this ? Why does this happen and how can this be fixed/improved ?

Update based on Sergey's input:

Pinging the computer from the phone doesn't look great: ping android 1 ping android 2

And here's the output using adb shell:

shell@android:/ $ ping -c 10 192.168.1.18
PING 192.168.1.18 (192.168.1.18) 56(84) bytes of data.
64 bytes from 192.168.1.18: icmp_seq=1 ttl=64 time=1012 ms
64 bytes from 192.168.1.18: icmp_seq=2 ttl=64 time=8.21 ms
64 bytes from 192.168.1.18: icmp_seq=3 ttl=64 time=184 ms
64 bytes from 192.168.1.18: icmp_seq=4 ttl=64 time=714 ms
64 bytes from 192.168.1.18: icmp_seq=5 ttl=64 time=635 ms
64 bytes from 192.168.1.18: icmp_seq=6 ttl=64 time=556 ms
64 bytes from 192.168.1.18: icmp_seq=7 ttl=64 time=171 ms
64 bytes from 192.168.1.18: icmp_seq=8 ttl=64 time=705 ms
64 bytes from 192.168.1.18: icmp_seq=9 ttl=64 time=622 ms
64 bytes from 192.168.1.18: icmp_seq=10 ttl=64 time=238 ms

--- 192.168.1.18 ping statistics ---
10 packets transmitted, 10 received, 0% packet loss, time 9015ms
rtt min/avg/max/mdev = 8.210/484.855/1012.056/300.283 ms, pipe 2

This is a bit worrying. Also, the power saving scenario sounds plausible but not sure if it still applies in my case as I've got the Stay awake setting turned on and the above tests were done with the usb cable connected and powering the device.

1 Answer 1

3

This behavior may be caused by power management features, and does not indicate a problem. Try installing Android Terminal Emulator on the phone and pinging either the router or a normal PC (not another phone) by running ping -c 10 <address> from there. You should notice that ping results in this direction are better.

(Note that without the -c <n> option you will need to figure out how to send Ctrl+C to the terminal to stop ping; it is possible to use a volume button as Ctrl if your keyboard does not provide such a key.)

The difference between pinging a phone from another device and sending pings from the phone itself is that when the phone itself sends ping requests, it is active and can receive the ping response without any significant delay. However, when you attempt to ping the phone from another device, the phone is most likely is in some low-power state, and waking it up can take noticeable time. Wi-Fi also has some powersaving features (e.g., the access point can buffer packets directed to a mobile device and transmit them only according to a specified schedule, so that the mobile device can stay in a low-power state between these scheduled polls).

Because of all these powersaving features you cannot make any conclusion about the Wi-Fi link quality just from ping results you show, unless you either turn off any powersaving during the test (see below for an example in my tests), or at least perform testing from the phone side.

Here is what I see when pinging my Samsung Galaxy W (GT-I8150) using the unofficial CyanogenMod 9 ROM, when the phone is idle with the screen off:

PING 192.168.43.114 (192.168.43.114) 56(84) bytes of data.
64 bytes from 192.168.43.114: icmp_req=1 ttl=64 time=690 ms
64 bytes from 192.168.43.114: icmp_req=2 ttl=64 time=418 ms
64 bytes from 192.168.43.114: icmp_req=3 ttl=64 time=329 ms
64 bytes from 192.168.43.114: icmp_req=4 ttl=64 time=54.7 ms
64 bytes from 192.168.43.114: icmp_req=5 ttl=64 time=579 ms
64 bytes from 192.168.43.114: icmp_req=6 ttl=64 time=306 ms
64 bytes from 192.168.43.114: icmp_req=7 ttl=64 time=217 ms
64 bytes from 192.168.43.114: icmp_req=8 ttl=64 time=557 ms
64 bytes from 192.168.43.114: icmp_req=9 ttl=64 time=467 ms
64 bytes from 192.168.43.114: icmp_req=10 ttl=64 time=195 ms

--- 192.168.43.114 ping statistics ---
10 packets transmitted, 10 received, 0% packet loss, time 9006ms
rtt min/avg/max/mdev = 54.730/381.686/690.746/187.341 ms

As you can see, the results look pretty bad. However, when I start Android Terminal Emulator and select the ”Take WifiLock” command in it, then turn off the screen again, I get significantly better results:

PING 192.168.43.114 (192.168.43.114) 56(84) bytes of data.
64 bytes from 192.168.43.114: icmp_req=1 ttl=64 time=95.5 ms
64 bytes from 192.168.43.114: icmp_req=2 ttl=64 time=2.66 ms
64 bytes from 192.168.43.114: icmp_req=3 ttl=64 time=94.3 ms
64 bytes from 192.168.43.114: icmp_req=4 ttl=64 time=2.62 ms
64 bytes from 192.168.43.114: icmp_req=5 ttl=64 time=88.9 ms
64 bytes from 192.168.43.114: icmp_req=6 ttl=64 time=3.14 ms
64 bytes from 192.168.43.114: icmp_req=7 ttl=64 time=91.9 ms
64 bytes from 192.168.43.114: icmp_req=8 ttl=64 time=5.57 ms
64 bytes from 192.168.43.114: icmp_req=9 ttl=64 time=93.9 ms
64 bytes from 192.168.43.114: icmp_req=10 ttl=64 time=2.62 ms

--- 192.168.43.114 ping statistics ---
10 packets transmitted, 10 received, 0% packet loss, time 9010ms
rtt min/avg/max/mdev = 2.622/48.136/95.551/44.845 ms

And if I repeat the same test with the screen on, ping result is even better:

PING 192.168.43.114 (192.168.43.114) 56(84) bytes of data.
64 bytes from 192.168.43.114: icmp_req=1 ttl=64 time=2.29 ms
64 bytes from 192.168.43.114: icmp_req=2 ttl=64 time=2.21 ms
64 bytes from 192.168.43.114: icmp_req=3 ttl=64 time=8.87 ms
64 bytes from 192.168.43.114: icmp_req=4 ttl=64 time=3.27 ms
64 bytes from 192.168.43.114: icmp_req=5 ttl=64 time=4.01 ms
64 bytes from 192.168.43.114: icmp_req=6 ttl=64 time=2.26 ms
64 bytes from 192.168.43.114: icmp_req=7 ttl=64 time=2.22 ms
64 bytes from 192.168.43.114: icmp_req=8 ttl=64 time=2.13 ms
64 bytes from 192.168.43.114: icmp_req=9 ttl=64 time=2.73 ms
64 bytes from 192.168.43.114: icmp_req=10 ttl=64 time=2.23 ms

--- 192.168.43.114 ping statistics ---
10 packets transmitted, 10 received, 0% packet loss, time 9011ms
rtt min/avg/max/mdev = 2.132/3.226/8.878/1.970 ms

(For some reason, releasing the WifiLock and even closing the terminal emulator does not restore the original behavior, until I turn Wi-Fi off, then back on — probably there is a bug somewhere.)

Running ping from the phone itself gives about 12 ms average RTT without taking the WifiLock, and 1.95 ms after taking the WifiLock — so even when testing from the phone side the effect of WifiLock is significant.

3
  • I'd suggest Hacker's Keyboard anyway, not only to be able to send Ctrl-C.
    – ott--
    Jun 3, 2013 at 19:38
  • @ott-- Yes, in fact I use it too. Jun 3, 2013 at 19:48
  • @SergeyVlasov I've tried what you've suggested, results look a bit better, but still kind of slow. Am I missing something ? Jun 4, 2013 at 11:35

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .