0

I want to try something a little different with the speed of wifi. I don't want to know what speed is in Mb or KB/s. I want to know my speed in m/s and I want to calculate the distance from laptop to my router. For example or to other laptops or phones -- I want to see if I can create a map with the objects that I can connect to or see.

Is this possible? can someone help me in a direction? Are there programs or things that do this already?

2

3 Answers 3

4

I doubt if you will get any accurate figures due to the number of factors that influence packet delivery and turnaround time. There's a bit of discussion about what you are trying to do over at Stackoverflow: https://stackoverflow.com/questions/684781/how-to-get-distance-using-wi-fi

3

I'm assuming that your question is asking if you can determine the distance of a computer to a router using wifi, and the answer is yes... kinda.

Lets say you send a signal from your laptop to the router, and the router responds in kind, and that this round trip takes 20 nanoseconds, i.e. 10ns each way. Knowing that the speed of light c = 3.0*10^8m/s in air (actually, a little less, but that value is correct to 2 significant figures), we can determine the distance by d = c*t, which works out to be 3m.

However...

The response won't be sent by the router immediately. It takes time to decode the packet and compose a response, and you won't know how long this takes. The packet could sit in a queue for a few nanoseconds, which as we've seen from above, amounts to an extra metre or so. Luckily you don't have to worry about time domain multiplexing, which would make things worse.

Oh wait, there's more...

Without direct control of the hardware (in this case, the I/O controllers of the wifi radio), you don't actually know when your original packet is sent, or when the response is received. Usually, the OS will sit in between your program and the hardware. You're going to start your timer early and stop it late.

There's also the issue that, while it's technically feasible to do timing at a nanosecond resolution with a laptop, not all OS and hardware combinations will give you nanosecond resolution. Well what does microsecond timing give you? The 2 shortest distances are 0m and 300m, which is beyond the range of your typical wifi.

So, to sum up, the best you can do is put an upper limit on the distance, which may also be beyond the range of the wifi. You're never going to get consumer level hardware that is capable of doing this accurately.

0

It is possble, although not with speed (that would fluctuate too much and is dependent on too many factors). You can use sigal strength to estimate location. Ill try and find you a guide.

You must log in to answer this question.