List of WiFi APs with signal strenghts, SSIDs and BSSIDs

General discussions about Automagic and automation in general

Moderator: Martin

Post Reply
xdauser
Posts: 35
Joined: 05 Aug 2015 17:55

List of WiFi APs with signal strenghts, SSIDs and BSSIDs

Post by xdauser » 30 Dec 2017 17:30

Is it possible to get list of available WiFi APs with signal strength, SSIDs and BSSIDs?
Unfortunately Automagic trigger "WiFi Scan Results Available" is very limited and gives only SSIDs of available APs and nothing else.
I know that there are 3rd party apps which give excessive info like that, for example. WiFi Overwiev 360 Pro.
I would appreciate If somebody could at last point me in right direction.

User avatar
Desmanto
Posts: 2709
Joined: 21 Jul 2017 17:50

Re: List of WiFi APs with signal strenghts, SSIDs and BSSIDs

Post by Desmanto » 30 Dec 2017 17:45

You should use Condition Wifi available instead. Don't know why, but this give more info than the trigger. (I thought it supposed to be vice versa)
More detail in http://automagic4android.com/forum/view ... f=4&t=6900

BSSID is shown, It will list along with the available SSID. But unfortunately, for signal, it will always shows the strongest one from all available wifi.
If you put filter of the current connected SSID, then it will shows only the strongest one from the same SSID.
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.

xdauser
Posts: 35
Joined: 05 Aug 2015 17:55

Re: List of WiFi APs with signal strenghts, SSIDs and BSSIDs

Post by xdauser » 30 Dec 2017 18:15

BSSID is shown, It will list along with the available SSID. But unfortunately, for signal, it will always shows the strongest one from all available wifi.
If you put filter of the current connected SSID, then it will shows only the strongest one from the same SSID.
Condition WiFi Available provides more info indeed. As you said it only provides only one signal strength (the strongest one). That will do! At least I can identify the AP with strongest signal and confirm if I am connected to it or not.
Learning Automagic everyday :-) Thanks a lot!f

Here it is in script form made by Martin:
Martin wrote:Hi,

This information is not directly made available by Automagic. You could try to use the Java features available in action Script to access the scan results and extract the information yourself.

Following snippet should get you started:

Code: Select all

wifiManager=callJavaMethod(getContext(), "android.content.Context", "getSystemService(java.lang.String)", "wifi");
scanResults=callJavaMethod(wifiManager, "android.net.wifi.WifiManager", "getScanResults()");

for(sr in scanResults)
{
  ssid=getJavaField(sr, "android.net.wifi.ScanResult", "SSID");
  bssid=getJavaField(sr, "android.net.wifi.ScanResult", "BSSID");
  level=getJavaField(sr, "android.net.wifi.ScanResult", "level");

  log(ssid+", "+bssid+" -->"+level);
}
Regards,
Martin

User avatar
Desmanto
Posts: 2709
Joined: 21 Jul 2017 17:50

Re: List of WiFi APs with signal strenghts, SSIDs and BSSIDs

Post by Desmanto » 31 Dec 2017 09:27

I wish I know more how to use java properly in Automagic. I have learnt the basic java and have understood the class, constructor and method. But still confused how to use them properly in Automagic.
So far, I only know about this (above), decodeURL, hex conversion and the display resolution. I am sure there are a lot more we can do.
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.

Post Reply