This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Erratic wifi scanning behaviour

Tags: None
(comma "," separated)
noric
Registered Member
Posts
42
Karma
0
OS

Erratic wifi scanning behaviour

Tue Nov 03, 2015 6:16 pm
I have a strange issue with wifi network scanning.
To put it simply:
1) if I scan the neighbourhood when I'm on battery, I can see a huge number of networks (about 15);
2) if I scan the neighbourhood when the AC adapter is plugged in, I can see only my wifi network.
Note that it's not a matter of signal strength, because my wifi network is always about 50dBm, both on battery and on AC power.

I'm scanning in terminal with
Code: Select all
sudo iwlist wlan0 scanning | grep "ESSID"


I also noticed the following pattern taking place:
1) I scan on battery and find a lot of networks;
2) I plug the AC adapter in;
3) I immediately scan and find the same number of networks;
4) I scan again and again and I find fewer and fewer networks;
5) I keep scanning until eventually (in less then a minute) only my wifi network is found.

My wifi card is an Intel 6300N. KDE 4.14.2. Linux Mint 17.1. Kernel 3.13.0-37.
My wifi network is the strongest, other networks aren't stronger than 70 dBm at best. Although this shouldn't be relevant.
The issue doesn't affect only the terminal command, but also the "Network Management" plasmoid in the system tray, although this is slower than the command line to respond to changes.

Is there a logic behind what I see?
Thanks.
luebking
Karma
0

Re: Erratic wifi scanning behaviour

Tue Nov 03, 2015 8:59 pm
Either the battery/cable causes some EM stir that interfers (should not happen, indicates defective hardware) or the system* wants to save battery and decreases the tx power, just that it messes up the battery state.

just run "sudo iwconfig" before and after plugging the AC. This should list all network devices and for the WIFI ones some info - "Tx-Power" being the obviously interesting one ;-)

* no idea whether powerdevil has such feature, a lot of things (networkmanager, some dedicated AC listener, even the hardware) could trigger this.
noric
Registered Member
Posts
42
Karma
0
OS

Re: Erratic wifi scanning behaviour

Tue Nov 03, 2015 9:52 pm
The issue doesn't exist on Windows (I have a dual boot), so I'd rule out defective hardware.

Txpower is the same (15dBm) on AC and on DC, I had already tested with iwconfig.

Note that on battery it actually works better than on AC, not the other way round. On battery I see a lot of networks, on AC only mine.

On battery, power management is turned on for the wifi card. But I've manually turned it on/off and that's not the key factor.
noric
Registered Member
Posts
42
Karma
0
OS

Re: Erratic wifi scanning behaviour

Tue Nov 03, 2015 10:44 pm
Ok, I've found something useful.

The relevant setting seems to be '/sys/class/scsi_host/host1/link_power_management_policy'. This gets set to 'min_power' on battery, while it's set on 'max_performance' on AC.
Changing it to 'min_power' when I'm on AC, I can find immediately a lot of networks in the neighbourhood.

Host1 appears to be my hard drive, a Samsung 840 Evo mSata. I wonder how this is related to network scanning.
Any idea/suggestion? It works on Windows, so it's not hardware related.
Thanks

Edit: I've tried a benchmark of the ssd, and read/write speed is only slightly lower with 'min_power' set. However, I don't think it's a good idea to have the ssd always set to 'min_power'.
luebking
Karma
0

Re: Erratic wifi scanning behaviour

Thu Nov 05, 2015 9:41 am
Underpowered?
Check powertop on AC loaders, maybe try to suspend the compositor (SHIFT+Alt+F12) to ease load of the GPU.
noric
Registered Member
Posts
42
Karma
0
OS

Re: Erratic wifi scanning behaviour

Thu Nov 05, 2015 9:52 pm
What do you mean by "Check powertop on AC loaders"? I'm familiar with powertop, I used it to improve my power consumption on battery.

I already suspend the compositor (SHIFT+Alt+F12) when I'm on battery, that's done automatically with a script. I've now tried to toggle compositing on AC, but that doesn't help with wifi networks detection.

I've tried LinSSID (a GUI tool similar to inSSIDer for Windows) and it's consistent with the command line. See the screenshot with the ssd set to max_performance and min_power rispectively.
Image
Image
I think I can rule out power starvation, because the signal strength of my network is pretty constant (-49dBm in both cases).

Thanks
noric
Registered Member
Posts
42
Karma
0
OS

Re: Erratic wifi scanning behaviour

Fri Nov 06, 2015 10:00 am
I've now turned on my phone's wifi tethering and I can see it in the wireless networks list.
Could this mean that only strong networks (my phone is next to my notebook) are shown?

