Analyze netsh wlan show all for RSSI distance and location

26 views (last 30 days)
I need help from the attached file ("myNetwork_bssid.txt") for the analysis of Signal (RSSI) to calculate the distance and location of Node.
Requirement : Calculate the distance and location of Node from AP using Signal .
SSID 3 : Taps
Network type : Infrastructure
Authentication : WPA2-Personal
Encryption : CCMP
BSSID 1 : 98:da:c4:1a:8d:75
Signal : 43%
Radio type : 802.11n
Channel : 3
Basic rates (Mbps) : 1 2 5.5 11
Other rates (Mbps) : 6 9 12 18 24 36 48 54
I would like to analyze above section of log data.
From the Signal (RSSI ) section i would like to derive the distance and location from AP.
  3 Comments
Adam Danz
Adam Danz on 9 Dec 2019
Edited: Adam Danz on 9 Dec 2019
Hi Matlab :D
I saw your message with a link to this post from your previous question but to be honest, it's not immediately obvious to me where I'd start to solve this one.
Life is Wonderful
Life is Wonderful on 10 Dec 2019
Edited: Life is Wonderful on 10 Dec 2019
Thanks a lot Guillaume and Adam.
With Reference to the article
With reference to the formula ,
d is regarded as the undetermined distance
?=10(?−RSSI)/10?.
RSSI = Signal ( Signal : 43%)
?=?(?0), the radio frequency parameter A indicating the received absolute value of mean energy, which is received from the projection node when distance is 1 m; it is in dBm
I need help on
  • Parsing the files. Get the below parameter in a structure
Signal : 80%
Radio type : 802.11n
Channel : 10
Basic rates (Mbps) : 1 2 5.5 11
Other rates (Mbps) : 6 9 12 18 24 36 48 54
  • Insert the Signal & A value to above formula.
I have used a small code snippet to get the the above files to get the Wlan Wifi data. May be you can help if you know more command to get the requirement better. I need your help in moving forward with your guidence.
clearvars;
clear all;
clc;
x = 1;
while (x < 5)
[bssid_status,bssid_cmdout] = system('netsh wlan show network mode=bssid > C:\Users\shastry\Mathwork_va\Wlan\tmp\myNetwork_bssid.txt &','-echo');
[all_sstatus,all_scmdout] = system('netsh wlan show all > C:\Users\shastry\Mathwork_va\Wlan\tmp\myNetwork.txt &','-echo');
[Interf_status,Interf_cmdout] = system('netsh wlan show interfaces > C:\Users\shastry\Mathwork_va\Wlan\tmp\myinterfaces.txt &','-echo');
% eval([bssid_cmdout,all_scmdout,Interf_cmdout]);
pause(0.50);
x = x + 1;
disp(x);
end
Thank you!!

Sign in to comment.

Accepted Answer

Guillaume
Guillaume on 10 Dec 2019
Here is a way to parse your netsh output. Note that it assumes that each SSID has only one BSSID, If there is more than one, you'll only get the first one.
[~, bssid_cmdout] = system('netsh wlan show network mode=bssid');
%build a regex:
tokens = compose("[^:]+: (?<%s>[^\\n]*)", ["NetworkType", "Authentication", "Encryption", "BSSID", "Signal", "RadioType", "Channel", "BasicRates", "OtherRates"]);
re = strjoin(["(?<=SSID \d+ : )(?<SSID>[^\n]*)", tokens], "");
%extract relevant data into structure:
ssids = regexp(bssid_cmdout, re, 'names');
%tidy up by converting a few fields to numeric
signals = num2cell(str2double(extractBefore({ssids.Signal}, '%')));
[ssids.Signal] = signals{:};
channels = num2cell(str2double({ssids.Channel}));
[ssids.Channel] = channels{:};
As for the rest, you'll have to figure it out on your own. I'm not going to read your paper for you.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!