Wifi stops working after few seconds

I bought the card: TP LINK TL-WN781ND Ver:3.20 Wifi card to give an upgrade to my old desktop computer.
But the problem I am facing is that the WiFi stops working after few seconds after booting. I had the same problem in ubuntu. But the card works fine in Windows 10.

The card uses RTL8188ee driver.

my kernel version is 5.6.19 and I am running Manjaro-20

Sometimes (rarely) for some reasons the WiFi card starts to work without any problem. I was able to recreate this situation by restarting my computer LOT of times (when I was still using ubuntu). Haven't tried it on Manjaro yet.

Output of nmcli c up PopsHops --ask

Error: Connection activation failed: The Wi-Fi network could not be found
Hint: use 'journalctl -xe NM_CONNECTION=dc06dad8-9759-4cd9-8afe-130918649e0d + NM_DEVICE=wlp1s0' to get more details.

Output of journalctl -xe NM_CONNECTION=dc06dad8-9759-4cd9-8afe-130918649e0d + NM_DEVICE=wlp1s0

Jul 30 21:25:43 infimoto NetworkManager[500]: <info>  [1596124543.2650] dhcp4 (wlp1s0): canceled DHCP transaction
Jul 30 21:25:43 infimoto NetworkManager[500]: <info>  [1596124543.2651] dhcp4 (wlp1s0): state changed bound -> done
Jul 30 21:25:51 infimoto NetworkManager[500]: <info>  [1596124551.9840] device (wlp1s0): state change: disconnected -> unavailable (reason 'none', sys-iface-state: 'managed')
Jul 30 21:25:54 infimoto NetworkManager[500]: <info>  [1596124554.0462] device (wlp1s0): supplicant interface state: internal-starting -> disconnected
Jul 30 21:25:54 infimoto NetworkManager[500]: <info>  [1596124554.0501] device (wlp1s0): state change: unavailable -> disconnected (reason 'supplicant-available', sys-iface-state: 'managed')
Jul 30 21:25:54 infimoto NetworkManager[500]: <warn>  [1596124554.0579] sup-iface[a9e32d79d0469d71,1,wlp1s0]: call-p2p-cancel: failed with P2P cancel failed
Jul 30 21:40:43 infimoto NetworkManager[500]: <info>  [1596125443.1219] device (wlp1s0): Activation: starting connection 'PopsHops' (dc06dad8-9759-4cd9-8afe-130918649e0d)
Jul 30 21:40:43 infimoto NetworkManager[500]: <info>  [1596125443.1241] device (wlp1s0): state change: disconnected -> prepare (reason 'none', sys-iface-state: 'managed')
Jul 30 21:40:43 infimoto NetworkManager[500]: <info>  [1596125443.1445] device (wlp1s0): state change: prepare -> config (reason 'none', sys-iface-state: 'managed')
Jul 30 21:40:43 infimoto NetworkManager[500]: <info>  [1596125443.1501] device (wlp1s0): Activation: (wifi) access point 'PopsHops' has security, but secrets are required.
Jul 30 21:40:43 infimoto NetworkManager[500]: <info>  [1596125443.1501] device (wlp1s0): state change: config -> need-auth (reason 'none', sys-iface-state: 'managed')
Jul 30 21:40:43 infimoto NetworkManager[500]: <info>  [1596125443.1760] device (wlp1s0): state change: need-auth -> prepare (reason 'none', sys-iface-state: 'managed')
Jul 30 21:40:43 infimoto NetworkManager[500]: <info>  [1596125443.1857] device (wlp1s0): state change: prepare -> config (reason 'none', sys-iface-state: 'managed')
Jul 30 21:40:43 infimoto NetworkManager[500]: <info>  [1596125443.1935] device (wlp1s0): Activation: (wifi) connection 'PopsHops' has security, and secrets exist.  No new secrets needed.
Jul 30 21:40:43 infimoto NetworkManager[500]: <info>  [1596125443.6593] device (wlp1s0): supplicant interface state: disconnected -> scanning
Jul 30 21:41:08 infimoto NetworkManager[500]: <warn>  [1596125468.8094] device (wlp1s0): Activation: (wifi) association took too long, failing activation
Jul 30 21:41:08 infimoto NetworkManager[500]: <info>  [1596125468.8094] device (wlp1s0): state change: config -> failed (reason 'ssid-not-found', sys-iface-state: 'managed')
Jul 30 21:41:08 infimoto NetworkManager[500]: <warn>  [1596125468.8134] device (wlp1s0): Activation: failed for connection 'PopsHops'
Jul 30 21:41:08 infimoto NetworkManager[500]: <info>  [1596125468.8139] device (wlp1s0): state change: failed -> disconnected (reason 'none', sys-iface-state: 'managed')
Jul 30 21:41:08 infimoto NetworkManager[500]: <info>  [1596125468.8184] device (wlp1s0): supplicant interface state: scanning -> disconnected

output of lspci | grep Network

01:00.0 Network controller: Realtek Semiconductor Co., Ltd. RTL8188EE Wireless Network Adapter (rev 01)

output for ip addr

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: ens32: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc fq_codel state DOWN group default qlen 1000
    link/ether 00:e0:4c:be:20:05 brd ff:ff:ff:ff:ff:ff
    altname enp2s0
3: wlp1s0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN group default qlen 1000
    link/ether d0:37:45:15:e0:df brd ff:ff:ff:ff:ff:ff
4: enp0s29f7u3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UNKNOWN group default qlen 1000
    link/ether 5e:92:a1:fc:e8:de brd ff:ff:ff:ff:ff:ff
    inet 192.168.42.9/24 brd 192.168.42.255 scope global dynamic noprefixroute enp0s29f7u3
       valid_lft 2112sec preferred_lft 2112sec
    inet6 fe80::7c1a:5318:df38:1a22/64 scope link noprefixroute 
       valid_lft forever preferred_lft forever

Output for hwinfo --wlan

08: PCI 100.0: 0282 WLAN controller                             
  [Created at pci.386]
  Unique ID: yWPJ.37KpXZS+T6B
  Parent ID: vSkL.iscUv9+lfHB
  SysFS ID: /devices/pci0000:00/0000:00:01.0/0000:01:00.0
  SysFS BusID: 0000:01:00.0
  Hardware Class: network
  Model: "Realtek RTL8188EE Wireless Network Adapter"
  Vendor: pci 0x10ec "Realtek Semiconductor Co., Ltd."
  Device: pci 0x8179 "RTL8188EE Wireless Network Adapter"
  SubVendor: pci 0x10ec "Realtek Semiconductor Co., Ltd."
  SubDevice: pci 0x8197 
  Revision: 0x01
  Driver: "rtl8188ee"
  Driver Modules: "rtl8188ee"
  Device File: wlp1s0
  Features: WLAN
  I/O Ports: 0xd800-0xd8ff (rw)
  Memory Range: 0xfebfc000-0xfebfffff (rw,non-prefetchable)
  IRQ: 28 (no events)
  HW Address: d0:37:45:15:e0:df
  Permanent HW Address: d0:37:45:15:e0:df
  Link detected: no
  WLAN channels: 1 2 3 4 5 6 7 8 9 10 11 12 13
  WLAN frequencies: 2.412 2.417 2.422 2.427 2.432 2.437 2.442 2.447 2.452 2.457 2.462 2.467 2.472
  WLAN encryption modes: WEP40 WEP104 TKIP CCMP
  WLAN authentication modes: open sharedkey wpa-psk wpa-eap
  Module Alias: "pci:v000010ECd00008179sv000010ECsd00008197bc02sc80i00"
  Driver Info #0:
    Driver Status: rtl8188ee is active
    Driver Activation Cmd: "modprobe rtl8188ee"
  Config Status: cfg=new, avail=yes, need=no, active=unknown
  Attached to: #6 (PCI bridge)

Output for inxi -Fxz

System:    Host: infimoto Kernel: 5.6.19-2-MANJARO x86_64 bits: 64 compiler: gcc v: 10.1.0 Desktop: Xfce 4.14.2 
           Distro: Manjaro Linux 
Machine:   Type: Desktop Mobo: N/A model: N/A serial: <filter> BIOS: American Megatrends v: 080015 date: 11/07/2013 
CPU:       Topology: Dual Core model: Intel Pentium Dual E2180 bits: 64 type: MCP arch: Core Merom rev: D L2 cache: 1024 KiB 
           flags: lm nx pae sse sse2 sse3 ssse3 bogomips: 7980 
           Speed: 1805 MHz min/max: N/A Core speeds (MHz): 1: 1805 2: 1695 
Graphics:  Device-1: Intel 82945G/GZ Integrated Graphics driver: i915 v: kernel bus ID: 00:02.0 
           Display: x11 server: X.Org 1.20.8 driver: intel unloaded: modesetting resolution: 1440x900~60Hz 
           OpenGL: renderer: Mesa DRI Intel 945G v: 1.4 Mesa 20.1.3 direct render: Yes 
Audio:     Device-1: Intel NM10/ICH7 Family High Definition Audio driver: snd_hda_intel v: kernel bus ID: 00:1b.0 
           Sound Server: ALSA v: k5.6.19-2-MANJARO 
Network:   Device-1: Realtek RTL8188EE Wireless Network Adapter driver: rtl8188ee v: kernel port: d800 bus ID: 01:00.0 
           IF: wlp1s0 state: down mac: <filter> 
           Device-2: Realtek RTL810xE PCI Express Fast Ethernet driver: r8169 v: kernel port: e800 bus ID: 02:00.0 
           IF: ens32 state: down mac: <filter> 
           Device-3: Samsung GT-I9070 (network tethering USB debugging enabled) type: USB driver: rndis_host bus ID: 1-3:5 
           IF: enp0s29f7u3 state: unknown speed: N/A duplex: N/A mac: <filter> 
Drives:    Local Storage: total: 260.84 GiB used: 31.85 GiB (12.2%) 
           ID-1: /dev/sda vendor: Seagate model: ST3160215AS size: 149.05 GiB 
           ID-2: /dev/sdb vendor: Gigabyte model: GP-GSTFS31120GNTD size: 111.79 GiB 
Partition: ID-1: / size: 29.21 GiB used: 8.37 GiB (28.7%) fs: ext4 dev: /dev/sdb1 
           ID-2: /home size: 72.83 GiB used: 23.48 GiB (32.2%) fs: ext4 dev: /dev/sdb5 
Sensors:   System Temperatures: cpu: 58.0 C mobo: N/A 
           Fan Speeds (RPM): N/A 
Info:      Processes: 155 Uptime: 44m Memory: 3.41 GiB used: 1.90 GiB (55.8%) Init: systemd Compilers: gcc: 10.1.0 Shell: bash 
           v: 5.0.18 inxi: 3.0.37

I also tried resetting the BIOS and reinserting the CMOS battery after reading about it in a post in this forum, it didn't work.

How can I fix it?

Disabling random mac address for your WLAN doesn't seem to solve the problem, I will try installing different kernel and check.

Few things happened.
I installed kernel 4.14 the WiFi was working. I switched backed to kernel 5.6 THE WIFI is WORKING.
But as I mentioned in my question, after restarting a lot of times, the WiFi starts to work. So I can't tell for sure what made the WiFi to work since at this point I have restarted the computer lot of times today. I will check it again tomorrow and see if the problem reappears.

If you find it working with one of the kernels - simply stay with that kernel. 4.14 is LTS, it will be updated and supported still for a long time. There is absolutely no reason to believe you have to use a newer kernel.

So I won't face any issues using older LTS kernels?

Not at all. :+1:

If you are interested in the kernel history, here is a nice reference:

Kernel 4.14 is supposed to be supprted until Jan. 2024.

Still, I am not sure what made the WiFi to work because right now I am using kernel 5.6 and the WiFi is working but it was not working until now. So I don't know whether it was due to restarting the computer lots of time(as I have experienced before) or maybe installing kernel 4.14 made the difference.

Wonderful, then you have two kernels you can use, this is more than some others have. I would recommend to keep both kernels installed, then you can easily switch between them using Advanced options from grub menu when you face issues.

No buddy, it was just a fluke (as I expected).
The WiFi is not working, now that I have RESTARTED THE COMPUTER AGAIN.
I am in kernel 4.14

The good thing is that the older kernel boot a bit faster as well as they carry less drivers for newer hardware.

The problem has reappeared.
It doesnot work in kernel 5.6 either.
As I mentioned in the question, after restarting a Lot of time the WiFi starts to work again but in next few boots the problem reappears.

What should I do?

Have you tried to switch off autosuspend for usb devices?

If you want to try then change the file /etc/default/grub.

Add

usbcore.autosuspend=-1

into the line starting with

GRUB_CMDLINE_LINUX_DEFAULT=ā€œ

somewhere between " and " and separate it with a space from other kernel attributes.

This will completely disable autosuspend for USB devices.

Afterwards enter

sudo update-grub

and reboot.

Doesn't help. :frowning_face:

By the way the card uses PCI express port.

I have just seen in Ubuntu forum that this device has been reported to be unstable. Maybe not a question of kernel support or driver at the moment. :neutral_face:

Why does it work in windows 10 then?
it was not working at first, but after installing rtl8188ee drivers it worked perfectly (in windows 10).
Aren't they the same drivers?

How long would it take for it to be stable, and how would I know it has been updated?
Is there any other way to make the card work, maybe another driver or something like that?

No, Windoze drivers and Linux drivers are totally different.

Who knows?

At least I don't know.

for linux?

Forum kindly sponsored by