You are not logged in.

#1 2020-12-29 14:32:07

Kotrfa
Member
Registered: 2012-10-25
Posts: 213

Sudden connection issues with WiFi USB dongle

Hi,

I have bought  TP-Link AC600 wireless Realtek RTL8811AU [Archer T2U Nano] and it works fine... for most of the time. I am using `iwd` with systemd-resolve with no additional connection layer (i.e. no wpa_supplicant, no dedicated dhcp daemon, no connection manager).

I can connect just fine to any network via `iwd` and the speed and connection is OK. But after a "while" (e.g. an hour), I just cannot connect anywhere. I cannot even ping the router IP address consistently (so it's not the router issue and other ~30 devices just connect fine, so it's the dongle/station issue). I whitelisted the wifi dongle in TLP and I am not aware of anything else which could cause such problems.

This is how it looks when I have ping turned on and wait until it occurs. As you can see, it's not a "full" disconnect, because some packets do get through.

64 bytes from 192.168.0.1: icmp_seq=22045 ttl=64 time=69.2 ms
64 bytes from 192.168.0.1: icmp_seq=22046 ttl=64 time=17.4 ms
64 bytes from 192.168.0.1: icmp_seq=22054 ttl=64 time=14.2 ms
64 bytes from 192.168.0.1: icmp_seq=22071 ttl=64 time=73.7 ms
64 bytes from 192.168.0.1: icmp_seq=22085 ttl=64 time=14.8 ms
64 bytes from 192.168.0.1: icmp_seq=22089 ttl=64 time=23.8 ms
64 bytes from 192.168.0.1: icmp_seq=22114 ttl=64 time=9.62 ms
64 bytes from 192.168.0.1: icmp_seq=22117 ttl=64 time=138 ms
64 bytes from 192.168.0.1: icmp_seq=22122 ttl=64 time=14.8 ms
64 bytes from 192.168.0.1: icmp_seq=22125 ttl=64 time=91.9 ms
64 bytes from 192.168.0.1: icmp_seq=22132 ttl=64 time=7.24 ms
64 bytes from 192.168.0.1: icmp_seq=22142 ttl=64 time=20.1 ms
64 bytes from 192.168.0.1: icmp_seq=22160 ttl=64 time=39.9 ms
64 bytes from 192.168.0.1: icmp_seq=22168 ttl=64 time=102 ms
64 bytes from 192.168.0.1: icmp_seq=22173 ttl=64 time=25.7 ms
64 bytes from 192.168.0.1: icmp_seq=22175 ttl=64 time=30.4 ms
64 bytes from 192.168.0.1: icmp_seq=22184 ttl=64 time=32.9 ms

I cannot see anything weird in the logs of `iwd`, `ip` or `iw` commands, everything seems normal. It just can't ping or do anything and I don't know where to look. When I disconnect and connect again, it works just fine.

Any idea where I could look? Thanks!

Last edited by Kotrfa (2020-12-29 20:44:58)

Offline

#2 2020-12-30 06:26:40

tbg
Member
Registered: 2017-06-22
Posts: 72

Re: Sudden connection issues with WiFi USB dongle

Have you tried disabling power saving on the adapter?

Have you tried disabling power saving on the USB bus?

Is the adapter connected though a USB hub?

Have you tried masking TLP temporarily?

Offline

#3 2020-12-30 09:12:27

Kotrfa
Member
Registered: 2012-10-25
Posts: 213

Re: Sudden connection issues with WiFi USB dongle

Thanks!

1) `iw wlan0 set power_save off` says that `power safe: off`.
2) not sure how to do that  - can you help? I have now set `USB_AUTOSUSPEND=0` in /etc/tlp.conf, restarted tlp, so will see how it works.
3) The adapter is not plugged in via USB hub.
4) you mean disable it e.g. via systemctl?

Offline

#4 2020-12-30 10:05:28

tbg
Member
Registered: 2017-06-22
Posts: 72

Re: Sudden connection issues with WiFi USB dongle

1) Sometimes Realtek wifi drivers also let you specify power save options in:

/etc/modprobe.d/rtl8811au.conf

Check your driver's available options with:

modinfo <wifi_module_name>

2) You can set this as a grub kernel boot parameter (this will result in increased power usage).

Add the following kernel boot parameter to grub:

usbcore.autosuspend=-1

Update grub afterwards.

Be sure to reverse this if it doesn't help.

3) Good, and hopefully you haven't chained USB extension cables either.

4) Yes, mask it then reboot.

systemctl mask tlp && systemctl mask tlp-sleep.service

However you may simply want to uninstall tlp to be sure that no tlp setting is causing this issue. You can always reinstall it again.

(Edit:)

Sorry, I initially wrote 1 as the value for autosuspend, then I didn't think that looked right and changed it to "0". My first inclination was correct it should be "1".

From the Power Management for USB kernel documentation:

The default is 2.  0 means to autosuspend as soon as the device becomes idle, and -1 means never to
autosuspend.

Last edited by tbg (2020-12-30 11:05:00)

Offline

#5 2020-12-30 15:25:04

seth
Member
Registered: 2012-09-03
Posts: 49,977

Re: Sudden connection issues with WiFi USB dongle

If tlp is running, it'll likely override usbcore.autosuspend at runtime:

cat /sys/module/usbcore/parameters/autosuspend

to inspect the current value.

Online

#6 2020-12-31 10:05:46

tbg
Member
Registered: 2017-06-22
Posts: 72

Re: Sudden connection issues with WiFi USB dongle

One thing you've discounted that might be worth looking at is your router. Just because other devices can connect properly does not guarantee that the router is not part of the issue. If your configuration is different on this one specific machine perhaps it doesn't react the same as other devices connecting to your AP.

I have experienced this myself in the past where other machines could all connect properly except 1 Linux box. In that case resetting the router back to the factory default corrected the issue of connections being dropped (or being unable to connect at times). You may also want to look at your routers lease time and set it to 24 hours or longer (if possible).

Many people automatically discount the router as a possibility when other devices can connect properly, but this is not always the case.

Offline

#7 2021-01-04 10:31:20

Kotrfa
Member
Registered: 2012-10-25
Posts: 213

Re: Sudden connection issues with WiFi USB dongle

Hey. So I have tested 2) from my previous message and it seems it solved the problem (I haven't experienced the issue since then).

Kotrfa wrote:

Thanks!

1) `iw wlan0 set power_save off` says that `power safe: off`.
2) not sure how to do that  - can you help? I have now set `USB_AUTOSUSPEND=0` in /etc/tlp.conf, restarted tlp, so will see how it works.
3) The adapter is not plugged in via USB hub.
4) you mean disable it e.g. via systemctl?

Obviously, I would like to get back to suspending other stuff instead of turning it off entirely. I have this line in `/etc/tlp.conf`:

USB_BLACKLIST="... 2357:011e ..."

which should correspond to the dongle:

$ lsusb
...
Bus 001 Device 002: ID 2357:011e TP-Link AC600 wireless Realtek RTL8811AU [Archer T2U Nano]
...

but it clearly doesn't work. Any ideas why, or should I go to TLP tracker?

Offline

Board footer

Powered by FluxBB