Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[Solved] WIFI disconnects every 15 seconds
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
Blind_Sniper
Guru
Guru


Joined: 20 Apr 2018
Posts: 370

PostPosted: Tue Jul 19, 2022 1:39 pm    Post subject: [Solved] WIFI disconnects every 15 seconds Reply with quote

Hi, guys.

Need help with wifi TL-WN722N USB dongle.
This device works fine on old machine with (reletively) old kernel-5.15.26. As well it works fine under Windows10.
But I can't use it on new machine with kernel-5.18.2.

Under 5.18.2 device works only for 15 secs or so. It disconnects after 15 seconds and stays disconnected for about next 15 seconds. And then it rescans available networks, finds my SSID and connects to it. And works for another 15 seconds. And so on, endless loop. Ping to 8.8.8.8 is slow - from 200ms up to 600 ms, packet loss is about 50%, download speed is low 20Mbits (50 MBits on old machine)

This is the portion of wpa_supplicant output which appears on every reconnection:

Code:
RTM_NEWLINK: operstate=1 ifi_flags=0x11043 ([UP][RUNNING][LOWER_UP])
RTM_NEWLINK, IFLA_IFNAME: Interface 'wlan0' added
WEXT: if_removed already cleared - ignore event
Wireless event: cmd=0x8b19 len=16
wlan0: Event SCAN_RESULTS (3) received
Received 1451 bytes of scan results (4 BSSes)
wlan0: BSS: Start scan result update 7
wlan0: BSS: Add new id 6 BSSID dc:e3:05:46:bc:13 SSID 'RT-WiFi-BC12' freq 2412
wlan0: BSS: Add new id 7 BSSID d8:af:81:60:9b:9d SSID 'RT-WiFi-9B9D' freq 2422
BSS: last_scan_res_used=4/32
wlan0: New scan results available (own=0 ext=0)
WPS: AP dc:e3:05:46:bc:13 type 0 added
WPS: Unknown Vendor Extension (Vendor ID 9442)
WPS: Unknown Vendor Extension (Vendor ID 9442)
WPS: Unknown Vendor Extension (Vendor ID 9442)
WPS: AP[0] 7c:39:53:e8:52:81 type=0 tries=0 last_attempt=-1 sec ago bssid_ignore=0
WPS: AP[1] 7c:03:d8:a0:ac:ce type=0 tries=0 last_attempt=-1 sec ago bssid_ignore=0
WPS: AP[2] 64:70:02:9c:8b:06 type=0 tries=0 last_attempt=-1 sec ago bssid_ignore=0
WPS: AP[3] d8:af:81:60:9b:9d type=0 tries=0 last_attempt=-1 sec ago bssid_ignore=0
WPS: AP[4] e8:f1:b0:b0:68:db type=0 tries=0 last_attempt=-1 sec ago bssid_ignore=0
WPS: AP[5] dc:e3:05:46:bc:13 type=0 tries=0 last_attempt=-1 sec ago bssid_ignore=0
wlan0: Scan results matching the currently selected network
wlan0: 3: 64:70:02:9c:8b:06 freq=2462 level=0 snr=0 est_throughput=1000
wlan0: Selecting BSS from priority group 0
wlan0: 0: dc:e3:05:46:bc:13 ssid='RT-WiFi-BC12' wpa_ie_len=0 rsn_ie_len=20 caps=0x11 level=0 freq=2412  wps
wlan0:    skip - SSID mismatch
wlan0: 1: d8:af:81:60:9b:9d ssid='RT-WiFi-9B9D' wpa_ie_len=26 rsn_ie_len=20 caps=0x11 level=0 freq=2422  wps
wlan0:    skip - SSID mismatch
wlan0: 2: 7c:03:d8:a0:ac:ce ssid='WiFi-110' wpa_ie_len=28 rsn_ie_len=24 caps=0x11 level=0 freq=2462  wps
wlan0:    skip - SSID mismatch
wlan0: 3: 64:70:02:9c:8b:06 ssid='TP-LINK_9C8B06' wpa_ie_len=0 rsn_ie_len=0 caps=0x1 level=0 freq=2462  wps
wlan0:    allow in non-WPA/WPA2
wlan0:    selected current BSS 64:70:02:9c:8b:06 ssid='TP-LINK_9C8B06'
RTM_NEWLINK: operstate=1 ifi_flags=0x11043 ([UP][RUNNING][LOWER_UP])
RTM_NEWLINK, IFLA_IFNAME: Interface 'wlan0' added
WEXT: if_removed already cleared - ignore event
Wireless event: cmd=0x8b15 len=24
Wireless event: new AP: 64:70:02:9c:8b:06
wlan0: Event ASSOC (0) received
wlan0: State: COMPLETED -> ASSOCIATED
wpa_driver_wext_set_operstate: operstate 1->0 (DORMANT)
netlink: Operstate: ifindex=3 linkmode=-1 (no change), operstate=5 (IF_OPER_DORMANT)
wlan0: Associated with 64:70:02:9c:8b:06
wlan0: WPA: Association event - clear replay counter
wlan0: WPA: Clear old PTK
TDLS: Remove peers on association
EAPOL: External notification - portEnabled=0
EAPOL: SUPP_PAE entering state DISCONNECTED
EAPOL: Supplicant port status: Unauthorized
EAPOL: SUPP_BE entering state INITIALIZE
EAPOL: External notification - portValid=0
EAPOL: External notification - portEnabled=1
EAPOL: SUPP_PAE entering state S_FORCE_AUTH
EAPOL: Supplicant port status: Authorized
EAPOL: SUPP_BE entering state IDLE
wlan0: Cancelling authentication timeout
wlan0: State: ASSOCIATED -> COMPLETED
wlan0: CTRL-EVENT-CONNECTED - Connection to 64:70:02:9c:8b:06 completed [id=0 id_str=]
wpa_driver_wext_set_operstate: operstate 0->1 (UP)
netlink: Operstate: ifindex=3 linkmode=-1 (no change), operstate=6 (IF_OPER_UP)
wlan0: Cancelling scan request
RTM_NEWLINK: operstate=1 ifi_flags=0x11003 ([UP][LOWER_UP])
netlink: Operstate: ifindex=3 linkmode=-1 (no change), operstate=6 (IF_OPER_UP)
RTM_NEWLINK, IFLA_IFNAME: Interface 'wlan0' added
WEXT: if_removed already cleared - ignore event
RTM_NEWLINK: operstate=1 ifi_flags=0x11043 ([UP][RUNNING][LOWER_UP])
RTM_NEWLINK, IFLA_IFNAME: Interface 'wlan0' added
WEXT: if_removed already cleared - ignore event
RTM_NEWLINK: ifi_index=3 ifname=wlan0 wext ifi_family=0 ifi_flags=0x11043 ([UP][RUNNING][LOWER_UP])
RTM_NEWLINK: ifi_index=3 ifname=wlan0 wext ifi_family=0 ifi_flags=0x11043 ([UP][RUNNING][LOWER_UP])
RTM_NEWLINK: ifi_index=3 ifname=wlan0 operstate=5 linkmode=1 ifi_family=0 ifi_flags=0x11003 ([UP][LOWER_UP])
RTM_NEWLINK: ifi_index=3 ifname=wlan0 operstate=6 linkmode=1 ifi_family=0 ifi_flags=0x11043 ([UP][RUNNING][LOWER_UP])


I tried to build 5.18.2 kernel upon the old 5.15.26 .config (using make oldconfig), to make sure I didn't miss any wifi-related option when configured 5.18.2 kernel, but it doesn't help.

I cannot downgrade kernel to 5.15.26 due to my video.

Any ideas on how to fix this problem?
_________________
GNU is Not Usable


Last edited by Blind_Sniper on Sun Sep 18, 2022 10:24 am; edited 1 time in total
Back to top
View user's profile Send private message
pjp
Administrator
Administrator


Joined: 16 Apr 2002
Posts: 20584

PostPosted: Tue Jul 19, 2022 4:25 pm    Post subject: Reply with quote

I'm guessing you have conflicting network management. Network Manager and something else.

What is the output of /sbin/rc-update?
_________________
Quis separabit? Quo animo?
Back to top
View user's profile Send private message
Blind_Sniper
Guru
Guru


Joined: 20 Apr 2018
Posts: 370

PostPosted: Tue Jul 19, 2022 5:30 pm    Post subject: Reply with quote

I have no network manager installed, and never had before.

rc-update

Before starting wlan0 I stopping eth0 to prevent any collision. On exit (Ctrl+C) wlan0 going down and eth0 starts again.

Code:
#!/bin/bash
/etc/init.d/net.eth0  stop
ifconfig -v wlan0 up
ifconfig wlan0 192.168.1.77
ip route add default via 192.168.1.1 dev wlan0
wpa_supplicant -Dwext -iwlan0 -c /etc/wpa_supplicant/wpa_supplicant-109.conf -dd

ifconfig -v wlan0 down
/etc/init.d/net.eth0  start


Some additional info: I tried to install 5.18.2 kernel on old machine, which works fine with my wifi under 5.15.26 kernel and got the same behaviour - disconnection every 15 seconds.

So it's seems for me as a kernel issue.
_________________
GNU is Not Usable
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 5362
Location: Bavaria

PostPosted: Tue Jul 19, 2022 5:58 pm    Post subject: Re: WIFI disconnects every 15 seconds Reply with quote

Blind_Sniper wrote:
I tried to build 5.18.2 kernel upon the old 5.15.26 .config (using make oldconfig), [...]

I cannot downgrade kernel to 5.15.26 due to my video.

5.18.2 is quite old also (we are at 5.18.12 at the moment) ... If you need a recent kernel because of your video, I would like to know if the problem is existent under 5.15.52 (gentoo stable), or 5.15.55 (newest version of 5.15-series at the moment) also ? If you have the same problem with a newer 5.15-kernel I dont think its a kernel problem. Maybe you should try 5.18.12 also ...
Back to top
View user's profile Send private message
pjp
Administrator
Administrator


Joined: 16 Apr 2002
Posts: 20584

PostPosted: Tue Jul 19, 2022 7:17 pm    Post subject: Reply with quote

Blind_Sniper wrote:
So it's seems for me as a kernel issue.
Have you compared what is different between the two kernel configurations?
_________________
Quis separabit? Quo animo?
Back to top
View user's profile Send private message
Blind_Sniper
Guru
Guru


Joined: 20 Apr 2018
Posts: 370

PostPosted: Tue Jul 19, 2022 7:39 pm    Post subject: Reply with quote

pjp wrote:
Blind_Sniper wrote:
So it's seems for me as a kernel issue.
Have you compared what is different between the two kernel configurations?


Yes, I did, they are identical.

@pietinger
I just installed the last available 5.15 branch sources - 5.15.52 kernel, and built it upon 5.18.2 config. Just copied .config from 5.18.2 and put it into 5.15.52 directory and ran make oldconfig. Rebooted and wifi works, no interrupts. OK, average ping is 120 ms, not a 50 ms, but it works and doesn't disconnect every 15 seconds.

Software is the same, hardware is the same, the only difference is kernel. Even kernel config is the same.
As for me it seems like a kernel issue.
_________________
GNU is Not Usable
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 5362
Location: Bavaria

PostPosted: Tue Jul 19, 2022 7:49 pm    Post subject: Reply with quote

Blind_Sniper wrote:
I just installed the last available 5.15 branch sources - 5.15.52 kernel, and built it upon 5.18.2 config. Just copied .config from 5.18.2 and put it into 5.15.52 directory and ran make oldconfig. Rebooted and wifi works, no interrupts. OK, average ping is 120 ms, not a 50 ms, but it works and doesn't disconnect every 15 seconds.

Software is the same, hardware is the same, the only difference is kernel. Even kernel config is the same.
As for me it seems like a kernel issue.

Good information. So, 5.15 looks like clean. Now I would like to ask what is with 5.18.12 ? Maybe there have been some patches between 5.18.2 and 5.18.12 which solve the problem ...
(pls do the same update as you did: copying .config and starting "make oldconfig" (NOT "make olddefconfig"))
If 5.18.12 have the same problem I would say it is a kernel problem; if not I would say it was a problem with version .2
Back to top
View user's profile Send private message
Blind_Sniper
Guru
Guru


Joined: 20 Apr 2018
Posts: 370

PostPosted: Tue Jul 19, 2022 7:56 pm    Post subject: Reply with quote

pietinger wrote:

If 5.18.12 have the same problem I would say it is a kernel problem; if not I would say it was a problem with version .2

I have no 5.18.12 sources. Only 5.18.8 and 5.18.10.
5.18.8 I already tried - doesn't work.

Will try 5.18.10.
_________________
GNU is Not Usable
Back to top
View user's profile Send private message
Blind_Sniper
Guru
Guru


Joined: 20 Apr 2018
Posts: 370

PostPosted: Tue Jul 19, 2022 8:22 pm    Post subject: Reply with quote

OK, tried 5.18.10 - doesn't work.


What I found: old branch 5.15.* has an option 88EU_AP_MODE, tho it isn't set:
Code:
# cat .config |grep 88EU_AP_MODE
# CONFIG_88EU_AP_MODE is not set


this option related to my wifi module - r8188eu

new branche kernels 5.18.* lacks of 88EU_AP_MODE symbol at all. And since it disabled at 5.15.* I think it doesn't a problem
_________________
GNU is Not Usable
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54805
Location: 56N 3W

PostPosted: Tue Jul 19, 2022 8:27 pm    Post subject: Reply with quote

Blind_Sniper,

Look in you dmesg for the disconnects.
What is the reason code?
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Blind_Sniper
Guru
Guru


Joined: 20 Apr 2018
Posts: 370

PostPosted: Tue Jul 19, 2022 8:35 pm    Post subject: Reply with quote

@NeddySeagoon,
no any changes in dmesg. Neither on disconnection, nor on reconnection. Nothing.
_________________
GNU is Not Usable
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 5362
Location: Bavaria

PostPosted: Tue Jul 19, 2022 10:15 pm    Post subject: Reply with quote

Blind_Sniper,

