-
-
Save etem/9dec6ed39ccdabb6435c0322762e5a0d to your computer and use it in GitHub Desktop.
convert WiFi signal strength (dBm) to distance (meters)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python2 | |
| # a simple script for one of my articles - https://cryptolok.blogspot.com/2017/08/practical-wifi-hosts-triangulation-with.html | |
| from math import log10 | |
| MHz=raw_input('MHz FREQUENCY (2417, 5200, ...) : ') | |
| MHz=int(MHz) | |
| dBm=raw_input('dBm TRANSMITTER POWER (23, 63, ...) : ') | |
| dBm=int(dBm) | |
| FSPL = 27.55 | |
| # Free-Space Path Loss adapted avarage constant for home WiFI routers and following units | |
| m = 10 ** (( FSPL - (20 * log10(MHz)) + dBm ) / 20 ) | |
| m=round(m,2) | |
| print 'DISTANCE : ',m,'m' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment