Win 10 desktop loses wifi network connection frequently, especially when waking from sleep

My Windows 10 desktop computer loses its wifi connection during sleep, which is acceptable to me, but then upon waking, it takes too long to reconnect. Sometimes it doesn't even connect automatically, and I need to manually choose (in the wifi settings) to connect to my home network again. See ¹.

Also odd: sometimes upon waking, the wifi icon indicates that there is a network connection temporarily, but then it loses network connection temporarily a couple of seconds after waking.

I've had this computer for many years, and I think this problem has only happened within the past ~6 months.

I've even upgraded my USB wifi dongle to a new one, and the problem still happens. And yes, the drivers are up-to-date.

These old questions seemed relevant, but I haven't found the answer yet:

  • Windows 10 no network connection after boot or sleep
  • Windows 7 Network dies after sleep mode
  • Windows 10 WiFi connection after sleep
  • After putting Windows 10 laptop to sleep, wifi disconnects and cannot reconnect to any networks
  • Windows 10 networking on one adapter lost after sleep

P.S. winver shows I have Windows 10 Version 2004 (OS Build 19041.1083). My new wifi USB dongle is EDUP AC1300M wifi driver EP-AC1686 Driver (8812BU Chipset).


UPDATE:

Even https://superuser.com/a/982020/74576 (un-ticked "Allow the computer to turn off this device to save power", in the "Power Management" tab of the wireless network adapter properties) did not fix the problem.

¹ Also, here is a screenshot of how upon waking I'm forced to click "Connect" even though "Connect automatically" had already been checked (but obviously isn't working).

wifi status screenshot


Update 2:

See Windows 10 WiFi connection after sleep I wonder if my Brave browser is somehow the problem. I nearly always have Brave windows open, so if Brave is somehow able to disconnect my wifi temporarily upon Windows waking up (which doesn't make sense to me), then it would be Brave's fault.


Update 3:

It's not Brave's fault. "Connect automatically" still doesn't work (upon waking from sleep) even when I'd fully exited Brave prior to sleep.


Solution 1:

Method 1 : Power Options - Network connectivity in Standby

  • Run regedit
  • Navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Power\PowerSettings\F15576E8-98B7-4186-B944-EAFA664402D9
  • Set the value of Attributes to 2
  • Close regedit
  • Open Start > Power Options, where you should now have the option for "Network connectivity in Standby"
  • Enable both "On battery" and "Plugged in"
  • Reboot might be required.

enter image description here

Method 2 : Group Policy Editor

  • Run gpedit.msc
  • Navigate to Computer Configuration > Administrative Templates > System > Power Management > Sleep Settings
  • Enable "Allow network connectivity during connected-standby (on battery)" and "Allow network connectivity during connected-standby (plugged in)"
  • Reboot might be required.

Method 3 : Using powercfg

This is essentially the same as the previous method.

  • Run Command Prompt (CMD) as Administrator

  • For Battery On Option enter:

    powercfg /setdcvalueindex scheme_current sub_none F15576E8-98B7-4186-B944-EAFA664402D9 1
    
  • For Plugged In enter:

    powercfg /setacvalueindex scheme_current sub_none F15576E8-98B7-4186-B944-EAFA664402D9 1
    
  • Reboot might be required.

Method 4 : Reconnect on wake

This method is to be used when no other solution is found. On wake it runs a command for restarting the Windows service that is supposed to redo the connection (but doesn't).

  • Create a .bat file containing:

    net stop WlanSvc && net start WlanSvc
    
  • Run Start > Task Scheduler

  • Click on "Create a Task"

  • Enter suitable values in the "General"

  • In the "Triggers" tab, choose "New"

  • In the new panel choose "On an event" from the top drop-down menu

  • Choose "Custom" under Settings

  • Click "New Event Filter" and use the following:

    Event Level: Information
    Log Name: System
    Source: Power-Troubleshooter
    Event ID: 1

  • Click OK

  • In the Actions tab, choose the above .bat file

  • In the Conditions tab, uncheck "Start the task only if the computer is on AC power"

  • Click OK.