Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: How to convert the signal from dBm to percentage? #18

Open
ulkesh11 opened this issue Apr 13, 2018 · 2 comments
Open

Question: How to convert the signal from dBm to percentage? #18

ulkesh11 opened this issue Apr 13, 2018 · 2 comments
Labels

Comments

@ulkesh11
Copy link

ulkesh11 commented Apr 13, 2018

Is there a formal way to convert the signal from dBm to percentage?

@bmegli
Copy link
Owner

bmegli commented Apr 15, 2018

I know no formal way.

It generally goes like here:
https://eyesaas.com/wi-fi-signal-strength/

Throughput and reliability goes down as signal degrades but this also tends to be device specific.
For example this is plot boasting asus tinker board WiFi vs probably RPi (from here):

wifi-tinker-rpi

A lot depends on application. For example this is what I ended up in one of the projects (through tests):

  • min dBm -80
  • max dBm -45
  • warning level dBm -67
  • critical level dBm -70

I had a bar:

  • green if above warning level
  • yellow if between warning and critical level
  • and red when below critical level

This was realtime application and below -70 dBm the devices didn't communicate reliably.

NL80211_BSS_SIGNAL_UNSPEC

There is NL80211 attribute that has the meaning you want but:

  • from what I remember it is only contained when taking the long scan results
  • the devices that I use didn't return it at all

From what I remember this has vendor specific implementation/meaning and is not mandatory (I may be wrong here).

nl80211 header

* @NL80211_BSS_SIGNAL_UNSPEC: signal strength of the probe response/beacon
 *	in unspecified units, scaled to 0..100 (u8)

Wavemon

You can also have a look what wavemon does. The procedure is something along the way:

  • if there is signal quality reported (BSS_SIGNAL_UNSPEC) use it
  • otherwise if below -110 dBm then signal quality 0
  • otherwise if above -40 dBm then signal quality 100% (70/70)
  • otherwise linear interpolation between [-110, -40] to [0%, 100%] respectively

Edit 1: corrected typos

@bmegli
Copy link
Owner

bmegli commented Apr 15, 2018

If you have no better idea use procedure like wavemon. You may use different cutoff levels, those seem to be arbitrarily chosen in wavemon ( > -40 as 100% and < -110 as 0%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants