Wifi connection drops randomly with Realtek RTL8187

Magnus's picture

Forums: 

I have a USB adapter (identified as Realtek RTL8187 Wireless Adapter) I use to connect to wifi. Until about two weeks ago it worked perfectly, but now the connection drops randomly: sometimes never, sometimes every 20 minutes, and sometimes all the time. The computer can still detect the Wifi network, but I can't browse or download anything. The same computer with the same adapter can connect perfectly with Windows 7, so I suppose it's some issue with the driver or the configuration.

This is the output of dmesg | grep -e rtl -e wlan:

[    0.000000] Initializing cgroup subsys cpuset
[    4.829561] ieee80211 phy0: hwaddr 00:e0:4c:04:4f:d7, RTL8187vB (default) V1 + rtl8225z2, rfkill mask 2
[    4.840591] rtl8187: Customer ID is 0x00
[    4.840649] Registered led device: rtl8187-phy0::radio
[    4.840687] Registered led device: rtl8187-phy0::tx
[    4.840705] Registered led device: rtl8187-phy0::rx
[    4.841207] rtl8187: wireless switch is on
[    4.841250] usbcore: registered new interface driver rtl8187
[    4.855237] <30>udev[428]: renamed network interface wlan1 to wlan1-wlan0
[    5.123293] <30>udev[430]: renamed network interface wlan0 to wlan1
[    5.171266] <30>udev[428]: renamed network interface wlan1-wlan0 to wlan0
[   18.316546] ADDRCONF(NETDEV_UP): wlan1: link is not ready
[   29.896751] ADDRCONF(NETDEV_UP): wlan1: link is not ready
[   32.632726] ADDRCONF(NETDEV_UP): wlan1: link is not ready
[   37.343894] wlan1: authenticate with 00:25:9c:e5:c6:d1 (try 1)
[   37.346632] wlan1: authenticated
[   37.346659] wlan1: associate with 00:25:9c:e5:c6:d1 (try 1)
[   37.364008] wlan1: RX AssocResp from 00:25:9c:e5:c6:d1 (capab=0x431 status=0 aid=1)
[   37.364012] wlan1: associated
[   37.366553] ADDRCONF(NETDEV_CHANGE): wlan1: link becomes ready
[   47.494450] wlan1: no IPv6 routers present

This is the output of iwconfig:

lo        no wireless extensions.
eth0      no wireless extensions.
wlan1     IEEE 802.11bg  ESSID:"ponja"
          Mode:Managed  Frequency:2.437 GHz  Access Point: 00:25:9C:E5:C6:D1
          Bit Rate=54 Mb/s   Tx-Power=20 dBm
          Retry  long limit:7   RTS thr:off   Fragment thr:off
          Encryption key:off
          Power Management:off
          Link Quality=50/70  Signal level=-60 dBm
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:104  Invalid misc:42   Missed beacon:0
wlan0     IEEE 802.11bg  ESSID:off/any
          Mode:Managed  Access Point: Not-Associated   Tx-Power=0 dBm
          Retry  long limit:7   RTS thr:off   Fragment thr:off
          Encryption key:off
          Power Management:off

And this is the output of lsmod:

[Module                  Size  Used by
aesni_intel            50137  1
cryptd                 14463  1 aesni_intel
aes_x86_64             16796  1 aesni_intel
aes_generic            37122  2 aesni_intel,aes_x86_64
acpi_cpufreq           12849  0
mperf                  12411  1 acpi_cpufreq
cpufreq_powersave      12454  0
cpufreq_conservative    13878  0
cpufreq_stats          12713  0
cpufreq_userspace      12576  0
parport_pc             22191  0
ppdev                  12725  0
lp                     17190  0
parport                31650  3 parport_pc,ppdev,lp
snd_hrtimer            12604  1
loop                   22515  0
rt61pci                22358  0
crc_itu_t              12347  1 rt61pci
snd_hda_codec_hdmi     22161  4
rt2x00pci              12779  1 rt61pci
arc4                   12458  4
ecb                    12737  4
rt2x00lib              33548  2 rt61pci,rt2x00pci
rtl8187                35388  0
nvidia              10029865  38
mac80211              180997  3 rt2x00pci,rt2x00lib,rtl8187
snd_hda_intel          25946  3
snd_hda_codec          67647  2 snd_hda_codec_hdmi,snd_hda_intel
cfg80211              126017  3 rt2x00lib,rtl8187,mac80211
snd_hwdep              13148  1 snd_hda_codec
snd_pcm_oss            40662  0
snd_mixer_oss          17905  2 snd_pcm_oss
snd_pcm                67327  4 snd_hda_codec_hdmi,snd_hda_intel,snd_hda_codec,snd_pcm_oss
snd_seq_midi           12848  0
snd_rawmidi            22963  1 snd_seq_midi
rfkill                 19014  1 cfg80211
snd_seq_midi_event     13316  1 snd_seq_midi
snd_seq                44678  3 snd_seq_midi,snd_seq_midi_event
tpm_tis                13125  0
tpm                    17726  1 tpm_tis
eeprom_93cx6           12455  2 rt61pci,rtl8187
tpm_bios               12903  1 tpm
snd_timer              22658  3 snd_hrtimer,snd_pcm,snd_seq
snd_seq_device         13155  3 snd_seq_midi,snd_rawmidi,snd_seq
usb_storage            43639  0
uas                    13151  0
i2c_i801               16870  0
snd                    52280  16 snd_hda_codec_hdmi,snd_hda_intel,snd_hda_codec,snd_hwdep,snd_pcm_oss,snd_mixer_oss,snd_pcm,snd_rawmidi,snd_seq,snd_timer,snd_seq_device
i2c_core               23725  2 nvidia,i2c_i801
processor              27431  5 acpi_cpufreq
evdev                  17475  11
button                 12994  0
soundcore              13014  2 snd
snd_page_alloc         12969  2 snd_hda_intel,snd_pcm
pcspkr                 12579  0
thermal_sys            17939  1 processor
serio_raw              12878  0
joydev                 17138  0
usbhid                 39900  0
hid                    72616  1 usbhid
ext3                  112218  2
jbd                    41698  1 ext3
mbcache                12930  1 ext3
sg                     25769  0
sr_mod                 21824  0
sd_mod                 35501  4
cdrom                  35134  1 sr_mod
crc_t10dif             12348  1 sd_mod
uhci_hcd               26290  0
ata_generic            12479  0
ehci_hcd               39529  0
r8169                  37209  0
ata_piix               25319  3
libata                147240  2 ata_generic,ata_piix
scsi_mod              161457  6 usb_storage,uas,sg,sr_mod,sd_mod,libata
usbcore               122908  7 rtl8187,usb_storage,uas,usbhid,uhci_hcd,ehci_hcd
mii                    12634  1 r8169
nls_base               12753  1 usbcore

Re: Wifi connection drops randomly with Realtek RTL8187

IntnsRed's picture

Strange, especially since it worked well before. Windows never drops the link?

My first impulse would be to wonder about radio interference. Have you tried to monitor the quality of the link? KDE has a GUI wireless tool or two that'll show you signal strength/quality, and I'd guess there has to be some commandline tool to do something similar. Using a commandline tool and putting it in a loop dumping the output to a file might give some clues when it goes down.

Re: Wifi connection drops randomly with Realtek RTL8187

Magnus's picture

Windows never drops the link, and neither does any other device connected to the same network. Wicd still detects the network without any drop in signal and thinks it's connected perfectly fine, but it's not. I don't think it's radio interference, but a driver or configuration issue.

EDIT: I installed firmware-realtek (didn't know there was one). This didn't solve the problem, but now when I enter dmesg this pops out:

[ 1005.275088] usb 2-3: reset high speed USB device using ehci_hcd and address 3
[ 1675.255081] usb 2-3: reset high speed USB device using ehci_hcd and address 3
[ 5863.201407] usb 2-3: reset high speed USB device using ehci_hcd and address 3
[11611.133116] usb 2-3: reset high speed USB device using ehci_hcd and address 3
[19235.042570] usb 2-3: reset high speed USB device using ehci_hcd and address 3
[20159.031626] usb 2-3: reset high speed USB device using ehci_hcd and address 3
[20205.047054] usb 2-3: reset high speed USB device using ehci_hcd and address 3
[22569.007029] usb 2-3: reset high speed USB device using ehci_hcd and address 3
[22836.999787] usb 2-3: reset high speed USB device using ehci_hcd and address 3
[26248.959288] usb 2-3: reset high speed USB device using ehci_hcd and address 3
[26826.968424] usb 2-3: reset high speed USB device using ehci_hcd and address 3
[27212.947874] usb 2-3: reset high speed USB device using ehci_hcd and address 3
[30332.922828] usb 2-3: reset high speed USB device using ehci_hcd and address 3
[30392.914062] usb 2-3: reset high speed USB device using ehci_hcd and address 3
[33520.884926] usb 2-3: reset high speed USB device using ehci_hcd and address 3

Then I disconnect and connect to the wifi device and everything works fine again. So it might be a usb problem or something.

Re: Wifi connection drops randomly with Realtek RTL8187

IntnsRed's picture

Yup, from your description and the fact that Windows and others aren't having problems, a driver issue sounds likely.

Have you tried downgrading your kernel (or installing both and booting into the older kernel) to see if the issue is still there then? If you can isolate it to the kernel upgrade, a bug report to the kernel team may get the issue addressed.

Re: Wifi connection drops randomly with Realtek RTL8187

Magnus's picture

Unfortunately I can't find the 2.6.37 kernel at the repos. I guess they took it out.

EDIT: BTW, I found out usb 2-3 (which dmesg was complaining about) wasn't the network card at all. So I guess it's not an usb problem. I'm pretty sure it's some driver or configuration issue though.

Re: Wifi connection drops randomly with Realtek RTL8187

IntnsRed's picture

There has to be a *.deb of 2.6.37 somewhere on the net.

What I'd do is two things: A) file a bug against the kernel, with a description about what you're experiencing and how it worked under 2.6.37; but also Dirol do some searches on the net for the linux-image*2.6.37*.deb file (and modules, if needed) just to verify that it still worked under the old kernel. While not being in the repository, there has to be a binary or source *.deb of that version still kicking around.

(You also should mail the kernel maintainers to see if they have one. Politely worded, sane requests are usually positively responded to by Debian developers.)