Programing

신호 강도를 사용하여 Wi-Fi 라우터와의 거리를 계산하는 방법은 무엇입니까?

lottogame 2020. 10. 15. 07:23
반응형

신호 강도를 사용하여 Wi-Fi 라우터와의 거리를 계산하는 방법은 무엇입니까?


건물 내 모바일 장치의 정확한 위치를 계산하고 싶습니다 (GPS 액세스 불가)

3 개 이상의 고정 Wi-Fi 신호 (위치를 알고있는 고정 라우터 3 개)의 신호 강도 (dBm 단위)를 사용하여이 작업을 수행하고 싶습니다.

Google은 이미 그렇게하고 있으며이 데이터를 기반으로 정확한 위치를 찾는 방법을 알고 싶습니다.

자세한 내용은이 문서를 확인하십시오. http://www.codeproject.com/Articles/63747/Exploring-GoogleGears-Wi-Fi-Geo-Locator-Secrets


FSPL은 두 가지 매개 변수에 따라 달라집니다. 첫 번째는 무선 신호의 주파수이고 두 번째는 무선 전송 거리입니다. 다음 공식은 이들 간의 관계를 반영 할 수 있습니다.

FSPL (dB) = 20log10(d) + 20log10(f) + K

d = distance
f = frequency
K= constant that depends on the units used for d and f
If d is measured in kilometers, f in MHz, the formula is:

FSPL (dB) = 20log10(d)+ 20log10(f) + 32.44

Fade Margin 방정식에서 Free Space Path Loss는 다음 방정식으로 계산할 수 있습니다.

여유 공간 경로 손실 = Tx 전력 -Tx 케이블 손실 + Tx 안테나 이득 + Rx 안테나 이득-Rx 케이블 손실-Rx 감도-페이드 마진

위의 두 개의 자유 공간 경로 손실 방정식을 사용하여 거리 (km)를 찾을 수 있습니다.

Distance (km) = 10(Free Space Path Loss – 32.44 – 20log10(f))/20

프레 넬 존은 전파가 안테나를 떠난 후 확산되는 가시선 주변 영역입니다. 특히 2.4GHz 무선 시스템의 경우 강도를 유지하기 위해 명확한 가시선을 원합니다. 2.4GHz 파장은 나무에서 발견되는 물처럼 물에 흡수되기 때문입니다. 경험상 프레 넬 존의 60 %는 장애물이 없어야합니다. 일반적으로 20 % 프레 넬 영역 차단은 링크에 대한 신호 손실을 거의 발생시키지 않습니다. 40 % 차단을 넘으면 신호 손실이 커집니다.

FSPLr=17.32*√(d/4f)

d = distance [km]
f = frequency [GHz]
r = radius [m]

출처 : http://www.tp-link.com/en/support/calculator/


거리를 계산하려면 신호 강도와 신호 주파수가 필요합니다. 다음은 자바 코드입니다.

public double calculateDistance(double signalLevelInDb, double freqInMHz) {
    double exp = (27.55 - (20 * Math.log10(freqInMHz)) + Math.abs(signalLevelInDb)) / 20.0;
    return Math.pow(10.0, exp);
}

사용 된 공식은 다음과 같습니다.

거리 = 10 ^ ((27.55-(20 * log10 (주파수)) + signalLevel) / 20)

예 : 주파수 = 2412MHz, signalLevel = -57dbm, 결과 = 7.000397427391188m

이 공식은 FSPL (Free Space Path Loss) 공식 의 변형 된 형태입니다 . 여기서 거리는 미터로 측정되고 주파수는 메가 헤르츠로 측정됩니다. 다른 측정의 경우 다른 상수 (27.55)를 사용해야합니다. 여기 에서 상수를 읽으 십시오 .

자세한 내용은 여기 를 참조 하십시오 .


K = 32.44
FSPL = Ptx - CLtx + AGtx + AGrx - CLrx - Prx - FM
d = 10 ^ (( FSPL - K - 20 log10( f )) / 20 )

여기:

  • K-상수 ( fMHz 및 dkm 단위 인 경우 32.44, fMHz 및 dm 단위 인 경우 -27.55로 변경 )
  • FSPL -여유 공간 경로 손실
  • Ptx -송신기 전력, dBm (최대 20dBm (100mW))
  • CLtx, CLrx-송신기 및 수신기의 케이블 손실, dB (케이블이없는 경우 0)
  • AGtx, AGrx-송신기 및 수신기의 안테나 이득, dBi
  • Prx -수신기 감도, dBm (최저 -100dBm (0.1pW))
  • FM -페이드 마진, dB (14dB 이상 (정상) 또는 22dB 이상 (양호))
  • f -신호 주파수, MHz
  • d -거리, m 또는 km (K 값에 따라 다름)

참고 : TP-Link 지원 사이트의 공식에 오류가 있습니다 (mising ^).

Prx수신 신호 강도로 대체 하여 WiFi AP와의 거리를 얻습니다.

예 : Ptx = 16dBm, AGtx = 2dBi, AGrx = 0, Prx = -51dBm (수신 신호 강도), CLtx = 0, CLrx = 0, f = 2442MHz (7 번째 802.11bgn 채널), FM = 22. 결과 : FSPL = 47dB, d = 2.1865m

Note: FM (fade margin) seems to be irrelevant here, but I'm leaving it because of the original formula.

You should take into acount walls, table http://www.liveport.com/wifi-signal-attenuation may help.

Example: (previous data) + one wooden wall ( 5 dB, from the table ). Result: FSPL = FSPL - 5 dB = 44 dB, d = 1.548 m

Also please note, that antena gain dosn't add power - it describes the shape of radiation pattern (donut in case of omnidirectional antena, zeppelin in case of directional antenna, etc).

None of this takes into account signal reflections (don't have an idea how to do this). Probably noise is also missing. So this math may be good only for rough distance estimation.


the simple answer to your question would be Triangulation. Which is essentially the concept in all GPS devices, I would give this article a read to learn more about how Google goes about doing this: http://www.computerworld.com/s/article/9127462/FAQ_How_Google_Latitude_locates_you_?taxonomyId=15&pageNumber=2.

From my understanding, they use a service similar to Skyhook, which is a location software that determines your location based on your wifi/cellphone signals. In order to achieve their accuracy, these services have large servers of databases that store location information on these cell towers and wifi access points - they actually survey metropolitan areas to keep it up to date. In order for you to achieve something similar, I would assume you'd have to use a service like Skyhook - you can use their SDK ( http://www.skyhookwireless.com/location-technology/ ).

However, if you want to do something internal (like using your own routers' locations) - then you'd likely have to create an algorithm that mimics Triangulation. You'll have to find a way to get the signal_strength and mac_address of the device and use that information along with the locations of your routers to come up with the location. You can probably get the information about devices hooked up to your routers by doing something similar to this ( http://www.makeuseof.com/tag/check-stealing-wifi/ ).


Distance (km) = 10^((Free Space Path Loss – 92.45 – 20log10(f))/20)


In general, this is a really bad way of doing things due to multipath interference. This is definitely more of an RF engineering question than a coding one.

Tl;dr, the wifi RF energy gets scattered in different directions after bouncing off walls, people, the floor etc. There's no way of telling where you are by trianglation alone, unless you're in an empty room with the wifi beacons placed in exactly the right place.

Google is able to get away with this because they essentially can map where every wifi SSID is to a GPS location when any android user (who opts in to their service) walks into range. That way, the next time a user walks by there, even without a perfect GPS signal, the google mothership can tell where you are. Typically, they'll use that in conjunction with a crappy GPS signal.

What I have seen done is a grid of Zigbee or BTLE devices. If you know where these are laid out, you can used the combined RSS to figure out relatively which ones you're closest to, and go from there.


Don't care if you are a moderator. I wrote my text towards my audience not as a technical writer

All you guys need to learn to navigate with tools that predate GPS. Something like a sextant, octant, backstaff or an astrolabe.

If you have receive the signal from 3 different locations then you only need to measure the signal strength and make a ratio from those locations. Simple triangle calculation where a2+b2=c2. The stronger the signal strength the closer the device is to the receiver.

참고URL : https://stackoverflow.com/questions/11217674/how-to-calculate-distance-from-wifi-router-using-signal-strength

반응형