12

I am using a Model B 256MB Pi with an Edimax EW-7711UTn USB WiFi adaptor. After some hours, the WiFi connection begins to drop and be restarted. Until it stops working completely. This is what I see in /var/log/messages:

Mar  9 20:39:29 raspberrypi kernel: [ 9353.773167] cfg80211: Calling CRDA to update world regulatory domain
Mar  9 20:39:29 raspberrypi wpa_action: WPA_IFACE=wlan0 WPA_ACTION=DISCONNECTED
Mar  9 20:39:29 raspberrypi wpa_action: WPA_ID=0 WPA_ID_STR= WPA_CTRL_DIR=/var/run/wpa_supplicant
Mar  9 20:39:29 raspberrypi wpa_action: ifdown wlan0
Mar  9 20:39:30 raspberrypi wpa_action: removing sendsigs omission pidfile: /run/sendsigs.omit.d/wpasupplicant.wpa_supplicant.wlan0.pid
Mar  9 20:39:33 raspberrypi kernel: [ 9357.478605] wlan0: authenticate with 30:46:9a:54:6f:3d
Mar  9 20:39:33 raspberrypi kernel: [ 9357.624628] wlan0: send auth to xxx (try 1/3)
Mar  9 20:39:33 raspberrypi kernel: [ 9357.626510] wlan0: authenticated
Mar  9 20:39:33 raspberrypi kernel: [ 9357.703189] wlan0: associate with xxx (try 1/3)
Mar  9 20:39:33 raspberrypi kernel: [ 9357.707045] wlan0: RX AssocResp from 30:46:9a:54:6f:3d (capab=0x411 status=0 aid=2)
Mar  9 20:39:33 raspberrypi kernel: [ 9357.722534] wlan0: associated
Mar  9 20:39:33 raspberrypi wpa_action: WPA_IFACE=wlan0 WPA_ACTION=CONNECTED
Mar  9 20:39:33 raspberrypi wpa_action: WPA_ID=0 WPA_ID_STR= WPA_CTRL_DIR=/var/run/wpa_supplicant
Mar  9 20:39:33 raspberrypi wpa_action: ifup wlan0=default
Mar  9 20:39:40 raspberrypi wpa_action: creating sendsigs omission pidfile: /run/sendsigs.omit.d/wpasupplicant.wpa_supplicant.wlan0.pid
Mar  9 20:39:40 raspberrypi wpa_action: bssid=xxx
Mar  9 20:39:40 raspberrypi wpa_action: ssid=xxx
Mar  9 20:39:40 raspberrypi wpa_action: id=0
Mar  9 20:39:40 raspberrypi wpa_action: mode=station
Mar  9 20:39:40 raspberrypi wpa_action: pairwise_cipher=CCMP
Mar  9 20:39:40 raspberrypi wpa_action: group_cipher=CCMP
Mar  9 20:39:40 raspberrypi wpa_action: key_mgmt=WPA2-PSK
Mar  9 20:39:40 raspberrypi wpa_action: wpa_state=COMPLETED
Mar  9 20:39:40 raspberrypi wpa_action: ip_address=xxx
Mar  9 20:39:40 raspberrypi wpa_action: address=xxx

And dmesg sometimes tells me:

[20014.112395] wlan0: deauthenticating from xxx by local choice (reason=3)

wpa processes running are:

 1872 ?        Ss     0:00 /sbin/wpa_supplicant -s -B -P /var/run/wpa_supplicant.wlan0.pid -i wlan0 -W -D nl80211,wext -c /etc/wpa_supplicant/wpa_supplicant.conf
 2010 ?        Ss     0:00 /sbin/wpa_cli -B -P /var/run/wpa_action.wlan0.pid -i wlan0 -p /var/run/wpa_supplicant -a /sbin/wpa_action

Does anyone else have these problems, and how can I fix those?

Since many people seem to have problems with insufficient power supplies: My RasPi runs on a 1.2A 5V supply and has a 3.8A 5V powered USB hub attached to it. I now detached all other devices from the powered hub and connected the Edimax to it, maybe this will help.

Update: No, this time it took only a few minutes for the WiFi to become unresponsive.

Update 2: I still have problems, right now I noticed that the connection can be re-started using ifdown and ifup, but I keep getting more and more of these messages:

Mar 22 19:11:59 raspberrypi kernel: [215435.967714] cfg80211: Calling CRDA to update world regulatory domain
Mar 22 19:12:01 raspberrypi kernel: [215437.948971] wlan0: authenticate with XXXXXX
Mar 22 19:12:02 raspberrypi kernel: [215438.087245] wlan0: send auth to XXXXXX (try 1/3)
Mar 22 19:12:02 raspberrypi kernel: [215438.089006] wlan0: authenticated
Mar 22 19:12:02 raspberrypi kernel: [215438.165765] wlan0: associate with XXXXXX (try 1/3)
Mar 22 19:12:02 raspberrypi kernel: [215438.169604] wlan0: RX AssocResp from XXXXXX (capab=0x411 status=0 aid=1)
Mar 22 19:12:02 raspberrypi kernel: [215438.185759] wlan0: associated

This happens in shorter and shorter timespans until I reboot. Then it's ok again for a day or two. So what's going on here?

Update: Ok, I just hooked the Pi up to a display, and started copying files via WiFi. After about 15 minutes the Pi just froze. I had a tmux running with output of htop and tail -f /var/log/messages. No visible kernel panic, nor anything in /var/log/messages. The machine is frozen.

JVarhol
  • 678
  • 1
  • 5
  • 17
Arne
  • 2,226
  • 2
  • 18
  • 35
  • One thing I am wondering about: What good does the wpa_cli do? Can it interfere with the wpa_supplicant? – Arne Mar 10 '13 at 11:24
  • I changed my /etc/network/interfaces similar to the one listed here: http://elinux.org/RPi_edimax_EW-7811Un, and now it seems to work quite well. Has been up for some hours, and still working, without a reconnect. – Arne Mar 10 '13 at 14:43
  • And now, ten minutes later, I get two reconnects. So the problem is not gone. As long as it reconnects only every couple of hours, I am happy. Let's see... – Arne Mar 10 '13 at 15:00
  • Are you still having the problem? – Jivings Mar 24 '13 at 09:54
  • Trying to reproduce the problems since yesterday when I noticed there were some firmware updates available for my router. So far it seems more stable, but I am not sure. I've written a script now that automatically tries to reconnect the wifi, and so far it was not triggered. I keep on waiting... – Arne Mar 24 '13 at 10:04
  • Let me know how it goes. I'm interested as I have the same device. – Jivings Mar 24 '13 at 10:05
  • After 1.5 days, my Raspberry went into dead mode again. This time, even the Ethernet port did not work anymore. I will try to hook it up to a display later this week and see if I can find any more information in the logs. After reboots, everything is fine for a day or two. But I don't want to reboot the machine every night. :) – Arne Mar 25 '13 at 08:49
  • 1
    Hopefully this bounty will get you slightly more attention. – Jivings Mar 26 '13 at 08:28
  • This problem is pretty weird. I have been testing for the last days, and the Pi will always go down after about 2 days. I will hook it up to a display now, since both Wifi and Ethernet seem to go dead. – Arne Mar 28 '13 at 18:24
  • Nothing interesting in /var/messages? Or dmesg? – Jivings Mar 28 '13 at 18:24
  • Only the abovementioned messages. And when the Pi goes dead, nothing anymore until reboot. Doing two things now: First, hooking up the Pi to a display and second, trying to hook it up via Ethernet. Last thing I will try is to swap the router. I still think that it is a bit broken. – Arne Mar 28 '13 at 18:56
  • What else do you have plugged into the Pi at all? And what are you powering it with? – Jivings Mar 31 '13 at 09:49
  • The Pi is hooked up to a 1.2A 5V USB power supply. It has attached the WiFi Dongle and a powered USB hub, using a 3.6A 5V power supply. The hub drives a 2.5" USB hard drive. I think that should be ample power for this. I have now hooked up the pi to my HDMI display, to see if it will output anything (like a kernel panic) that could explain it going dead after some time. – Arne Mar 31 '13 at 10:58

5 Answers5

7

I figure that I can safely say now that the problems are due to the device and/or the rt2x00 driver. I have been using Ethernet only the last 48 hours, copied many many Gigabytes of data, and haven't got a single problem. Hence, currently I would discourage the usage of rt2800 based devices, and I will try to find another dongle, maybe one with the Realtek chip, since that seems to be the most widely used.

EDIT: I bought a TPL-WN725N with a RTL8188CUS chip. It works out of the box, currently with 0.5 GB of traffic, and still running. It also seems somewhat faster than the Ralink based dongle. I get 1.9MByte/sec, whereas before I had 1.3MByte/sec. Let's see if it will let the Pi run longer and not freeze up.

EDIT: >5 GB and still going strong. Looks very promising. Will keep it running to see if it fails.

Arne
  • 2,226
  • 2
  • 18
  • 35
  • So who do you want me to award this bounty to? :) – Jivings Apr 01 '13 at 23:48
  • Well, not me. That would be unfair, I think. I leave it up to you. – Arne Apr 02 '13 at 08:08
  • I'm not sure if the realtek are the best drivers/chips. I have one (RTL8188CUS), it's ok, but it is not that great, with quite frequent disconnections/reconnections. The driver seems stable, tho, even upon unloading/reloading. On the other side, i read around of good experiences with other ralink based dongles on the pi. I ordered a 5€ dongle supposed to have ralink chip in it myself, of which i read good, and planning to test it out soon. There's also a wikipage for verified peripherals (of which you might be already aware): http://elinux.org/RPi_VerifiedPeripherals – Pa_ Apr 02 '13 at 12:55
  • I found this here: http://www.raspberrypi.org/phpBB3/viewtopic.php?f=24&t=5830 -- My Raspberry Pi is from last year, maybe I have the version with the polyfuses limiting the WiFi adapter? I had been using the Edimax dongle on the Raspberry Pi (w/ 1.2A power supply). – Arne Apr 02 '13 at 13:47
  • However, since my Pi reboots when I (hot-)plug in the Edimax, I guess my Pi already comes with disabled Polyfuses. – Arne Apr 02 '13 at 13:55
  • I double checked, and I have got the black resistors with "0"s on them. Also, the Edimax stick refuses to be recognized on the (powered) hub. Only works on the Pi's USB port. I will swap it for another WiFi dongle. – Arne Apr 02 '13 at 17:40
  • Beware that many usb powered hubs can cause such problems. I believe the best thing you can do to check your edimax is to plug it on a standard pc running some sort of live cd. If that runs fine, then perhaps your usb psu for the pi does not provide enough amps? – Pa_ Apr 02 '13 at 20:13
2

I have exactly this problem with several different Wifi dongles. Two things.

1.) add this to your /etc/network/interfaces

wireless-power off

2.) wlan0: deauthenticating from xxx by local choice (reason=3) repeatedly can be from a dauthentication attack on your wifi

2

Found this explanation which states power management from the driver might be at fault. It also suggests using these changes for the driver:

sudo nano /etc/modprobe.d/8192cu.conf

and paste the following in:

# Disable power saving
options 8192cu rtw_power_mgnt=0 rtw_enusbss=1 rtw_ips_mode=1 
Ghanima
  • 15,855
  • 15
  • 61
  • 119
Mircea D.
  • 121
  • 1
2

There is a special version of hostapd (deals with wireless authentication) you should use with this adapter. The Realtek Chipset doesn't work particularly well if at all with the 'out of the box' Raspbian distro version.

I posted a guide to installing this Wifi adapter for use as an AP on my blog.

If you don't want to check out my blog, here is the link for the guide I used.

BigCowPi
  • 194
  • 3
2

i have no idea, to be honest, but there are two things you could try:

first one is playing around with the power saving options documented in the realtek driver package. right now i use maximum power saving, by:

insmod /lib/modules/3.6.11+/kernel/drivers/net/wireless/rtl8192cu/8192cu.ko  rtw_power_mgnt=2 rtw_ips_mode=1 rtw_hwpwrp_detect=1 rtw_enusbss=1

but you might try different combinations of the options above.

second thing you could try is to have a cronojob every n minutes that checks whether the wlan is working (for example using fping or whatsoever), and if not it brings it down and up again (by using network manager command line client), possibly also removing and reinserting the module

Pa_
  • 373
  • 3
  • 8
  • I have such a script already running (every 5m it syslogs whether wifi is up or down, and restarts wifi), but it does not help. Right now I guess the whole system halts, because at some point logging to /var/log/messages stops altogether. Trying to debug with attached display now. – Arne Mar 31 '13 at 10:59
  • As I wrote above: the Pi just froze. Keyboard dead, display output frozen, no further messages. – Arne Mar 31 '13 at 11:11
  • 1
    Furthermore: It seems my Edimax uses the rt2800 driver, not the rtl8192. – Arne Mar 31 '13 at 11:13
  • You need to rule out the possibility that the wifi driver problem and the freezing problem are unrelated by removing the dongle and doing the same test via ethernet. – goldilocks Mar 31 '13 at 11:16
  • Doing that right now. So far, 1.7GB copied without a problem. Still going. – Arne Mar 31 '13 at 12:21
  • I think you should have mentioned the chipset of your dongle above. Anyway, even if it is a ralink,it should work. One thing you could do is force the connection reset (w. unload/reload of the module) every hour, for example, not giving it the time to make your pi crash – Pa_ Mar 31 '13 at 14:59
  • Will try that, although it's a bit of a hack. :) Have been pushing stuff via ethernet for the last couple of hours, and it hasn't crashed. – Arne Mar 31 '13 at 19:17
  • Ok, I think it's the WiFi dongle -- ethernet is running for hours on end and has pushed many gigabytes around. – Arne Mar 31 '13 at 20:02
  • Also check the power supply. I experienced, with some dongles, erratic behavior due to poor PSU – Pa_ Apr 12 '17 at 14:09