Intermittent wifi connection using Realtek RTL8192CU

Quick to answer questions about finding your way around Linux Mint as a new user.
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions use the other forums in the support section.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
xf2

Intermittent wifi connection using Realtek RTL8192CU

Post by xf2 »

I just installed linux for the first time and have been having trouble getting my wireless adapter to work. Its a netis wf2123 wireless dongle using the Realtek RTL8192CU chip. Wifi works for about 20 minutes or so, after that I can't send or recieve any packets anymore. It will still show that the wifi is connected. If I unplug the adapter and plug it back in it starts working again. (the wireless card from the laptop has been removed, if that matters at all)

If i run this "inxi -Nn" (don't know what it means but just found it somewhere)

Code: Select all

Network:   Card-1: Intel 82567LM Gigabit Network Connection driver: e1000e
           IF: enp0s25 state: down mac: 00:26:6d:15:29:12
           Card-2: Realtek RTL8192CU 802.11n WLAN Adapter driver: rtl8192cu
           IF: wlx048d39333166 state: N/A mac: N/A
Any ideas on how to fix this?


*****************************************EDIT: The problem that I was still running the 4.1 kernal (newb, didn't know). Updating to the 4.4 kernal had the updated wireless driver called rtl8192c. After updating to the new kernal the wireless adapter was still using the old driver so I ran

Code: Select all

echo "blacklist rtl8192cu" | sudo tee /etc/modprobe.d/rtl8192cu.conf
which blacklists the old driver. Everything is working now.*****************************************
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
Flemur
Level 20
Level 20
Posts: 10096
Joined: Mon Aug 20, 2012 9:41 pm
Location: Potemkin Village

Re: Intermittent wifi connection using Realtek RTL8192CU

Post by Flemur »

xf2 wrote:Wifi works for about 20 minutes or so, after that I can't send or recieve any packets anymore.
That sounds familiar - I've done the below on a few kernels and it has always helped a lot:

Code: Select all

sudo apt-get install linux-headers-generic build-essential dkms
git clone https://github.com/pvaret/rtl8192cu-fixes.git
sudo dkms add ./rtl8192cu-fixes
sudo dkms install 8192cu/1.10
sudo depmod -a
sudo cp ./rtl8192cu-fixes/blacklist-native-rtl8192.conf /etc/modprobe.d/
sudo modprobe 8192cu
# (or reboot?)
Please edit your original post title to include [SOLVED] if/when it is solved!
Your data and OS are backed up....right?
JeremyB
Level 21
Level 21
Posts: 13881
Joined: Fri Feb 21, 2014 8:17 am

Re: Intermittent wifi connection using Realtek RTL8192CU

Post by JeremyB »

What kernel do you have?
xf2

Re: Intermittent wifi connection using Realtek RTL8192CU

Post by xf2 »

Flemur wrote:
xf2 wrote:Wifi works for about 20 minutes or so, after that I can't send or recieve any packets anymore.
That sounds familiar - I've done the below on a few kernels and it has always helped a lot:

Code: Select all

sudo apt-get install linux-headers-generic build-essential dkms
git clone https://github.com/pvaret/rtl8192cu-fixes.git
sudo dkms add ./rtl8192cu-fixes
sudo dkms install 8192cu/1.10
sudo depmod -a
sudo cp ./rtl8192cu-fixes/blacklist-native-rtl8192.conf /etc/modprobe.d/
sudo modprobe 8192cu
# (or reboot?)
(I'm not quite sure how to reply properly on this website so hopefully i'm doing this right)
So, I went to https://github.com/pvaret/rtl8192cu-fixes and it said that installing that driver was deprecated. So instead I followed this at the bottom of that github saying
Sometimes Network Manager also sets a device in a power-saving mode where it doesn't use enough power to connect. You can fix it by editing /etc/NetworkManager/conf.d/default-wifi-powersave-on.conf and setting wifi.powersave to 2. And then reboot.

I did that and it seems to be working now, but only time will tell.
Thank you for the help.
User avatar
Flemur
Level 20
Level 20
Posts: 10096
Joined: Mon Aug 20, 2012 9:41 pm
Location: Potemkin Village

Re: Intermittent wifi connection using Realtek RTL8192CU

Post by Flemur »

xf2 wrote:So, I went to https://github.com/pvaret/rtl8192cu-fixes and it said that installing that driver was deprecated.
That's a good find. I've been running that for quite a while, (and haven't looked at the website in quite a while), including recently on 4.4 and 4.13 kernels, and it has always helped. Usually a lot. Ubuntu 17.1 install had intermittent wifi until I ran that fix.
You can fix it by editing /etc/NetworkManager/conf.d/default-wifi-powersave-on.conf and setting wifi.powersave to 2. And then reboot.

I did that and it seems to be working now, but only time will tell.
Thank you for the help.
That's probably safer - and easier - if it works.
Please edit your original post title to include [SOLVED] if/when it is solved!
Your data and OS are backed up....right?
JeremyB
Level 21
Level 21
Posts: 13881
Joined: Fri Feb 21, 2014 8:17 am

Re: Intermittent wifi connection using Realtek RTL8192CU

Post by JeremyB »

Flemur wrote:
xf2 wrote:So, I went to https://github.com/pvaret/rtl8192cu-fixes and it said that installing that driver was deprecated.
That's a good find. I've been running that for quite a while, (and haven't looked at the website in quite a while), including recently on 4.4 and 4.13 kernels, and it has always helped. Usually a lot. Ubuntu 17.1 install had intermittent wifi until I ran that fix.
You can fix it by editing /etc/NetworkManager/conf.d/default-wifi-powersave-on.conf and setting wifi.powersave to 2. And then reboot.

I did that and it seems to be working now, but only time will tell.
Thank you for the help.
That's probably safer - and easier - if it works.
There is a good chance it will work, I have been posting a sudo sed command that makes that change to wifi power management for 14 months or longer.

The user still might have to blacklist the rt8192cu module, a bit strange that Linus allowed 2 modules to support the same device and neither depends on the other
xf2

Re: Intermittent wifi connection using Realtek RTL8192CU

Post by xf2 »

JeremyB wrote:
Flemur wrote:
xf2 wrote:So, I went to https://github.com/pvaret/rtl8192cu-fixes and it said that installing that driver was deprecated.
That's a good find. I've been running that for quite a while, (and haven't looked at the website in quite a while), including recently on 4.4 and 4.13 kernels, and it has always helped. Usually a lot. Ubuntu 17.1 install had intermittent wifi until I ran that fix.

I did that and it seems to be working now, but only time will tell.
Thank you for the help.
That's probably safer - and easier - if it works.
There is a good chance it will work, I have been posting a sudo sed command that makes that change to wifi power management for 14 months or longer.

The user still might have to blacklist the rt8192cu module, a bit strange that Linus allowed 2 modules to support the same device and neither depends on the other
Ok, so setting the wifi power management file from a 3 to a 2 did not work. I'm going to try installing that github rtl8192cu-fixes which is deprecated and see if that helps. Unless you have any other ideas? I'm not fond on idea of using old drivers.
JeremyB
Level 21
Level 21
Posts: 13881
Joined: Fri Feb 21, 2014 8:17 am

Re: Intermittent wifi connection using Realtek RTL8192CU

Post by JeremyB »

I would try

Code: Select all

echo "blacklist rtl8192cu" | sudo tee /etc/modprobe.d/rtl8192cu.conf
Reboot
User avatar
Flemur
Level 20
Level 20
Posts: 10096
Joined: Mon Aug 20, 2012 9:41 pm
Location: Potemkin Village

Re: Intermittent wifi connection using Realtek RTL8192CU

Post by Flemur »

xf2 wrote:Unless you have any other ideas?
Nope, I run that stuff as soon as my wifi messes up. JeremyB might have a different answer.
Please edit your original post title to include [SOLVED] if/when it is solved!
Your data and OS are backed up....right?
xf2

Re: Intermittent wifi connection using Realtek RTL8192CU

Post by xf2 »

Flemur wrote:
xf2 wrote:Unless you have any other ideas?
Nope, I run that stuff as soon as my wifi messes up. JeremyB might have a different answer.
I ran what you, Flemur said to run and it seems to be working now.
JeremyB
Level 21
Level 21
Posts: 13881
Joined: Fri Feb 21, 2014 8:17 am

Re: Intermittent wifi connection using Realtek RTL8192CU

Post by JeremyB »

Post the results for

Code: Select all

lsmod
Let's see what driver(s) are loaded for the wifi
xf2

Re: Intermittent wifi connection using Realtek RTL8192CU

Post by xf2 »

JeremyB wrote:Post the results for

Code: Select all

lsmod
Let's see what driver(s) are loaded for the wifi

Code: Select all

~ $ lsmod
Module                  Size  Used by
ccm                    20480  2
rtl8xxxu              126976  0
arc4                   16384  2
rtl8192cu              65536  0
rtl_usb                20480  1 rtl8192cu
rtl8192c_common        53248  1 rtl8192cu
rtlwifi                73728  3 rtl_usb,rtl8192c_common,rtl8192cu
mac80211              782336  4 rtl_usb,rtlwifi,rtl8192cu,rtl8xxxu
cfg80211              602112  2 mac80211,rtlwifi
coretemp               16384  0
kvm                   593920  0
irqbypass              16384  1 kvm
input_leds             16384  0
joydev                 20480  0
serio_raw              16384  0
pcmcia                 61440  0
r852                   20480  0
sm_common              16384  1 r852
nand                   61440  2 r852,sm_common
nand_ecc               16384  1 nand
nand_bch               16384  1 nand
bch                    20480  1 nand_bch
nand_ids               16384  1 nand
mtd                    57344  3 nand_bch,sm_common,nand
lpc_ich                24576  0
r592                   20480  0
memstick               16384  1 r592
yenta_socket           49152  0
pcmcia_rsrc            20480  1 yenta_socket
pcmcia_core            24576  3 yenta_socket,pcmcia,pcmcia_rsrc
thinkpad_acpi          94208  0
nvram                  16384  1 thinkpad_acpi
snd_seq_midi           16384  0
binfmt_misc            20480  1
snd_seq_midi_event     16384  1 snd_seq_midi
snd_hda_codec_conexant    24576  1
snd_hda_codec_generic    73728  1 snd_hda_codec_conexant
snd_rawmidi            32768  1 snd_seq_midi
snd_hda_intel          36864  3
snd_hda_codec         126976  3 snd_hda_intel,snd_hda_codec_conexant,snd_hda_codec_generic
snd_hda_core           81920  4 snd_hda_intel,snd_hda_codec_conexant,snd_hda_codec,snd_hda_codec_generic
snd_hwdep              16384  1 snd_hda_codec
snd_pcm               102400  3 snd_hda_intel,snd_hda_codec,snd_hda_core
snd_seq                65536  2 snd_seq_midi_event,snd_seq_midi
shpchp                 36864  0
snd_seq_device         16384  3 snd_seq,snd_rawmidi,snd_seq_midi
snd_timer              32768  2 snd_seq,snd_pcm
snd                    77824  17 snd_hda_intel,snd_hwdep,snd_hda_codec_conexant,snd_seq,snd_hda_codec,snd_timer,thinkpad_acpi,snd_rawmidi,snd_hda_codec_generic,snd_seq_device,snd_pcm
mei_me                 40960  0
mei                   102400  1 mei_me
soundcore              16384  1 snd
mac_hid                16384  0
parport_pc             32768  0
ppdev                  20480  0
lp                     20480  0
parport                49152  3 lp,parport_pc,ppdev
autofs4                40960  2
btrfs                1089536  0
xor                    24576  1 btrfs
raid6_pq              114688  1 btrfs
dm_mirror              24576  0
dm_region_hash         20480  1 dm_mirror
dm_log                 20480  2 dm_mirror,dm_region_hash
hid_generic            16384  0
psmouse               139264  0
pata_acpi              16384  0
firewire_ohci          40960  0
sdhci_pci              28672  0
sdhci                  45056  1 sdhci_pci
i915                 1449984  4
firewire_core          65536  1 firewire_ohci
crc_itu_t              16384  1 firewire_core
usbhid                 53248  0
hid                   118784  2 hid_generic,usbhid
wmi                    16384  0
i2c_algo_bit           16384  1 i915
drm_kms_helper        151552  1 i915
syscopyarea            16384  1 drm_kms_helper
fjes                   77824  0
sysfillrect            16384  1 drm_kms_helper
sysimgblt              16384  1 drm_kms_helper
fb_sys_fops            16384  1 drm_kms_helper
video                  40960  2 thinkpad_acpi,i915
drm                   352256  6 i915,drm_kms_helper
e1000e                249856  0
ptp                    20480  1 e1000e
pps_core               16384  1 ptp
I hope it working now with those old drivers because if its not i have no idea how to reverse it.
JeremyB
Level 21
Level 21
Posts: 13881
Joined: Fri Feb 21, 2014 8:17 am

Re: Intermittent wifi connection using Realtek RTL8192CU

Post by JeremyB »

I don't see the driver from pvaret loaded, try the command from viewtopic.php?f=90&t=262171&p=1418076#p1418059 and reboot
xf2

Re: Intermittent wifi connection using Realtek RTL8192CU

Post by xf2 »

JeremyB wrote:I don't see the driver from pvaret loaded, try the command from viewtopic.php?f=90&t=262171&p=1418076#p1418059 and reboot
I didn't run that, the code I ran was this

Code: Select all

sudo apt-get install linux-headers-generic build-essential dkms
git clone https://github.com/pvaret/rtl8192cu-fixes.git
sudo dkms add ./rtl8192cu-fixes
sudo dkms install 8192cu/1.10
sudo depmod -a
sudo cp ./rtl8192cu-fixes/blacklist-native-rtl8192.conf /etc/modprobe.d/
sudo modprobe 8192cu
# (or reboot?)
Do you think it still makes sense to run this

Code: Select all

echo "blacklist rtl8192cu" | sudo tee /etc/modprobe.d/rtl8192cu.conf
even though the wifi is working now?
JeremyB
Level 21
Level 21
Posts: 13881
Joined: Fri Feb 21, 2014 8:17 am

Re: Intermittent wifi connection using Realtek RTL8192CU

Post by JeremyB »

Yes, I would still run the blacklist code and reboot
xf2

Re: Intermittent wifi connection using Realtek RTL8192CU

Post by xf2 »

JeremyB wrote:Yes, I would still run the blacklist code and reboot
Alright, blacklist + reboot has been performed.

Code: Select all

lsmod
Module                  Size  Used by
ccm                    20480  2
arc4                   16384  2
rtl8xxxu              126976  0
mac80211              782336  1 rtl8xxxu
cfg80211              602112  1 mac80211
coretemp               16384  0
kvm                   593920  0
irqbypass              16384  1 kvm
joydev                 20480  0
input_leds             16384  0
serio_raw              16384  0
pcmcia                 61440  0
r852                   20480  0
sm_common              16384  1 r852
nand                   61440  2 r852,sm_common
nand_ecc               16384  1 nand
nand_bch               16384  1 nand
bch                    20480  1 nand_bch
nand_ids               16384  1 nand
r592                   20480  0
yenta_socket           49152  0
mtd                    57344  3 nand_bch,sm_common,nand
pcmcia_rsrc            20480  1 yenta_socket
memstick               16384  1 r592
pcmcia_core            24576  3 yenta_socket,pcmcia,pcmcia_rsrc
lpc_ich                24576  0
binfmt_misc            20480  1
snd_hda_codec_conexant    24576  1
snd_hda_codec_generic    73728  1 snd_hda_codec_conexant
shpchp                 36864  0
snd_hda_intel          36864  5
snd_hda_codec         126976  3 snd_hda_intel,snd_hda_codec_conexant,snd_hda_codec_generic
snd_hda_core           81920  4 snd_hda_intel,snd_hda_codec_conexant,snd_hda_codec,snd_hda_codec_generic
snd_hwdep              16384  1 snd_hda_codec
snd_pcm               102400  4 snd_hda_intel,snd_hda_codec,snd_hda_core
thinkpad_acpi          94208  0
nvram                  16384  1 thinkpad_acpi
snd_seq_midi           16384  0
snd_seq_midi_event     16384  1 snd_seq_midi
snd_rawmidi            32768  1 snd_seq_midi
snd_seq                65536  2 snd_seq_midi_event,snd_seq_midi
mei_me                 40960  0
snd_seq_device         16384  3 snd_seq,snd_rawmidi,snd_seq_midi
mei                   102400  1 mei_me
snd_timer              32768  2 snd_seq,snd_pcm
snd                    77824  20 snd_hda_intel,snd_hwdep,snd_hda_codec_conexant,snd_seq,snd_hda_codec,snd_timer,thinkpad_acpi,snd_rawmidi,snd_hda_codec_generic,snd_seq_device,snd_pcm
soundcore              16384  1 snd
mac_hid                16384  0
parport_pc             32768  0
ppdev                  20480  0
lp                     20480  0
parport                49152  3 lp,parport_pc,ppdev
autofs4                40960  2
btrfs                1089536  0
xor                    24576  1 btrfs
raid6_pq              114688  1 btrfs
dm_mirror              24576  0
dm_region_hash         20480  1 dm_mirror
dm_log                 20480  2 dm_mirror,dm_region_hash
hid_generic            16384  0
psmouse               139264  0
pata_acpi              16384  0
firewire_ohci          40960  0
sdhci_pci              28672  0
sdhci                  45056  1 sdhci_pci
firewire_core          65536  1 firewire_ohci
i915                 1449984  3
crc_itu_t              16384  1 firewire_core
usbhid                 53248  0
hid                   118784  2 hid_generic,usbhid
wmi                    16384  0
i2c_algo_bit           16384  1 i915
drm_kms_helper        151552  1 i915
syscopyarea            16384  1 drm_kms_helper
e1000e                249856  0
sysfillrect            16384  1 drm_kms_helper
sysimgblt              16384  1 drm_kms_helper
fjes                   77824  0
fb_sys_fops            16384  1 drm_kms_helper
video                  40960  2 thinkpad_acpi,i915
drm                   352256  5 i915,drm_kms_helper
ptp                    20480  1 e1000e
pps_core               16384  1 ptp
JeremyB
Level 21
Level 21
Posts: 13881
Joined: Fri Feb 21, 2014 8:17 am

Re: Intermittent wifi connection using Realtek RTL8192CU

Post by JeremyB »

Does the wifi work better? If not see the wireless script link in my signature and post results
xf2

Re: Intermittent wifi connection using Realtek RTL8192CU

Post by xf2 »

JeremyB wrote:Does the wifi work better? If not see the wireless script link in my signature and post results
The wifi seems to working and not cutting out (the blacklist script did not make any noticeable difference). The only difference is that the light on my wifi adapter no longer lights up, but it is working.

Thank you for the help (and everyone else as well).
JeremyB
Level 21
Level 21
Posts: 13881
Joined: Fri Feb 21, 2014 8:17 am

Re: Intermittent wifi connection using Realtek RTL8192CU

Post by JeremyB »

Well you are just using the kernel module rtl8xxxu and not anything else. I don't know why, but the module that is made from the pvaret github site is not found in the lsusb results as it was always shown as 8192cu
Locked

Return to “Beginner Questions”