Tiny Core Extensions > TCE Corepure64
how to get reliable signal strengths when doing CLI wifi scan?
GNUser:
I'm running TCL 13.1 x86_64 on my X230 ThinkPad, which has a Intel Dual Band Wireless-AC 7265 card. The two CLI tools that I'm familiar with, iw and iwlist, alternate between reporting accurate signal strengths and reporting spuriously low signal strengths.
Here are consecutive runs using iw when I am just standing still in my house. Note how the signal strengths go up and down each time I run the command:
--- Code: ---bruno@x230:~$ sudo iw dev wlan0 scan | grep -e 'signal:' -e 'SSID:' | head -10
signal: -42.00 dBm
SSID: donkey
signal: -64.00 dBm
SSID: bibliotheca_alexandrina
signal: -80.00 dBm
SSID: Spencer
signal: -80.00 dBm
SSID: wattslolahome
signal: -84.00 dBm
SSID: wattslolahome-guest
bruno@x230:~$ sudo iw dev wlan0 scan | grep -e 'signal:' -e 'SSID:' | head -10
signal: -69.00 dBm
SSID: donkey
signal: -78.00 dBm
SSID: bibliotheca_alexandrina
signal: -80.00 dBm
SSID: Spencer
signal: -80.00 dBm
SSID: wattslolahome
signal: -84.00 dBm
SSID: wattslolahome-guest
bruno@x230:~$ sudo iw dev wlan0 scan | grep -e 'signal:' -e 'SSID:' | head -10
signal: -43.00 dBm
SSID: donkey
signal: -61.00 dBm
SSID: bibliotheca_alexandrina
signal: -79.00 dBm
SSID: Spencer
signal: -80.00 dBm
SSID: wattslolahome
signal: -82.00 dBm
SSID: wattslolahome-guest
bruno@x230:~$ sudo iw dev wlan0 scan | grep -e 'signal:' -e 'SSID:' | head -10
signal: -69.00 dBm
SSID: donkey
signal: -81.00 dBm
SSID: bibliotheca_alexandrina
signal: -79.00 dBm
SSID: Spencer
signal: -80.00 dBm
SSID: wattslolahome
signal: -82.00 dBm
SSID: wattslolahome-guest
--- End code ---
If I append the flush option to the iw command (like this: sudo iw dev wlan0 scan flush) it makes no difference.
Using iwlist results in the same shenanigans. Watch:
--- Code: ---bruno@x230:~$ sudo iwlist wlan0 scan | grep -e "Signal" -e "SSID" | head -10
Quality=68/70 Signal level=-42 dBm
ESSID:"donkey"
Quality=47/70 Signal level=-63 dBm
ESSID:"bibliotheca_alexandrina"
Quality=27/70 Signal level=-83 dBm
ESSID:"wattslolahome-guest"
Quality=28/70 Signal level=-82 dBm
ESSID:"Ring Setup 9b"
Quality=30/70 Signal level=-80 dBm
ESSID:"Spencer"
bruno@x230:~$ sudo iwlist wlan0 scan | grep -e "Signal" -e "SSID" | head -10
Quality=42/70 Signal level=-68 dBm
ESSID:"donkey"
Quality=30/70 Signal level=-80 dBm
ESSID:"bibliotheca_alexandrina"
Quality=27/70 Signal level=-83 dBm
ESSID:"wattslolahome-guest"
Quality=28/70 Signal level=-82 dBm
ESSID:"Ring Setup 9b"
Quality=30/70 Signal level=-80 dBm
ESSID:"Spencer"
bruno@x230:~$ sudo iwlist wlan0 scan | grep -e "Signal" -e "SSID" | head -10
Quality=68/70 Signal level=-42 dBm
ESSID:"donkey"
Quality=45/70 Signal level=-65 dBm
ESSID:"bibliotheca_alexandrina"
Quality=33/70 Signal level=-77 dBm
ESSID:"wattslolahome-guest"
Quality=25/70 Signal level=-85 dBm
ESSID:"Ring Setup 9b"
Quality=31/70 Signal level=-79 dBm
ESSID:"Spencer"
bruno@x230:~$ sudo iwlist wlan0 scan | grep -e "Signal" -e "SSID" | head -10
Quality=42/70 Signal level=-68 dBm
ESSID:"donkey"
Quality=30/70 Signal level=-80 dBm
ESSID:"bibliotheca_alexandrina"
Quality=33/70 Signal level=-77 dBm
ESSID:"wattslolahome-guest"
Quality=25/70 Signal level=-85 dBm
ESSID:"Ring Setup 9b"
Quality=31/70 Signal level=-79 dBm
ESSID:"Spencer"
--- End code ---
Does anyone know how to make one of these utilities give consistent results? If not, is there a different CLI tool that gives consistent results?
GNUser:
I noticed that the first scan after boot gives the bogus low strengths, second scan gives accurate strengths, third scan gives bogus low strengths, etc.
Since I only have one shell script that scans for wireless networks, this is my (truly hideous) solution for the time being:
--- Code: ---sudo iw dev wlan0 scan flush >/dev/null
sudo iw dev wlan0 scan flush >/tmp/wifi-scan-results.txt
--- End code ---
In other words, every time I need to do a wifi scan, I first discard the scan with bogus signal strengths, then scan again and save the result with the accurate signal strengths. A true kludge if I ever saw one!
GNUser:
The problem must be hardware-related. A different TCL13 x86_64 machine (ThinkPad T520 with Intel Centrino Advanced-N 6205 card) does not have this problem at all (i.e., consecutive wifi scans show consistent signal strengths).
I don't know if the bug is in the kernel, the Wireless-AC 7265 card, or card's driver. I imagine that troubleshooting this would not be fun. I'm happy to use my kludge on the machine that needs it.
Sorry for the noise.
patrikg:
Don't be sorry for some noise.
The problems needs to be solved. :)
I know little of computers but some times I get the correct answer for the problems.
When you describe your problem two thing come in mind, some wifi chips comes with some
power savings features, and maybe your problem has something to do with that.
So the first command wakes up the wifi, and the second command do it's real thing.
Some bios settings can disable the power saving features.
Maybe this feature depending on if your computer is connected to the power outlet, or just using the battery.
And i think some drivers can also change this behavior, just need correct mod flags.
Don't let your computer steer you, you have the control of your own computer. :)
And you say that you using dualband, maybe you use the same ssid for 5GHz and 2.4Ghz
The driver switches between this two, so my suggestion you have to change your router to have two ssid to distinguish between this two frequencies.
The signal strengths, is much better with 2.4 because of the "low" frequency.
Happy hacking
gadget42:
haven't used this but it looks interesting and the readme was informative and thought-provoking
https://github.com/ghostop14/sparrow-wifi
Navigation
[0] Message Index
[#] Next page
Go to full version