How to get the WiFi noise level in Android?
Asked Answered
I

1

7

     I want to implement an app which measures the quality of the WiFi signal from an indoor environment. From my research I found that the best way to get an accurate measurement is not to get only the RSSI but instead to use the SNR (Signal to Noise Ratio).

How can I obtain the noise level from the Android SDK? As I heard, there is no API available for this. However, I've found a method which provides the SNR (getEvdoSnr()). Unfortunately, this one works only for a GSM/CDMA signal and not for a WiFi connection.

Is anything possible to calculate the SNR in Android? I believe that's doable because I've found an app on Play store (called WiFi SNR) which successfully measures this ratio.


NOTE: The Android ScanResult doesn't provide the noise level, even if it's specified in the official documentation:

Describes information about a detected access point. In addition to the attributes described here, the supplicant keeps track of quality, noise, and maxbitrate attributes, but does not currently report them to external clients.

Impeccable answered 9/8, 2017 at 10:42 Comment(3)
no progress on the subject? Did you find a way to get the noise level?Dementia
@Dementia Still not found a solution for this, unfortunately. I've let only the RSSI in the App as a measurement, but still not a precise way to measure a signal.Impeccable
Agreed. Thanks for the response.Dementia
I
2

Use https://developer.android.com/reference/android/net/wifi/ScanResult.html.

Describes information about a detected access point. In addition to the attributes described here, the supplicant keeps track of quality, noise, and maxbitrate attributes, but does not currently report them to external clients.

I bet something like this will give to you desired information:

WifiManager manager = (WifiManager) getApplication().getSystemService(Context.WIFI_SERVICE);
for (ScanResult result : wifiManager.getScanResults()) {
   // do your stuff
}
Illene answered 9/8, 2017 at 11:1 Comment(3)
Thanks for the reply. I tried this before and there wasn't any relevant data which describe the noise level. However, I've integrated again this snippet and all I receive is this: scanResult= SSID: HI-LINK_006B, BSSID: 3c:33:00:a2:00:6a, HESSID: <none>, capabilities: [WPA-PSK-CCMP][WPA2-PSK-CCMP][WPS][ESS], level: -85, frequency: 2412, timestamp: 101848429875, distance: ?(cm), distanceSd: ?(cm)Impeccable
either, as described in API: Use calculateSignalLevel(int, int) to convert this number into an absolute signal level which can be displayed to a user.??Illene
Okay, this method is indeed used to classify the power strength (by levels), but still for RSSI signal. What I receive from ScanResults doesn't contain the noise signal (which is represented in dBm as RSSI). The noise should be a separated measurement.Impeccable

© 2022 - 2024 — McMap. All rights reserved.