6

I am using my android phone as Access Point. Now I want to find the distance and direction of the wifi devices connected with my phone.

Please help me through suitable example and code.

Thanks in advance.

Osmani
  • 61
  • 1
  • 1
  • 2
  • 3
    Unless I'm very much mistaken, you can't get the direction - your antenna picks up the signal without a sense of direction. Likewise, you can't get the distance, just the signal strength, which is not the same as distance. Move in front of a wall or put a book in front of the antenna, and your strength will change significantly. – EboMike May 14 '11 at 20:49
  • 2
    You are not mistaken :) There is no descent way to detect distance and direction using one Wi-Fi antenna for a general case (i.e. without assumptions about environment). – inazaruk May 14 '11 at 22:02
  • You could always get a large array of devices with identical antennas, get the signal strength of each one and the devices' positions via GPS, and use that to triangulate the access point :) – EboMike May 15 '11 at 01:06
  • Thanks Ebomike and inazaruk for your valuable answer. There is a application name "OpenSignalMap" which gives compass direction of available APs. How they do it? Sorry for poor question. I am not that much expert in this. – Osmani May 15 '11 at 16:51
  • I have just downloaded Wifi Radar from android market. It shows the compass direction of my adhoc network. Please anyone knows the answer & have suitable example reply here. It will be a great help. – Osmani May 15 '11 at 19:35
  • IIRC OpenSignalMap is basically like Wigle, in that it records the signals detected by users of the app (and possibly references wigles database) to provide a guesstimate of AP locations based on trilateration. By compiling multiple passes, and/or multiple devices passing, around an area/AP a best guess can be generated of the APs location. Its not perfect, but it works. Its exactly the same principle as wardriving with a GPS back in the day. It also can be seen as an invasion of privacy/stalking if you are focusing on a particular network that you do not own or have permission to fiddle with. – Tank R. Jul 17 '23 at 10:11

1 Answers1

10

I downloaded Wifi Radar that you mentioned and tried it. There's an important step there - it asks you to rotate on the spot for a bit while holding the device to your body.

So my guess is that it uses the internal compass to figure out which direction you're pointing to, and then measures the signal. When the signal gets stronger, it figures that you're pointing toward the AP.

Since the app asks you to hold your device to your body, it's trying to use you as a shield, so if you're facing away from the AP, your body will weaken the signal.

EboMike
  • 76,846
  • 14
  • 164
  • 167