preki
Posts: 5
Joined: Tue Jul 24, 2012 9:01 pm

Wifi dropping (using Edimax EW-7811UN)

Wed Aug 01, 2012 6:38 pm

I have an Edimax EW-7811UN wifi dongle, installed on Raspbian using the set-up script thanks to @MrEngman 's script described on this thread:
http://www.raspberrypi.org/phpBB3/viewt ... 25#p127325

It's working fine most of the time, but the connection seems to drop after a while. The excerpt below from /var/log/syslog seems to give a clue to what is going on (sorry for the long paste - don't know the forum etiquette on this) but I could use some help to interpret what it means. wpa_supplicant gives "CTRL-EVENT-DISCONNECTED" a couple of times. The first time the connection is re-established, but the second time it is not re-established and the wlan0 interface is subsequently deleted.

Can anybody please advise why this might be happening and how I could fix it?

Thanks.



Aug 1 02:18:29 raspberrypi wpa_supplicant[2414]: wlan0: CTRL-EVENT-DISCONNECTED bssid=58:98:35:22:99:c5 reason=0
Aug 1 02:18:30 raspberrypi ifplugd(wlan0)[2398]: Link beat lost.
Aug 1 02:18:30 raspberrypi wpa_supplicant[2414]: wlan0: Trying to associate with 58:98:35:22:99:c5 (SSID='Vertigo' freq=2437 MHz)
Aug 1 02:18:30 raspberrypi wpa_supplicant[2414]: wlan0: Association request to the driver failed
Aug 1 02:18:31 raspberrypi wpa_supplicant[2414]: wlan0: Associated with 58:98:35:22:99:c5
Aug 1 02:18:31 raspberrypi wpa_supplicant[2414]: wlan0: WPA: Key negotiation completed with 58:98:35:22:99:c5 [PTK=CCMP GTK=TKIP]
Aug 1 02:18:31 raspberrypi wpa_supplicant[2414]: wlan0: CTRL-EVENT-CONNECTED - Connection to 58:98:35:22:99:c5 completed (reauth) [
id=0 id_str=]
Aug 1 02:18:32 raspberrypi ifplugd(wlan0)[2398]: Link beat detected.
Aug 1 02:20:53 raspberrypi wpa_supplicant[2414]: wlan0: WPA: Group rekeying completed with 58:98:35:22:99:c5 [GTK=TKIP]
...
Aug 1 04:40:51 raspberrypi wpa_supplicant[2414]: wlan0: WPA: Group rekeying completed with 58:98:35:22:99:c5 [GTK=TKIP]
Aug 1 04:50:51 raspberrypi wpa_supplicant[2414]: wlan0: WPA: Group rekeying completed with 58:98:35:22:99:c5 [GTK=TKIP]
Aug 1 05:00:51 raspberrypi wpa_supplicant[2414]: wlan0: WPA: Group rekeying completed with 58:98:35:22:99:c5 [GTK=TKIP]
Aug 1 05:05:17 raspberrypi wpa_supplicant[2414]: wlan0: CTRL-EVENT-DISCONNECTED bssid=58:98:35:22:99:c5 reason=0
Aug 1 05:05:17 raspberrypi ifplugd(wlan0)[2398]: Link beat lost.
Aug 1 05:05:18 raspberrypi wpa_supplicant[2414]: wlan0: Trying to associate with 58:98:35:22:99:c5 (SSID='Vertigo' freq=2437 MHz)
Aug 1 05:05:18 raspberrypi wpa_supplicant[2414]: wlan0: Association request to the driver failed
Aug 1 05:05:19 raspberrypi wpa_supplicant[2414]: wlan0: Associated with 58:98:35:22:99:c5
Aug 1 05:05:19 raspberrypi ifplugd(wlan0)[2398]: Link beat detected.
Aug 1 05:05:23 raspberrypi wpa_supplicant[2414]: wlan0: WPA: 4-Way Handshake failed - pre-shared key may be incorrect
Aug 1 05:05:23 raspberrypi wpa_supplicant[2414]: wlan0: CTRL-EVENT-DISCONNECTED bssid=58:98:35:22:99:c5 reason=0
Aug 1 05:05:24 raspberrypi ifplugd(wlan0)[2398]: Link beat lost.
Aug 1 05:05:32 raspberrypi wpa_supplicant[2414]: wlan0: Trying to associate with 58:98:35:22:99:c5 (SSID='Vertigo' freq=2437 MHz)
Aug 1 05:05:32 raspberrypi wpa_supplicant[2414]: wlan0: Association request to the driver failed
Aug 1 05:05:33 raspberrypi wpa_supplicant[2414]: wlan0: CTRL-EVENT-DISCONNECTED bssid=58:98:35:22:99:c5 reason=0
Aug 1 05:05:34 raspberrypi ifplugd(wlan0)[2398]: Executing '/etc/ifplugd/ifplugd.action wlan0 down'.
Aug 1 05:05:35 raspberrypi dhclient: Internet Systems Consortium DHCP Client 4.2.2
Aug 1 05:05:35 raspberrypi ifplugd(wlan0)[2398]: client: Internet Systems Consortium DHCP Client 4.2.2
Aug 1 05:05:35 raspberrypi dhclient: Copyright 2004-2011 Internet Systems Consortium.
Aug 1 05:05:35 raspberrypi ifplugd(wlan0)[2398]: client: Copyright 2004-2011 Internet Systems Consortium.
Aug 1 05:05:35 raspberrypi dhclient: All rights reserved.
Aug 1 05:05:35 raspberrypi ifplugd(wlan0)[2398]: client: All rights reserved.
Aug 1 05:05:35 raspberrypi dhclient: For info, please visit https://www.isc.org/software/dhcp/
Aug 1 05:05:35 raspberrypi ifplugd(wlan0)[2398]: client: For info, please visit https://www.isc.org/software/dhcp/
Aug 1 05:05:35 raspberrypi dhclient:
Aug 1 05:05:35 raspberrypi dhclient: Listening on LPF/wlan0/80:1f:02:4b:6f:c0
Aug 1 05:05:35 raspberrypi ifplugd(wlan0)[2398]: client: Listening on LPF/wlan0/80:1f:02:4b:6f:c0
Aug 1 05:05:35 raspberrypi dhclient: Sending on LPF/wlan0/80:1f:02:4b:6f:c0
Aug 1 05:05:35 raspberrypi ifplugd(wlan0)[2398]: client: Sending on LPF/wlan0/80:1f:02:4b:6f:c0
Aug 1 05:05:35 raspberrypi dhclient: Sending on Socket/fallback
Aug 1 05:05:35 raspberrypi ifplugd(wlan0)[2398]: client: Sending on Socket/fallback
Aug 1 05:05:35 raspberrypi dhclient: DHCPRELEASE on wlan0 to 192.168.1.254 port 67
Aug 1 05:05:35 raspberrypi ifplugd(wlan0)[2398]: client: DHCPRELEASE on wlan0 to 192.168.1.254 port 67
Aug 1 05:05:35 raspberrypi wpa_supplicant[2414]: wlan0: CTRL-EVENT-TERMINATING - signal 15 received
Aug 1 05:05:35 raspberrypi ifplugd(wlan0)[2398]: Program executed successfully.
Aug 1 05:05:38 raspberrypi ntpd[1484]: Deleting interface #3 wlan0, 192.168.1.99#123, interface stats: received=131, sent=143, dropped=0, active_time=22879 secs
Aug 1 05:05:38 raspberrypi ntpd[1484]: 195.216.64.208 interface 192.168.1.99 -> (none)
Aug 1 05:05:38 raspberrypi ntpd[1484]: 193.225.14.161 interface 192.168.1.99 -> (none)
Aug 1 05:05:38 raspberrypi ntpd[1484]: 217.147.223.78 interface 192.168.1.99 -> (none)
Aug 1 05:05:38 raspberrypi ntpd[1484]: 176.9.47.150 interface 192.168.1.99 -> (none)
Aug 1 05:05:38 raspberrypi ntpd[1484]: peers refreshed

