forked from lalithsuresh/odin
-
Notifications
You must be signed in to change notification settings - Fork 17
Application ShowMatrixOfDistancedBs
Jose Saldana edited this page Sep 25, 2017
·
4 revisions
The code is here.
It builds a matrix of the "distance" in dB between Wi-5 APs. During a time interval, each AP sends beacons with a special SSID (odin_init
), and the rest of APs hear them. They can then calculate the average signal level.
Both things (sending and receiving) are performed by the auxiliary wireless interface (shown in green in the figure): it switches to channel 6 in the three APs.
In the example shown below, there are 3 APs:
- 1 - 192.168.1.13
- 2 - 192.168.1.14
- 3 - 192.168.1.15
This is the output of an AP, first sending beacons and then scanning:
[Odinagent.cc] ########### Read scanning flags --> ClientScanningFlag: 0 APScanningFlag: 0 MesurementBeaconFlag: 0
[Odinagent.cc] ########### Send mesurement beacon (SSID odin_init) in channel 6
[Odinagent.cc] ########### Send mesurement beacon: Testing command line --> hostapd_cli -i wlan1 chan_switch 0 2437 > /dev/null
[Odinagent.cc] ########### Send mesurement beacon: command line --> hostapd_cli -i wlan1 chan_switch 0 2437 > /dev/null
[Odinagent.cc] ########### Changing scanning flags --> ClientScanningFlag:0 APScanningFlag:0 MesurementBeaconFlag:0
[Odinagent.cc] ########### Read scanning flags --> ClientScanningFlag: 0 APScanningFlag: 0 MesurementBeaconFlag: 0
[Odinagent.cc] ########### Scanning for APs (SSID odin_init) in channel 6
[Odinagent.cc] ########### Scanning for APs: Testing command line --> hostapd_cli -i wlan1 chan_switch 0 2437 > /dev/null
[Odinagent.cc] ########### Scanning: Sending AP scanning values
[Odinagent.cc] ########### Read scanning flags --> ClientScanningFlag: 0 APScanningFlag: 0 MesurementBeaconFlag: 0
[Odinagent.cc] ########### Send mesurement beacon (SSID odin_init) in channel 6
[Odinagent.cc] ########### Send mesurement beacon: Testing command line --> hostapd_cli -i wlan1 chan_switch 0 2437 > /dev/null
[Odinagent.cc] ########### Changing scanning flags --> ClientScanningFlag:0 APScanningFlag:0 MesurementBeaconFlag:0
[Odinagent.cc] ########### Read scanning flags --> ClientScanningFlag: 0 APScanningFlag: 0 MesurementBeaconFlag: 0
[Odinagent.cc] ########### Scanning for APs (SSID odin_init) in channel 6
[Odinagent.cc] ########### Scanning for APs: Testing command line --> hostapd_cli -i wlan1 chan_switch 0 2437 > /dev/null
[Odinagent.cc] ########### Scanning: Sending AP scanning values
This is the output in the controller:
[ShowScannedStationsStatistics] Matrix of Distance
[ShowScannedStationsStatistics] ==================
[ShowScannedStationsStatistics]
[ShowMatrixOfDistancedBs] Scanning channel 6
[ShowScannedStationsStatistics]
[ShowMatrixOfDistancedBs] Agent to send mesurement beacon: /192.168.1.13
[ShowMatrixOfDistancedBs] Request for scanning during the interval of 5000 ms in SSID odin_init
[ShowMatrixOfDistancedBs] Agent: /192.168.1.15
[ShowMatrixOfDistancedBs]
[ShowMatrixOfDistancedBs] Agent: /192.168.1.15 in channel 6
AP MAC: DC:EF:09:E6:9C:DB
avg signal: -69.3930215965 dBm
[ShowMatrixOfDistancedBs]
[ShowMatrixOfDistancedBs] Agent: /192.168.1.14 in channel 6
AP MAC: DC:EF:09:E6:9C:DB
avg signal: -52.4795155218 dBm
[ShowMatrixOfDistancedBs] Agent to send mesurement beacon: /192.168.1.15
[ShowMatrixOfDistancedBs] Request for scanning during the interval of 5000 ms in SSID odin_init
[ShowMatrixOfDistancedBs] Agent: /192.168.1.13
[ShowMatrixOfDistancedBs]
[ShowMatrixOfDistancedBs] Agent: /192.168.1.13 in channel 6
AP MAC: E4:F4:C6:F4:87:EF
avg signal: -69.3930215965 dBm
[ShowMatrixOfDistancedBs]
[ShowMatrixOfDistancedBs] Agent: /192.168.1.14 in channel 6
AP MAC: E4:F4:C6:F4:87:EF
avg signal: -50 dBm
[ShowMatrixOfDistancedBs] Agent to send mesurement beacon: /192.168.1.14
[ShowMatrixOfDistancedBs] Request for scanning during the interval of 5000 ms in SSID odin_init
[ShowMatrixOfDistancedBs] Agent: /192.168.1.13
[ShowMatrixOfDistancedBs]
[ShowMatrixOfDistancedBs] Agent: /192.168.1.13 in channel 6
AP MAC: DC:EF:09:E6:9E:DF
avg signal: -50 dBm
[ShowMatrixOfDistancedBs]
[ShowMatrixOfDistancedBs] Agent: /192.168.1.15 in channel 6
AP MAC: DC:EF:09:E6:9E:DF
avg signal: -50.8462611787 dBm
This would be the matrix of "distances" in dB between the APs:
0 -52.47 -69.39
-50 0 -50.84
-69.39 -50 0