How does wifi determine a device’s location? [duplicate]
When I use any location based app or website, how does it know that my laptop or smartphone is where it is?
2 Answers 2
Purely Wi-Fi-based geolocation requires an active Internet connection, and is done by doing a Wi-Fi scan, noting the BSSIDs (the unique numeric hardware MAC addresses) of the Wi-Fi APs (wireless routers) in range, and sending that list of BSSIDs to a web service that looks up the known geo-coordinates of those APs, and reports back what your geo-coordinates must be, based on what APs you’re closest to.
The databases of what Wi-Fi APs are where are kept up to date by smartphones and 3G/4G tablets. Those devices have GPS receivers in them, so they know where they are by GPS. They periodically check their GPS location, and then do a Wi-Fi scan to see which APs are nearby. Then they report that information back to the vendor (Apple, Google, Microsoft, etc.) so that those vendors can keep their Wi-Fi geolocation databases up to date.
Devices that have GPS can’t always get a good signal lock on enough GPS satellites to tell their position accurately (indoors, or in «urban canyons» among tall buildings, or in vehicles), so sometimes Wi-Fi-based geolocation can be used to assist GPS. Also, for devices that have WWAN radios (smartphones, 3G/4G tablets, etc.), location of cell towers can be used as well.
It’s possible to do Wi-Fi geolocation without an Internet connection, but to do that, you’d have to cache a copy of the database, which might be too big. But a smartphone might have an optimization where it caches sections of the database for the city/area it already knows you’re in, so that even if you don’t have an Internet connection later in the same day in the same region, it can still look up your current position using the cached part of the database. If law enforcement gets ahold of your phone, they could possibly look at what areas your phone has cached as evidence of where your phone was on what date within the last few days.
Modern OSes use these methods together (GPS, cell tower, Wi-Fi) to get an idea of where your device is, and make that available to apps via a «Location Services» API. For websites, there’s a web browser standard geolocation API. OSes and web browsers that offer these APIs usually ensure that the user must be prompted for permission before an app or website is allowed to use the API to determine where you are.
The least reliable method of geolocation is IP-address-based geolocation, or «GeoIP». That uses public records of what IP address ranges have been assigned to which regional ISPs, or which IP address ranges have been known to be deployed in various cities/regions by bigger ISPs. That’s how sketchy websites offer you ads for meeting hot sexy singles in $YOURCITY tonight. Because any website (or web ad server) you connect to can see which IP address your HTTP request came from, they can use this to get an idea of what city you’re probably in, without using the web browser geolocation API, thus without you being prompted to give permission.
Wifi location
Get your location with WiFi Mac Address and GoogleMap.
REQUIREMENTS:
INSTALL:
% gem install wifi_location
HELP:
% whereami --help options: -help (-h) show help -towers dump WiFi towers -dump dump ALL -map show Google Map URL -version (-v) show version -- wifi_location v0.0.6 - http://shokai.github.com/wifi_location
GET Location:
% whereami lat=35.3880376,lon=139.4262089 % open `whereami --map` => https://maps.google.com/?ll=35.3880376,139.4262089
Dump Data:
% whereami --dump <"towers":[<"bssid":"4c:e6:76:50:30:93","signal":-77>,,,,,,,],"location":,"longitude":139.4261648,"accuracy":55.0>>
LOCALE:
% export LANG=ja.JP % whereami --dump <"towers":[<"signal":-77,"bssid":"4c:e6:76:50:30:93">,,,,,,,],"location":,"longitude":139.4261413,"accuracy":49.0>>
Rubygem Usage:
require 'rubygems' require 'wifi_location' loc = WiFiLocation.location puts "#loc['latitude']>, #loc['longitude']>" p loc['address']
Determining location with Wi Fi
Is there a way that I can determine a location of a laptop/phone connected to my router via a wireless network access point? (I do not want to use GPS. only the access point).
Alternatively do you mean that you have a laptop connected to a wireless access point and you want to know where you are based on that wireless access point?
3 Answers 3
If you can get the metrics from the router, which might or might not be possible, you can get the signal strength. This will give you a circle. But, this is limited, as you also need to know how strong the WiFi card is to determine rough distance. But, you probably know the rough distance your router works under, or the max circle, so this is not very useful.
If you have more than one access point, however, you can use triangulation. With two, the information is limited; three or more will give you a more accurate distance and allow you to extrapolate the strength of the signal.
Nope. You might be able to estimate its distance away, but even that is not likely if you’re inside a building. Various building materials attenuate the signal, so the response is non-linear. If your router has two separate antennas, and you can measure the signal strengh from each independently, then you might have a chance of getting a feel for the direction, but I doubt the signal resolution will be high enough to give you any meaningful data.
Yes. However you’ll need more than one Access Point and some serious software.
There are a number of solutions available and in-development for Location Based Services in Wi-Fi Networks. As Gregory mentioned above a single AP is not enough to do anything but poor range estimation, however multiple APs do not typically use triangulation to determine the location solution, they use a trained Hidden Markov Model.
Related
Hot Network Questions
Subscribe to RSS
To subscribe to this RSS feed, copy and paste this URL into your RSS reader.
Site design / logo © 2023 Stack Exchange Inc; user contributions licensed under CC BY-SA . rev 2023.7.13.43531
By clicking “Accept all cookies”, you agree Stack Exchange can store cookies on your device and disclose information in accordance with our Cookie Policy.