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

fix no signal level from the card #88

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

jjess
Copy link

@jjess jjess commented Jun 2, 2023

Hi:

I'm requesting a pull to fix an issue when the card doesn't respond with the signal level. This issues produces that the tray icon always appears as no signal.

An example of answer of my card:

SSID/MESH ID                      BSSID              CHAN RATE    S:N     INT CAPS
aaa                         18:3c:b7:e3:83:d8    1   54M  -84:-96   100 EPS  RSN WME BSSLOAD HTCAP VHTCAP VHTOPMODE WPS
bbb                       78:81:02:60:c7:85  108   54M  -96:-96   100 EP   BSSLOAD VHTPWRENV HTCAP WME RSN WPS VHTCAP VHTOPMODE

In the example the ssid=bbb is the ssid my laptop is attached, and always the S:N is -96:-96, ... always. I've seen similar behaviors in the internet. To overcome this issue people use to launch the following command to obtain the level:

ifconfig wlan1 list sta

ADDR               AID CHAN RATE RSSI IDLE  TXSEQ  RXSEQ CAPS FLAG        
78:81:02:60:c7:85   66  108  54M 63.0    0   5084  61664 EP   AQU          BSSLOAD VHTPWRENV HTCAP WME RSN WPS VHTCAP VHTOPMODE (rssi 0.0:0.0:0.0:0.0 nf 0:0:0:0)

And the output shows the RSSI level.

The fix I put into the code consists of executing this command, and when the variable 'percentage' is 0 for the connected ssi, then replace it for the percentage calculated with the RSSI level.

This fix the issue. The code maybe could be cleaner... and it's not heavy tested...

There is something that is not clear to me. To convert from RSSI dBms to percentage I've used this formula:

percentage=quality=2 * ((RSSI * -1) + 100)

But in my case what I obtain is 74% despite of my laptop is just front the router, and because of that the reception is optimal. In the code I've change the formula for this one:

qual=2 * ((RSSI * -1) + 113)

After reading some document in the internet... but I'm not 100% sure.

Thanks for you master piece networkmgr that help all of use using freebsd/ghostbsd/... a lot.

BR,

Jes

@jjess jjess requested a review from a team as a code owner June 2, 2023 09:52
networkmgr Outdated Show resolved Hide resolved
@ericbsd
Copy link
Member

ericbsd commented Jun 4, 2023

The problem is the RSSI does not look right. Changing the formula does not fix the issue that iwlwifi and iwm are not reporting proper RSSI. I got the same issue with one of my laptops.

@ericbsd
Copy link
Member

ericbsd commented Jun 4, 2023

Since RSSI varies greatly between chipset manufacturers, this is probably the worst to calculate the signal level.

@ericbsd ericbsd added the bug Something isn't working label Jun 18, 2023
@ericbsd ericbsd self-requested a review August 30, 2024 21:57
@ericbsd
Copy link
Member

ericbsd commented Aug 30, 2024

I have tested this more, and it looks like it fixes most of the recent cards. I can't merge it since it is out of sync.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: In Review
Development

Successfully merging this pull request may close these issues.

2 participants