linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* every other wireless scan shows bogus (too low) signal strengths
@ 2022-11-30 21:19 Bruno Dantas
  2022-12-01  7:57 ` Johannes Berg
  0 siblings, 1 reply; 7+ messages in thread
From: Bruno Dantas @ 2022-11-30 21:19 UTC (permalink / raw)
  To: linux-wireless

I have an X230 ThinkPad with coreboot and Intel Dual Band Wireless-AC 7265 card, which uses the iwlwifi kernel module. Module's wifi power saving is off (the default setting).

When I scan for wifi hotspots at the command line, every other scan gives me bogus (too low) signal strengths and every other scan gives me expected signal strengths:

bruno@x230:~$ sudo iw dev wlan0 scan flush | grep -e 'signal:' -e 'SSID:' | head -10
	signal: -69.00 dBm
	SSID: donkey_2.4GHz
	signal: -81.00 dBm
	SSID: donkey_5GHz
	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 flush | grep -e 'signal:' -e 'SSID:' | head -10
	signal: -42.00 dBm
	SSID: donkey_2.4GHz
	signal: -64.00 dBm
	SSID: donkey_5GHz
	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 flush | grep -e 'signal:' -e 'SSID:' | head -10
	signal: -69.00 dBm
	SSID: donkey_2.4GHz
	signal: -78.00 dBm
	SSID: donkey_5GHz
	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 flush | grep -e 'signal:' -e 'SSID:' | head -10
	signal: -43.00 dBm
	SSID: donkey_2.4GHz
	signal: -61.00 dBm
	SSID: donkey_5GHz
	signal: -79.00 dBm
	SSID: Spencer
	signal: -80.00 dBm
	SSID: wattslolahome
	signal: -82.00 dBm
	SSID: wattslolahome-guest
etc.

The problem is distro-agnostic (I use Devuan x86_64 and Tiny Core Linux x86_64 and both are affected). Problem is not specific to iw (if I scan with iwlist I see a similar pattern). The pattern is always the same: First scan after a fresh boot is always bad, second one is good, etc. 

Does anyone know why this happens and how to fix it so that every scan shows the expected signal strengths?


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: every other wireless scan shows bogus (too low) signal strengths
  2022-11-30 21:19 every other wireless scan shows bogus (too low) signal strengths Bruno Dantas
@ 2022-12-01  7:57 ` Johannes Berg
  2022-12-01 20:06   ` Bruno Dantas
  0 siblings, 1 reply; 7+ messages in thread
From: Johannes Berg @ 2022-12-01  7:57 UTC (permalink / raw)
  To: Bruno Dantas, linux-wireless

On Wed, 2022-11-30 at 16:19 -0500, Bruno Dantas wrote:
> I have an X230 ThinkPad with coreboot and Intel Dual Band Wireless-AC
> 7265 card, which uses the iwlwifi kernel module. Module's wifi power
> saving is off (the default setting).
> 
> When I scan for wifi hotspots at the command line, every other scan
> gives me bogus (too low) signal strengths and every other scan gives
> me expected signal strengths:

> [...]

> Does anyone know why this happens and how to fix it so that every scan shows the expected signal strengths?
> 

I think this NIC might be switching antennas for scan every time.

If you're able to open it, it might be a good idea to check if they're
both connected well, almost seems like one might not be connected quite
correctly?

Not sure I have any better idea.

You could record debug data with trace-cmd [1] and then at least we
could confirm this is the case.

johannes

[1]
https://wireless.wiki.kernel.org/en/users/drivers/iwlwifi/debugging#tracing

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: every other wireless scan shows bogus (too low) signal strengths
  2022-12-01  7:57 ` Johannes Berg
@ 2022-12-01 20:06   ` Bruno Dantas
  2022-12-02  7:24     ` Julian Calaby
  0 siblings, 1 reply; 7+ messages in thread
From: Bruno Dantas @ 2022-12-01 20:06 UTC (permalink / raw)
  To: Johannes Berg, linux-wireless

Hi, Johannes. Thank you for your help.

To exclude a bad network card, I replaced my laptop's card with a different one (with the same Intel AC 7265 chipset). The replacement card fared no better. Therefore, I put the original card back and ensured that the two antenna wires are securely connected. There is no doubt now that the wires are secure, but the problem persists.

Unfortunately I cannot seem to make  trace-cmd  work:

bruno@x230:~$ sudo trace-cmd record -e iwlwifi
trace-cmd: No such file or directory
  No events enabled with iwlwifi
bruno@x230:~$ sudo trace-cmd record -e iwlwifi -e mac80211 -e cfg80211 -e iwlwifi_msg
trace-cmd: No such file or directory
  No events enabled with iwlwifi

Perhaps the  iwlwifi  kernel module was not configured to allow this operation? I found this line in my kernel's configuration:

$ cat /boot/config-5.10.0-9-amd64
---snip---
# CONFIG_IWLWIFI_DEVICE_TRACING is not set
---snip---

Oh, well. This is proving to be a tough nut to crack. My workaround for the time being is to discard every other wifi hotspot scan. Since my minimalistic laptop only performs wifi scans in one shell script, this is easy to achieve:

iw dev wlan0 scan flush >/dev/null 
iw dev wlan0 scan flush >/tmp/scan_results.txt

It's a kludge alright, but it will tide me over until I figure out what the real problem is (if ever).