arctaedius
Posts: 2
Joined: Sun Aug 12, 2012 9:04 am

Re: Wifi dropping (using Edimax EW-7811UN)

Sun Aug 12, 2012 9:05 am

I have the same problem with a DWA-131 connected to the Raspberry without USB-hub.

slakov
Posts: 7
Joined: Sun Aug 12, 2012 11:10 am
Location: Netherlands

Re: Wifi dropping (using Edimax EW-7811UN)

Wed Aug 15, 2012 2:30 pm

I had the same issue before using powered USB HUB. Now it's fine.

arctaedius
Posts: 2
Joined: Sun Aug 12, 2012 9:04 am

Re: Wifi dropping (using Edimax EW-7811UN)

Thu Aug 16, 2012 6:36 am

I'm now using a powered USB-HUB (D-Link DUB-H4), no more drops but the range is really bad. 5 meters away the signal at the router is 1-10%. And one thin inner wall between the DWA-131 and the router.

slakov
Posts: 7
Joined: Sun Aug 12, 2012 11:10 am
Location: Netherlands

Re: Wifi dropping (using Edimax EW-7811UN)

Thu Aug 16, 2012 6:41 am

arctaedius wrote:I'm now using a powered USB-HUB (D-Link DUB-H4), no more drops but the range is really bad. 5 meters away the signal at the router is 1-10%. And one thin inner wall between the DWA-131 and the router.
Strange. I have exactly the same hardware and router location (the wall is not so thin) - the signal is perfect. Maybe some wifi devices interfere in your case, try different channel.

User avatar
rew
Posts: 423
Joined: Fri Aug 26, 2011 3:25 pm

Re: Wifi dropping (using Edimax EW-7811UN)

Fri Sep 21, 2012 9:46 am

I will bridge the polyfuse on the USB side to see if it helps. It's happened once to me now. (after about 4 days of uptime and 4 days of downtime (due to this).
Check out our raspberry pi addons: https://www.bitwizard.nl/shop/

spuech
Posts: 8
Joined: Sat Feb 02, 2013 6:45 pm

Re: Wifi dropping (using Edimax EW-7811UN)

Thu Feb 07, 2013 5:46 pm

I have the same wifi adapter and I've solved my problem with pluging it onto my powered usb hub.

Thanks

mailliw
Posts: 39
Joined: Fri May 10, 2013 10:51 am

Re: Wifi dropping (using Edimax EW-7811UN)

Mon Jun 17, 2013 8:54 am

I find it really unlikely that a USB hub would help. I too have this problem, but only since a reformat; before that, it would retain its connection for 2 weeks or more.

Surely power is power! Why would it be fine one minute, then not have enough power the next?

jemtaylor
Posts: 20
Joined: Sat May 25, 2013 1:37 pm

Re: Wifi dropping (using Edimax EW-7811UN)

Sun Sep 08, 2013 7:26 pm

Hi,

I'm having the same problem with an Edimax dongle. It was getting worse and worse. I was at the point the wifi was dropping out every day. I updated the o/s and that seemed to improve it - it was dropping after a week. But it still fails.

Now I've switched dongle to a new WiPi one. Let's see if that works.....

Jeremy

jemtaylor
Posts: 20
Joined: Sat May 25, 2013 1:37 pm

Re: Wifi dropping (using Edimax EW-7811UN)

Thu Sep 12, 2013 4:43 pm

Well, it's been five days now using the new WiPi dongle and I haven't had the connection drop-out yet. Hopefully this is the issue solved. Either it was a problem with that particular dongle or it is a problem with that make of dongle....

J

jemtaylor
Posts: 20
Joined: Sat May 25, 2013 1:37 pm

Re: Wifi dropping (using Edimax EW-7811UN)

Thu Sep 19, 2013 11:08 am

Spoke too soon. I've had two WiFi drop-outs using the new dongle. That's about one per week. Much better than before but still requires a re-boot to solve it.

I think I'm going to have to improve the re-connection script so that it auto reboots if the re-connect fails to solve the problem after a number of tries......

PLCGuy
Posts: 22
Joined: Sat Aug 10, 2013 12:01 pm

Re: Wifi dropping (using Edimax EW-7811UN)

Tue Oct 08, 2013 10:10 pm

Full disclaimer: I don't know anything about what I am about to say, but I am trying to solve a similar problem.

From my log file (Which looks similar to yours, except I don't use DHCP) it seems to me that the problem isn't so much the wireless going down, which sucks, it's that it won't ever come back up.

I'm *guessing* that wpa_supplicant tries a few times to restart, then either it gives up or ifplugd gives up, at which point it shuts down the interface and that's it. It won't try to restart it unless the usb dongle is removed and reinserted.

...what I want to know is: How do I make it try to restart the interface again, or make it tolerate longer outages before giving up. In my case, it seems to try and reconnect 3 or 4 times over 15 seconds then calls it quits.

Can anyone help here?

PLCGuy
Posts: 22
Joined: Sat Aug 10, 2013 12:01 pm

Re: Wifi dropping (using Edimax EW-7811UN)

Tue Oct 08, 2013 11:42 pm

Ok, found a previous thread that seems to cover it nicely here:

http://www.raspberrypi.org/phpBB3/viewt ... 1&p=413095

...they suggest writing some python code to check and restart. I found another site where the author did it all with bash scripts and cron.

I've opted to try the cron approach, simply because I want the wifi to be repaired even if my code isn't running. Here is the the cron/bash approach:

http://root42.blogspot.ca/2013/03/how-t ... cally.html

zoelqivlie
Posts: 14
Joined: Wed Dec 19, 2012 12:53 pm

Re: Wifi dropping (using Edimax EW-7811UN)

Wed Oct 09, 2013 3:40 am

I think no enough power supply because wifi radio need more power to reach wifi signal ;-) minimum pure 5v - 1A and 5v - 2A ++ is better
tkraspilabs Indonesia | Pi 512M Rev 2 | Pi B+ | Pi 2 B | Pi Zero | Pi 3B

