chcn wrote:
Lawrence Finch wrote:
The only way to force it to be on WiFi is to leave the screen on. Once the screen goes off WiFi goes off. So if you turn off cellular data you will receive or send no data when the phone is on standby. No cellular, no WiFi.
Apparently if you don't have a 3G connection (out of range, SIM card removed, etc., or maybe if the cellular data is turned off) then iOS 4
will persist the WiFi connection even when the screen is locked. (It may also be a requirement that the phone be plugged in; I haven't tested this myself.) See:
http://forums.macrumors.com/showthread.php?t=936074
http://discussions.apple.com/thread.jspa?threadID=2470304
Definitely true. You can test this yourself if you are able to get the IP address of your phone. There are multiple ways of doing this - your WiFi router usually has a page in the admin console that tells you what devices are connected and what their IP addresses are. There are also iPhone apps that tell your what your WiFi and 3G IP addresses are.
Anyway, once you get your WiFi IP address, get to a computer on your WiFi network and try this.
First, open some form of command line interface (in Windows, run the command 'cmd', in Mac OS X use Terminal). Type 'ping <ip address>' and hit enter. You should see something that looks like this:
PING 10.2.204.130 (10.2.204.130): 56 data bytes
64 bytes from 10.2.204.130: icmp_seq=0 ttl=63 time=55.623 ms
64 bytes from 10.2.204.130: icmp_seq=1 ttl=63 time=86.491 ms
64 bytes from 10.2.204.130: icmp_seq=2 ttl=63 time=100.350 ms
64 bytes from 10.2.204.130: icmp_seq=3 ttl=63 time=23.572 ms
(10.2.204.130 is my phone's current address - yours will differ and so will the timings). All this does is that it sends small amounts of data to your phone asking your phone to reply if its there, and these lines mean that your phone replied.
Now, with cellular data on, lock your screen and wait a couple of minutes - it seems the amount of time it takes to disable the wifi varies. Sometimes its as little as 15s, but other times its longer. If you run the same command as before, you should now see this:
Request timeout for icmp_seq 1
Request timeout for icmp_seq 2
Request timeout for icmp_seq 3
Request timeout for icmp_seq 4
Request timeout for icmp_seq 5
What this says is that your computer is no longer hearing back from your phone - i.e. your phone isn't on the WiFi network anymore.
Now, if you unlock your phone again and turn cellular data off and repeat this test, you should find that your phone will still respond to your computer even after it has been turned off for a while.
PING 10.2.204.130 (10.2.204.130): 56 data bytes
Request timeout for icmp_seq 0
64 bytes from 10.2.204.130: icmp_seq=1 ttl=63 time=80.645 ms
64 bytes from 10.2.204.130: icmp_seq=2 ttl=63 time=58.475 ms
64 bytes from 10.2.204.130: icmp_seq=3 ttl=63 time=82.140 ms
64 bytes from 10.2.204.130: icmp_seq=4 ttl=63 time=104.099 ms
64 bytes from 10.2.204.130: icmp_seq=5 ttl=63 time=25.705 ms
For this to happen, your phone doesn't need to be plugged in. I haven't tested the case where the phone is plugged in and cellular data is on.
These tests were all run on an iPhone 4 so YMMV if you have a different model - I don't know the exact differences.
Message was edited by: Lawrence T.
Message was edited by: Lawrence T. <added quote of message I'm replying to>