-Bruno

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: every other wireless scan shows bogus (too low) signal strengths
  2022-12-01 20:06   ` Bruno Dantas
@ 2022-12-02  7:24     ` Julian Calaby
  2022-12-02 15:21       ` Bruno Dantas
  0 siblings, 1 reply; 7+ messages in thread
From: Julian Calaby @ 2022-12-02  7:24 UTC (permalink / raw)
  To: Bruno Dantas; +Cc: Johannes Berg, linux-wireless

Hi Bruno,

On Fri, Dec 2, 2022 at 7:08 AM Bruno Dantas <dantas@airpost.net> wrote:
>
> Hi, Johannes. Thank you for your help.
>
> To exclude a bad network card, I replaced my laptop's card with a different one (with the same Intel AC 7265 chipset). The replacement card fared no better. Therefore, I put the original card back and ensured that the two antenna wires are securely connected. There is no doubt now that the wires are secure, but the problem persists.

Stupid question, is there any chance that one of the antennas is damaged?

You might get slightly different behaviour if you swap them - if your
X230 is anything like my X200, there should be enough slack do that.

If it turns out that one of them is bad, you might be able to find
replacements on eBay or Aliexpress, or in the worst case scenario just
install a generic antenna.

Hardware Maintenance Manual is here:
https://support.lenovo.com/us/en/manuals/um014928-hardware-maintenance-manual
and the steps to replace the antennas don't look too onerous.

Thanks,

-- 
Julian Calaby

Email: julian.calaby@gmail.com
Profile: http://www.google.com/profiles/julian.calaby/

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: every other wireless scan shows bogus (too low) signal strengths
  2022-12-02  7:24     ` Julian Calaby
@ 2022-12-02 15:21       ` Bruno Dantas
  2023-01-19 19:22         ` Johannes Berg
  0 siblings, 1 reply; 7+ messages in thread
From: Bruno Dantas @ 2022-12-02 15:21 UTC (permalink / raw)
  To: Julian Calaby; +Cc: Johannes Berg, linux-wireless

Hi, Julian.

> Stupid question, is there any chance that one of the antennas is damaged?
As best as I can tell, both antennas (black and gray wires) are intact.

> You might get slightly different behaviour if you swap them - if your
> X230 is anything like my X200, there should be enough slack do that.
Good idea, so I gave it a shot. Alas, behavior is the same when I swap the black and gray antennas.

I have a stash of these Intel AC 7265 half-height mini PCIe WiFi adapters, so thought I'd try yet another one. Interestingly, with the third adapter the behavior is worse: Every scan gives me the spuriously low signal strengths. I put my original adapter back in, of course.

Maybe doing a wifi network scan requires more power than just authenticating with an AP and using the network? And maybe my after-market 802.11ac adapter requires a bit more power than the 802.11n adapters that were around when this laptop was made? If so, maybe it takes this old laptop's PCI bus two attempts before the 802.11ac adapter has enough power to do an accurate network scan? That's a lot of maybes, but it's my best guess given the behavior I'm observing.

I'm ready to give up on troubleshooting this (for now, anyway). I can live with my workaround of discarding every other network scan result.

Thank you guys for your help.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: every other wireless scan shows bogus (too low) signal strengths
  2022-12-02 15:21       ` Bruno Dantas
@ 2023-01-19 19:22         ` Johannes Berg
  2023-01-19 20:25           ` Bruno Dantas
  0 siblings, 1 reply; 7+ messages in thread
From: Johannes Berg @ 2023-01-19 19:22 UTC (permalink / raw)
  To: Bruno Dantas, Julian Calaby; +Cc: linux-wireless

On Fri, 2022-12-02 at 10:21 -0500, Bruno Dantas wrote:
> 
> Maybe doing a wifi network scan requires more power than just
> authenticating with an AP and using the network? And maybe my after-
> market 802.11ac adapter requires a bit more power than the 802.11n
> adapters that were around when this laptop was made? If so, maybe it
> takes this old laptop's PCI bus two attempts before the 802.11ac
> adapter has enough power to do an accurate network scan? That's a lot
> of maybes, but it's my best guess given the behavior I'm observing.
> 

FWIW - and sorry I didn't get around to answering here earlier - that
doesn't really make a lot of sense - we're talking about the report of
"received signal strength", which is pretty much unrelated to the power
you need to actually receive.

But as to what's actually going on I still have no clue either, sorry.

johannes

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: every other wireless scan shows bogus (too low) signal strengths
  2023-01-19 19:22         ` Johannes Berg
@ 2023-01-19 20:25           ` Bruno Dantas
  0 siblings, 0 replies; 7+ messages in thread
From: Bruno Dantas @ 2023-01-19 20:25 UTC (permalink / raw)
  To: Johannes Berg, Julian Calaby; +Cc: linux-wireless

Thank you for getting back to me, Johannes. My hypothesis was a wild guess based on almost no evidence, so I'm not surprised that it was totally wrong :)

Despite remaining unexplained, the behavior is perfectly consistent. Plus, my system is very minimalistic (e.g., there is no network manager, all network scans are explicitly initiated by me, I only use iw for scans). Because of this, I wrote a wrapper script around iw. If action is anything other than scan, the script bails out and passes all arguments to the iw executable. If action is scan, script does a disposable scan then passes all arguments to the iw executable. It's ugly as heck but I can live with it.

Happy hacking,
Bruno

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2023-01-19 20:25 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-30 21:19 every other wireless scan shows bogus (too low) signal strengths Bruno Dantas
2022-12-01  7:57 ` Johannes Berg
2022-12-01 20:06   ` Bruno Dantas
2022-12-02  7:24     ` Julian Calaby
2022-12-02 15:21       ` Bruno Dantas
2023-01-19 19:22         ` Johannes Berg
2023-01-19 20:25           ` Bruno Dantas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).