Update: it turns out that with the ssd set to "min_power" I have a slight increase in wifi throughput (testing with a gigabit ethernet desktop). From 8.5-9MB/s to 9.5/10MB/s.
Maybe interference?
luebking
Karma
0

Re: Erratic wifi scanning behaviour

Fri Nov 06, 2015 11:00 pm
powertop, powerstat or simply "cat /sys/class/power_supply/BAT0/power_now" should tell you the current drain (this only works on battery)
The idea was to check the increase on (permanent) WiFi scanning w/ and w/o performance SSD. The difference should be around the same. If it's not (ie. less addition when the ssd is on max performace), there's likely insufficient supply for performance SSD and WiFi.

Interferences actually were my first idea, but you said it doesn't happen on windows ...
noric
Registered Member
Posts
42
Karma
0
OS

Re: Erratic wifi scanning behaviour

Sat Nov 07, 2015 6:00 pm
I've tested with powerstat.
I experienced the same power draw increase (idle vs scanning) with both max_performance and min_power. In both cases the power draw increased by 0,60W. This should rule out power starvation.
Going from min_power to max_performance adds another 0,60W.

It doesn't happen on Windows, I can confirm that.

What I find strange is that those wireless networks stronger than about 70dBm do show up with both max_performance and min_power (I've checked with my phone's tethering and I've also seen a few other networks show up sometimes, always around 70dBm). And they show the same signal strength in both cases (max_performance and min_power). If they show the same signal strength, why are networks weaker than 70dBm out of range only with max_performance? I don't get it. If the problem were some kind of interference, shouldn't it degrade the signal strength of all the wireless networks, and not only the weakest ones?
luebking
Karma
0

Re: Erratic wifi scanning behaviour

Sat Nov 07, 2015 9:22 pm
Signal strength is one thing, does the quailty indication vary (and/or does your chip also report the noise level)?
noric
Registered Member
Posts
42
Karma
0
OS

Re: Erratic wifi scanning behaviour

Sun Nov 08, 2015 4:17 pm
Noise isn't reported. Quality is constant, around 40/70 for a network of about 70dBm of signal.

I just remembered something. Some time ago (I was still a Windows user) I swapped the stock wifi card for my current card (an Intel 6300N). The Intel 6300N needed a third antenna cable, while my notebook came with only two antennas. So I routed a third antenna through the chassis, and I remember that its cable passes quite close to my mSata ssd. Could this create any interferences? Anyway, it always worked fine (and still works fine) in Windows, so I never thought that there could be a problem with this setup. But I could try to reopen my notebook and temporarily move the third antenna away from the mSata ssd.

Anyway, thanks for your help, I would have never got so far without it.
luebking
Karma
0

Re: Erratic wifi scanning behaviour

Sun Nov 08, 2015 9:36 pm
Do you have access to a WiFi usb key? You could try whether it exposes the same behavior. (Custom wire "somewhere" inside the case sounds indeed troubleprone. The sdd is probably suffiiently shrouded, but some power connector may be not)

About windows: it might be better configured to idle the SDD, so it gets the network while the SDD is muted (and lives on the scan cache when it's briefly not) - if you still have it available, you could try a scan while performing some I/O benchmark on the SDD.
noric
Registered Member
Posts
42
Karma
0
OS

Re: Erratic wifi scanning behaviour

Tue Nov 10, 2015 3:29 pm
I don't have any wifi usb key, unfortunately.
But I could try to detach the third (optional) antenna cable, i.e. the cable I routed through the chassis. My Intel 6300N card can work with two antennas, the third one is optional.
Also, I still have the old Realtek wifi card.

About Windows, I just booted into Windows XP and I was able to reproduce the exact behaviour you were guessing. Many networks are detected in normal conditions, but as soon as I launch an I/O benchmark only my single wifi network is detected.
This means the problem isn't Linux related.
luebking
Karma
0

Re: Erratic wifi scanning behaviour

Tue Nov 10, 2015 3:49 pm
Sounds actually like a bug/missing feature in the ssd driver ;-)
Maybe you can re-route the cable. Good luck.
noric
Registered Member
Posts
42
Karma
0
OS

Re: Erratic wifi scanning behaviour

Tue Nov 10, 2015 7:11 pm
You mean the Linux driver? Yes, it should be responsible for idleing the SSD... Do you happen to know where I should report this bug?

I'll let you know how it goes with the third antenna cable.


Bookmarks



Who is online

Registered users: bartoloni, Bing [Bot], Evergrowing, Google [Bot], ourcraft