MATLAB Answers

Analyze netsh wlan show all for RSSI distance and location

36 views (last 30 days)
Jogger on 7 Dec 2019
Edited: Jogger 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%
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.


Guillaume on 9 Dec 2019
This is completely outside of my domain but I don't see how you can derive location or distance with the information you have. The only useful piece of information you have is signal strength which is never going to give you direction (required for location). While the signal power is affected by distance it's also affected by obstacles such as walls so it's not going to be enough to know distance.
Adam Danz
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.
Jogger 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%
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.
clear all;
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]);
x = x + 1;
Thank you!!

Sign in to comment.

Accepted Answer

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!