PLCGuy
Posts: 22
Joined: Sat Aug 10, 2013 12:01 pm

Re: Wifi dropping (using Edimax EW-7811UN)

Wed Oct 09, 2013 10:35 am

After a bit of fussing I have a setup a crontab with the following:

Using sudo crontab -e:

Code: Select all

*/5 * * * * /usr/local/bin/testwifi.sh 2> /var/log/testwifi.log
Then the actual script called testwifi.sh

Code: Select all

echo '/usr/local/bin/testwifi.sh log'
TESTIP=192.168.1.1

ping -c4 ${TESTIP} > /dev/null

if [ $? != 0 ]
then
    logger -t $0 "WiFi seems down, restarting"
    sudo /sbin/ifdown --force wlan0
    sleep 10
    sudo /sbin/ifup wlan0
else
    logger -t $0 "WiFi seems up."
fi
...which I should note had to be made executable (sudo chmod ug+x testwifi.sh

Having done this, I can now force the wireless down (using sudo /sbin/ifdown --force wlan0 and when the cron next runs it will re-establish.

While I agree that having the wifi not drop at all would be great, I think that is unrealistic. From your logs you can see that it only takes 15seconds of wifi outage for the RPi to give up completely and require a reboot, or reinsert of the USB. That's crazy.

(it should be noted that most of the above was taken from the links in my previous post)

pi_naut
Posts: 1
Joined: Sat Nov 09, 2013 2:40 pm

Re: Wifi dropping (using Edimax EW-7811UN)

Sat Nov 09, 2013 3:30 pm

I have two nearly identical Pi's. Both are model B, both run Raspian, both have the element14 Wi-Pi module, and both periodically drop their wireless connection. Connectivity can be restored by issuing "sudo /sbin/ifup wlan0", but, of course, that requires that you either have a monitor and keyboard connected or can get to a terminal through the wired ethernet interface. The previous poster's suggestions for handling these periodic outages seem like solid approaches for working around the problem. I am posting here to document that the Wi-Pi module exhibits the pathology being discussed in this thread and to offer my observations on my instance of the issue.

A previous poster mentioned seeing interesting output concerning the wireless module in /var/log/syslog, but for some reason I don't see anything there of interest on my system. On my Pi's, the interesting debug information seems to be in /var/log/kern.log. This information can also be viewed using the "dmesg" command but the output has human-readable timestamps if viewed in kern.log. Here is the tail end of my kern.log:
  • Oct 25 01:36:07 yarpi kernel: [129338.341333] cfg80211: Calling CRDA to update world regulatory domain
    Oct 25 01:36:08 yarpi kernel: [129339.882053] wlan0: authenticate with 20:aa:4b:8a:6d:12
    Oct 25 01:36:09 yarpi kernel: [129339.967510] wlan0: send auth to 20:aa:4b:8a:6d:12 (try 1/3)
    Oct 25 01:36:09 yarpi kernel: [129339.969287] wlan0: authenticated
    Oct 25 01:36:09 yarpi kernel: [129340.006911] wlan0: associate with 20:aa:4b:8a:6d:12 (try 1/3)
    Oct 25 01:36:09 yarpi kernel: [129340.010540] wlan0: RX AssocResp from 20:aa:4b:8a:6d:12 (capab=0x411 status=0 aid=1)
    Oct 25 01:36:09 yarpi kernel: [129340.026501] wlan0: associated
    Oct 25 01:38:07 yarpi kernel: [129458.343875] cfg80211: Calling CRDA for country: US
    Oct 25 01:38:08 yarpi kernel: [129459.885993] wlan0: authenticate with 20:aa:4b:8a:6d:12
    Oct 25 01:38:09 yarpi kernel: [129459.972314] wlan0: send auth to 20:aa:4b:8a:6d:12 (try 1/3)
    Oct 25 01:38:09 yarpi kernel: [129459.974099] wlan0: authenticated
    Oct 25 01:38:09 yarpi kernel: [129460.011620] wlan0: associate with 20:aa:4b:8a:6d:12 (try 1/3)
    Oct 25 01:38:09 yarpi kernel: [129460.036205] wlan0: RX AssocResp from 20:aa:4b:8a:6d:12 (capab=0x411 status=0 aid=1)
    Oct 25 01:38:09 yarpi kernel: [129460.052427] wlan0: associated
    Oct 25 01:50:07 yarpi kernel: [130178.374262] cfg80211: Calling CRDA to update world regulatory domain
    Oct 25 01:50:08 yarpi kernel: [130179.914817] wlan0: authenticate with 20:aa:4b:8a:6d:12
    Oct 25 01:50:09 yarpi kernel: [130180.000504] wlan0: send auth to 20:aa:4b:8a:6d:12 (try 1/3)
    Oct 25 01:50:09 yarpi kernel: [130180.004490] wlan0: authenticated
    Oct 25 01:50:09 yarpi kernel: [130180.049818] wlan0: associate with 20:aa:4b:8a:6d:12 (try 1/3)
    Oct 25 01:50:09 yarpi kernel: [130180.071560] wlan0: RX AssocResp from 20:aa:4b:8a:6d:12 (capab=0x411 status=0 aid=1)
    Oct 25 01:50:09 yarpi kernel: [130180.086937] wlan0: associated
    Oct 25 02:35:07 yarpi kernel: [132878.559322] cfg80211: Calling CRDA to update world regulatory domain
There are periodic "cfg80211: Calling ..." lines followed by "wlan0:" lines. This pattern repeats until the failure occurs and then you see that no "wlan0" lines appear after the last "cfg80211: Calling CRDA ..." line.

An "ifconfig" command issued when the Pi is in the failed state shows that the wlan0 interface has lost its IP address:
  • sweber@yarpi ~ $ /sbin/ifconfig
    eth0 Link encap:Ethernet HWaddr b8:27:eb:f3:75:b8
    inet addr:192.168.76.144 Bcast:192.168.76.255 Mask:255.255.255.0
    UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
    RX packets:9946 errors:0 dropped:0 overruns:0 frame:0
    TX packets:159 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:600768 (586.6 KiB) TX bytes:20458 (19.9 KiB)

    lo Link encap:Local Loopback
    inet addr:127.0.0.1 Mask:255.0.0.0
    UP LOOPBACK RUNNING MTU:16436 Metric:1
    RX packets:1 errors:0 dropped:0 overruns:0 frame:0
    TX packets:1 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:0
    RX bytes:104 (104.0 B) TX bytes:104 (104.0 B)

    wlan0 Link encap:Ethernet HWaddr 00:0f:13:30:1b:29
    UP BROADCAST MULTICAST MTU:1500 Metric:1
    RX packets:54641 errors:0 dropped:0 overruns:0 frame:0
    TX packets:499 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:4422911 (4.2 MiB) TX bytes:50072 (48.8 KiB)
I would be interested in hear if anyone has ideas about how to probe deeper into this problem. Since the issue is trivially reproducible with my devices, it should be possible to do some decent science to determine the root cause.

I don't believe this problem is power related since I see the same issue when the Wi-Pi modules are plugged into a powered USB hub. I currently have both Pi's configured with the modules plugged directly into one of the Pi's USB connectors and both Pi's are powered from the recommended USB power supplies.

Since I see the same problem with both Pi's, I don't suspect a hardware problem either.

PLCGuy
Posts: 22
Joined: Sat Aug 10, 2013 12:01 pm

Re: Wifi dropping (using Edimax EW-7811UN)

Sat Nov 09, 2013 9:25 pm

Firstly, let me say that I really don't know what I am talking about.

...but from your log, it looks to me simply like your wireless is dropping as was mine, and the OP's. I think the total lack of an antenna (on my adapter at least) makes it really vulnerable to noise and signal loss.

What I think your log is saying is that:

The kernel is doing a CRDA check (Which I believe lets it decide what frequencies should be enabled in the WiFi)
It is finding your access point.
It successfully authenticates with the AP.
It then associates with the AP.

...as far as I could tell on my system, that's the usual logging for joining a wifi network. Do you have any info that would make you think it isn't simply a signal-related disconnect?

again, I'm basically guessing with all this.

Return to “Networking and servers”