Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Network module signal inconsistent with iwconfig #1834

Description

@binshengliu

Describe the issue

I was a bit confused that the value of signal variable of network section is not good when I have a good WiFi reception.

For example, when the output from iwconfig is

Link Quality=62/70  Signal level=-48 dBm

I expect signal to be consistent with this output like showing 88 (from 62 * 10 / 7) but the real value is 57 which indicates a not so good reception intuitively.

In the code, I found signal is calculated based on a range from -90 to -20. (code)

I believe there was a reason for this. But have things changed because of the transition to libnl and now the signal range is between -110 to -40? (some discussion, code). It seems the Link Quality of iwconfig is simply calculated based on this (62 = -48 + 110).

Expected behavior:
WiFi signal value be consistent with other tools, for example, iwconfig.

Actual behavior:
The signal is not consistent with other tools.

Was it working before?
N/A

To Reproduce

A minimal but complete config with which the problem occurs:

[bar/primary_bar]
modules-right = wlan

[module/wlan]
type = internal/network
interface = ${env:WIFI:}
interval = 1
format-connected = <label-connected>
label-connected = %signal%

Polybar Log

N/A

Screenshots

N/A

Environment:

  • WM: N/A
  • Distro: N/A
  • Output of polybar -vvv:
$ polybar -vvv
polybar 3.3.1

Features: +alsa +curl +i3 +mpd +network(libnl) +pulseaudio +xkeyboard

X extensions: +randr (+monitors) -render -damage -sync +composite +xkb +xrm +xcursor

Build type: RelWithDebInfo
Compiler: /usr/bin/clang++
Compiler flags:  -Wall -Wextra -Werror -pedantic -pedantic-errors -Wno-error=parentheses-equality -Wno-zero-length-array
Linker flags:

Additional context

N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions