# Analyze netsh wlan show all for RSSI distance and location

12 views (last 30 days)
Life is Wonderful on 7 Dec 2019
Edited: Life is Wonderful on 16 Dec 2019
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%
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.
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
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%
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!!

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.
##### 2 CommentsShowHide 1 older comment
Life is Wonderful on 16 Dec 2019
Edited: Life is Wonderful on 16 Dec 2019
Thank you!!

### Categories

Find more on WLAN Toolbox in Help Center and File Exchange

### Community Treasure Hunt

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

Start Hunting!

Translated by