Page MenuHomeFreeBSD

Correct wireless stats in i3status.
ClosedPublic

Authored by jhb on Aug 12 2015, 4:25 PM.
Tags
None
Referenced Files
F103564452: D3369.id7952.diff
Tue, Nov 26, 2:07 PM
Unknown Object (File)
Tue, Nov 12, 12:30 PM
Unknown Object (File)
Sun, Oct 27, 10:32 PM
Unknown Object (File)
Oct 23 2024, 8:49 PM
Unknown Object (File)
Oct 8 2024, 11:52 AM
Unknown Object (File)
Oct 5 2024, 10:10 AM
Unknown Object (File)
Oct 4 2024, 2:12 PM
Unknown Object (File)
Oct 4 2024, 5:29 AM
Subscribers

Details

Summary

Fix multiple issues with the wireless information reported by i3status for
an interface:

  • Instead of hoping that the currently associated AP will show up as the first AP in the list of scan results, fetch the BSSID of the currently associated AP and use that to fetch station info for the AP. This provides more frequently updated signal strength information than scan results and reliably provides information when multiple APs are in range.
  • Do not treat the RSSI value as a raw signal value in dBm. Instead, use the same formula as ifconfig(8) to compute a signal value.
  • Do not report the beacon interval value as a signal quality level.
Test Plan
  • Run i3status on my laptop while associated to "Warren" with this scan list:

SSID/MESH ID BSSID CHAN RATE S:N INT CAPS
HOME-4412 90:0d:cb:2a:44:10 1 54M -84:-95 100 EP WPS HTCAP WPA RSN WME

92:0d:cb:2a:44:10    1   54M -86:-95  100 EP   HTCAP RSN WME

xfinitywifi 96:0d:cb:2a:44:10 1 54M -86:-95 100 E HTCAP WME
ATTBgRvXPi cc:65:ad:63:f2:80 6 54M -60:-95 100 EP RSN HTCAP WPA WME
Warren 6c:70:9f:e9:9d:90 11 54M -60:-95 100 EP RSN HTCAP WPA WME
d crab f8:35:dd:36:55:05 11 54M -86:-95 100 EP RSN HTCAP WPS WME
HOME-E452 00:ac:e0:3a:e4:50 11 54M -87:-95 100 EP WPS HTCAP WPA RSN WME
raben 00:0c:41:82:61:39 7 54M -79:-95 100 EPS RSN
Warren 6c:70:9f:e9:9d:91 149 54M -66:-95 100 EP RSN HTCAP WPA WME

Previously the status was reported as "? at Warren". If Warren happened to
be the first AP it would have been repored with a quality of '100' always
(regardless of signal strength since it was using the 'INT' column from
ifconfig). Now with my format string set to display %signal instead of
%quality I get "-60 dBm at Warren" as my status text.

In addition, after changing from scan results to station info, the signal strength changes
periodically whereas before it changed rarely (I believe I have bgscan disabled, so it was
only scanning when trying to associate).

Diff Detail

Repository
rP FreeBSD ports repository
Lint
No Lint Coverage
Unit
No Test Coverage
Build Status
Buildable 66
Build 66: arc lint + arc unit

Event Timeline

jhb retitled this revision from to Correct wireless stats in i3status..
jhb updated this object.
jhb edited the test plan for this revision. (Show Details)
jhb added a reviewer: bapt.
jhb added a subscriber: adrian.
bapt edited edge metadata.
This revision is now accepted and ready to land.Aug 12 2015, 4:56 PM
x11/i3status/Makefile
17

Oops, this wasn't meant to be there.

jhb edited edge metadata.

Remove debugging.

This revision now requires review to proceed.Aug 12 2015, 5:19 PM
bapt edited edge metadata.
This revision is now accepted and ready to land.Aug 12 2015, 6:28 PM

hi,

you can have >1 SSID with the same BSSID. It's silly, but it happens. You may want to use both together as a key.

In D3369#68624, @adrian wrote:

hi,

you can have >1 SSID with the same BSSID. It's silly, but it happens. You may want to use both together as a key.

Bizarre. Does the stack "know" which AP you are connected to such that we could provide an ioctl to return the scan_results for just the AP you are connected to? I imagine that is something lots lof little widgets would like to use. If nothing else, we should possibly provide a wrapper API in a library that does that instead of duplicating this logic in N different places.

jhb edited edge metadata.

Use STA_INFO instead of SCAN_RESULTS. This results in simpler logic and
also gives more realtime signal strength info.

This revision now requires review to proceed.Aug 13 2015, 4:39 PM
jhb edited the test plan for this revision. (Show Details)
jhb edited edge metadata.
bapt edited edge metadata.
This revision is now accepted and ready to land.Aug 13 2015, 6:36 PM
jhb edited edge metadata.

Ensure this is updated.

This revision now requires review to proceed.Aug 14 2015, 6:31 PM

Last update removed "fail" debugging printfs. Those were sent to the output stream resulting in JSON parsing errors in i3 itself at which point i3 killed i3status (e.g. when wlan0 reassociated)

This revision was automatically updated to reflect the committed changes.