my guess is: They play a lot with this module ... :-( Maybe you should wait a little bit with 5.18 and 5.19-rc

-> https://github.com/torvalds/linux/commit/5b7419ae1d208cab1e2826d473d8dab045aa75c7
-> https://sbexr.rabexc.org/latest/sources/5e/ef819eba152f0f.html
Back to top
View user's profile Send private message
Blind_Sniper
Guru
Guru


Joined: 20 Apr 2018
Posts: 370

PostPosted: Tue Jul 19, 2022 10:51 pm    Post subject: Reply with quote

OK, will wait for fix.

Thanks guys.
_________________
GNU is Not Usable
Back to top
View user's profile Send private message
Blind_Sniper
Guru
Guru


Joined: 20 Apr 2018
Posts: 370

PostPosted: Fri Sep 16, 2022 7:06 pm    Post subject: Reply with quote

Two months later...
Tried latest available 5.19.9 kernel. Still wifi doesn't work.
Should I file a bug?
_________________
GNU is Not Usable
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54805
Location: 56N 3W

PostPosted: Fri Sep 16, 2022 8:04 pm    Post subject: Reply with quote

Blind_Sniper,

Its probably not a bug. If it were, it would already be filed and maybe fixed.
You would be unlikely to be first. A little like the Fermi paradox.

Pastebin the output of
Code:
lsusb -vvv
with your normal collection of USB devices connected.
That will allow us to check for USB root hub over current conditions. It will provide the Vendor and Device IDs so we can check your kernel too.
Pastebin youer kernel .config file.

Pastebin dmesg, after the interface has cycled a few times.

Read the comments in /etc/rc.conf above
Code:
#rc_depend_strict="YES"

Then uncomment it and set it to "NO"

Configure the /etc/conf.d/net file to be able to start wifi and add the symlink to /etc/init.d/. There is no need to add it to any runlevel.

Now OpenRC knows about wifi and will be happy to keep network dependent services up if either interface is up.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Blind_Sniper
Guru
Guru


Joined: 20 Apr 2018
Posts: 370

PostPosted: Sat Sep 17, 2022 8:58 am    Post subject: Reply with quote

NeddySeagoon

It's a lsusb -vvv output: https://pastebin.com/8r03FzdY
And kernel config: https://pastebin.com/2MpFmDtL

As you suggested, I uncommented
Code:
rc_depend_strict="NO"


Added wlan configuration to /etc/conf.d/net:

Code:
config_eth0="192.168.1.5 netmask 255.255.255.0 brd 192.168.1.255"
routes_eth0="default via 192.168.1.1"

config_wlan0="192.168.1.77 netmask 255.255.255.0 brd 192.168.1.255"
routes_wlan0="default via 192.168.1.1"

modules="wpa_supplicant"
wpa_supplicant_wlan0="-Dwext"


Created /etc/init.d/net.wlan0 link to net.lo and rebooted. After reboot I stopped eth0 to prevent any possible interferes from eth0 and started /etc/init.d/net.wlan0

Code:
# /etc/init.d/net.wlan0 start
 * Bringing up interface wlan0
 *   Caching network module dependencies
 *   Starting wpa_supplicant on wlan0 ...
Successfully initialized wpa_supplicant
rfkill: Cannot get wiphy information
ioctl[SIOCSIWAP]: Operation not permitted
ioctl[SIOCSIWENCODEEXT]: Invalid argument
ioctl[SIOCSIWENCODEEXT]: Invalid argument                                                                                            [ ok ]
 *   Starting wpa_cli on wlan0 ...                                                                                                   [ ok ]
 *   Backgrounding ... ...
 * WARNING: net.wlan0 has started, but is inactive


Still the same behavior: Internet works 15 seconds, then stops working for next 15 seconds and appears for next 15 seconds again. And so on.
When internet disappears wlan0 doesn't stop, it still up, just no internet. And no any changes in dmesg.

It's the few last lines of dmesg:

Code:
[    3.486807] usbcore: registered new interface driver r8188eu
[    3.487811] i915 0000:00:02.0: [drm] GuC firmware i915/tgl_guc_69.0.3.bin version 69.0
[    3.487813] i915 0000:00:02.0: [drm] HuC firmware i915/tgl_huc_7.9.3.bin version 7.9
[    3.500848] i915 0000:00:02.0: [drm] HuC authenticated
[    3.500854] i915 0000:00:02.0: [drm] GuC submission disabled
[    3.500856] i915 0000:00:02.0: [drm] GuC SLPC disabled
[    3.503935] [drm] Initialized i915 1.6.0 20201103 for 0000:00:02.0 on minor 0
[    3.505075] ACPI: video: Video Device [GFX0] (multi-head: yes  rom: no  post: no)
[    3.505505] input: Video Bus as /devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/LNXVIDEO:00/input/input11
[    4.855732] fbcon: i915drmfb (fb0) is primary device
[    4.902924] Console: switching to colour frame buffer device 240x67
[    4.923673] i915 0000:00:02.0: [drm] fb0: i915drmfb frame buffer device
[    5.561729] EXT4-fs (nvme0n1p4): re-mounted. Quota mode: none.
[    5.613925] FAT-fs (nvme0n1p2): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
[    5.915567] elogind-daemon[1266]: New seat seat0.
[    5.915924] elogind-daemon[1266]: Watching system buttons on /dev/input/event2 (Power Button)
[    5.915984] elogind-daemon[1266]: Watching system buttons on /dev/input/event1 (Power Button)
[    5.916006] elogind-daemon[1266]: Watching system buttons on /dev/input/event0 (Sleep Button)
[    5.916186] elogind-daemon[1266]: Watching system buttons on /dev/input/event3 (AT Translated Set 2 keyboard)
[    6.190837] Generic FE-GE Realtek PHY r8169-0-300:00: attached PHY driver (mii_bus:phy_addr=r8169-0-300:00, irq=MAC)
[    6.366941] r8169 0000:03:00.0 eth0: Link is Down
[    7.946803] r8169 0000:03:00.0 eth0: Link is Up - 100Mbps/Full - flow control rx/tx
[   32.787280] r8169 0000:03:00.0 eth0: Link is Down
[   41.727828] R8188EU: Firmware Version 11, SubVersion 1, Signature 0x88e1
[   42.053526] MAC Address = b0:a7:b9:4b:7c:62
[   42.206632] cfg80211: Loading compiled-in X.509 certificates for regulatory database
[   42.208409] cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'


I still think it's a kernel issue. When booted into the same system with old kernel, wifi works fine.
_________________
GNU is Not Usable
Back to top
View user's profile Send private message
Blind_Sniper
Guru
Guru


Joined: 20 Apr 2018
Posts: 370

PostPosted: Sun Sep 18, 2022 10:23 am    Post subject: Reply with quote

Found alternative driver (8188eu.ko) here: https://github.com/lwfinger/rtl8188eu
Works good, no any interrupts for a last 30 minutes.
Will see how long it will work
_________________
GNU is Not Usable
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum