Wifi only works if i replug the adapter

Asked by Marlon Emmerich

Hello! I have here a wifi adapter (TL-WN823NEU) and, to connect in any wifi, i need to resmove and replug the adapter. SOmeone can help me? Thanks!

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
actionparsnip
Solved:
Last query:
Last reply:
Revision history for this message
actionparsnip (andrew-woodhead666) said :
#1

What is the output of:

sudo lshw -C network; lsb_release -a; uname -a

Thanks

Revision history for this message
Marlon Emmerich (memmerich) said :
#2

Hello! Thanks for your answer!

Before replug the adapter:

  *-network
       description: Ethernet interface
       product: RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller
       vendor: Realtek Semiconductor Co., Ltd.
       physical id: 0
       bus info: pci@0000:01:00.0
       logical name: enp1s0
       version: 15
       serial: 70:85:c2:8e:71:b8
       size: 10Mbit/s
       capacity: 1Gbit/s
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress msix bus_master cap_list ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd 1000bt-fd autonegotiation
       configuration: autonegotiation=on broadcast=yes driver=r8169 duplex=half firmware=rtl8168h-2_0.0.2 02/26/15 latency=0 link=no multicast=yes port=MII speed=10Mbit/s
       resources: irq:19 ioport:e000(size=256) memory:df004000-df004fff memory:df000000-df003fff
  *-network
       description: Wireless interface
       physical id: 1
       bus info: usb@1:1
       logical name: wlx503eaabcb76c
       serial: 50:3e:aa:bc:b7:6c
       capabilities: ethernet physical wireless
       configuration: broadcast=yes driver=rtl8xxxu driverversion=5.0.0-15-generic firmware=N/A link=no multicast=yes wireless=IEEE 802.11
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 19.04
Release: 19.04
Codename: disco
Linux marlon-desktop 5.0.0-15-generic #16-Ubuntu SMP Mon May 6 17:41:33 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

After replug the adapter:

  *-network
       description: Ethernet interface
       product: RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller
       vendor: Realtek Semiconductor Co., Ltd.
       physical id: 0
       bus info: pci@0000:01:00.0
       logical name: enp1s0
       version: 15
       serial: 70:85:c2:8e:71:b8
       size: 10Mbit/s
       capacity: 1Gbit/s
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress msix bus_master cap_list ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd 1000bt-fd autonegotiation
       configuration: autonegotiation=on broadcast=yes driver=r8169 duplex=half firmware=rtl8168h-2_0.0.2 02/26/15 latency=0 link=no multicast=yes port=MII speed=10Mbit/s
       resources: irq:19 ioport:e000(size=256) memory:df004000-df004fff memory:df000000-df003fff
  *-network
       description: Wireless interface
       physical id: 1
       bus info: usb@1:1
       logical name: wlx503eaabcb76c
       serial: 50:3e:aa:bc:b7:6c
       capabilities: ethernet physical wireless
       configuration: broadcast=yes driver=rtl8xxxu driverversion=5.0.0-15-generic firmware=N/A ip=10.0.10.130 link=yes multicast=yes wireless=IEEE 802.11
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 19.04
Release: 19.04
Codename: disco
Linux marlon-desktop 5.0.0-15-generic #16-Ubuntu SMP Mon May 6 17:41:33 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#3

If you reboot and run:

sudo modprobe -r rtl8xxxu; sleep 3; sudo modprobe rtl8xxxu

Does the device work without unplugging it?

Revision history for this message
Marlon Emmerich (memmerich) said :
#4

Yes, i runned this command and the devide is working without replugg

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#5

OK we can work

Run:

sudo gedit /usr/bin/wififix; sudo chmod +x /usr/bin/wififix

Add the below 2 lines, save the new file, close gedit:

#!/bin/bash
sudo modprobe -r rtl8xxxu; sleep 3; sudo modprobe rtl8xxxu

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#6

Then run:

sudo gedit /etc/rc.local

If the file is blank add the below line:

exit 0

Either way, add the below line above the 'exit 0' line:

sudo /usr/bin/wififix

Save the new file and close gedit. If the file was blank, run:

sudo chmod +x /etc/rc.local

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#7

Reboot to test.

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#8

Does this help?

Revision history for this message
Marlon Emmerich (memmerich) said :
#9

Dont worked =\

I repeated these steps 3 times but only works if i execute "sudo modprobe -r rtl8xxxu; sleep 3; sudo modprobe rtl8xxxu"

Thanks

Revision history for this message
Marlon Emmerich (memmerich) said :
#10

I tri one more time but dont worked =\

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#11

If you run:

sudo /usr/bin/wififix

After a reboot does it work OK?

Revision history for this message
Manfred Hampl (m-hampl) said :
#12

What is the output of

cat -n /etc/rc.local

Revision history for this message
Marlon Emmerich (memmerich) said :
#13

@actionparsnip
I runned but this dont connected automatically to my network, just rebooted the adapter

@Manfred Hampl
1 sudo /usr/bin/wififix
2 exit 0

Thanks!

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#14

Sorry, run:

sudo gedit /etc/rc.local

Add new empty line at the top of the file and add:

#!/bin/bash

Save the new file, close gedit and reboot

Revision history for this message
Best actionparsnip (andrew-woodhead666) said :
#15

The file should now read:

#!/bin/bash
sudo /usr/bin/wififix
exit 0

Revision history for this message
Marlon Emmerich (memmerich) said :
#16

Hello!

Done. I restated 4 times and in all the times the wifi works fine!

Thanks a lot!

Revision history for this message
Marlon Emmerich (memmerich) said :
#17

Thanks actionparsnip, that solved my question.

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#18

If you backup the file, you can reinstate it if you reinstall. Seems the driver is loaded before the hardware comes up (or something).

Revision history for this message
Marlon Emmerich (memmerich) said :
#19

Sure, i will!

If you come to Brazil will be a pleasure pay a beer/coffee/tea for you! hahah
Thanks again! Have a nice day!