You are not logged in.

#1 2010-04-04 16:55:12

Anton
Member
From: Lund, Sweden
Registered: 2009-12-12
Posts: 17

Wireless connection drops and doesn't reconnect (netcfg, wpa_actiond)

I use netcfg 2.5.4-1 and wpa_actiond 1.1-1, B43 driver (BCM4318 wireless card) with firmware.

$ uname -a
Linux vekta 2.6.32-ARCH #1 SMP PREEMPT Mon Mar 15 20:08:25 UTC 2010 i686 Mobile AMD Sempron(tm) Processor 3100+ AuthenticAMD GNU/Linux

Connecting works fine. I can connect using sudo netcfg <profile>, or it automatically connects me on startup.
However, after a few minutes (up to 15 at best, usually 3-5) the connection is dropped. dmesg prints:
"No probe response from AP <macaddress> after 500ms, disconnecting."

However, netcfg isn't notified of this event, and still thinks the profile is connected. So I have to use netcfg -r <profile> to reconnect. Isn't netcfg supposed to notice this connection drop and try to reconnect again automatically?

Also, is there any way to increase the 500ms threshold mentioned in the log? I don't think I ever had this problem when I first installed arch in november/december last year.

Thank you.

Offline

#2 2010-04-04 17:20:26

Moo-Crumpus
Member
From: Hessen / Germany
Registered: 2003-12-01
Posts: 1,487

Re: Wireless connection drops and doesn't reconnect (netcfg, wpa_actiond)

For the first question, you may add a cronjob that calls a script like

#!/bin/bash

iwconfig > /tmp/iwconfig_stat
while grep "unassociated" "/tmp/iwconfig_stat" > /dev/null; do
    /etc/rc.d/net-auto-wireless restart
    sleep 5
    iwconfig > /tmp/iwconfig_stat
done
rm /tmp/iwconfig_stat
echo 0

Frumpus addict
[mu'.krum.pus], [frum.pus]

Offline

#3 2010-04-11 09:58:06

Anton
Member
From: Lund, Sweden
Registered: 2009-12-12
Posts: 17

Re: Wireless connection drops and doesn't reconnect (netcfg, wpa_actiond)

Thank you!

I made a small modification in netcfg, so that it automatically reconnects on lost connection. It could already detect this with the help of wpa_actiond, but it didn't do anything. This works for me. I did clone the git repo and committed my addition to a separate branch, so if anyone is interested I should be able to generate a patch. It might be a bit messy though as I'm new to shell scripting in Linux.

Offline

#4 2010-04-18 21:53:33

geniuz
Member
Registered: 2010-04-10
Posts: 127

Re: Wireless connection drops and doesn't reconnect (netcfg, wpa_actiond)

Hey,

I'm having this sort of problem with my Broadcom wireless card, in my case however the connection seems to drop after a period of inactivity. What you have done might solve my problem. So exactly what modification have you made in netcfg ?

Offline

#5 2010-04-18 23:47:23

Profjim
Member
From: NYC
Registered: 2008-03-24
Posts: 658

Re: Wireless connection drops and doesn't reconnect (netcfg, wpa_actiond)

geniuz wrote:

I'm having this sort of problem with my Broadcom wireless card, in my case however the connection seems to drop after a period of inactivity.

Why don't you make a script that checks for a network, if it's up sends a single ping to www.google.com or some other site you know to be always available and a fast responder. Have cron run the script every five minutes or so. I would myself just have the script do nothing if the network was down.

Offline

#6 2010-04-19 08:34:52

geniuz
Member
Registered: 2010-04-10
Posts: 127

Re: Wireless connection drops and doesn't reconnect (netcfg, wpa_actiond)

That sounds like a good idea, I'm however not so sure whether my network actually drops after a period of network inactivity or just simply if I don't touch my laptop long enough (ACPI takes over...). These kind of problems are generally hard to debug. In any way I could try both approaches and see which one works better.

Thanks !

Offline

#7 2010-04-19 09:53:44

skanky
Member
From: WAIS
Registered: 2009-10-23
Posts: 1,847

Re: Wireless connection drops and doesn't reconnect (netcfg, wpa_actiond)

Are you using power saving with your wireless card (eg through laptop-mode)? If so, it might be worth turning that off and seeing what happens.
Long shot I know, but the "after period of inactivity" suggests something along those lines.


"...one cannot be angry when one looks at a penguin."  - John Ruskin
"Life in general is a bit shit, and so too is the internet. And that's all there is." - scepticisle

Offline

#8 2010-04-19 14:56:11

geniuz
Member
Registered: 2010-04-10
Posts: 127

Re: Wireless connection drops and doesn't reconnect (netcfg, wpa_actiond)

I honestly have no idea if its enabled, I just read the manpage for iwconfig and turned it off using:

iwconfig eth0 power off

I'm gonna leave my laptop alone for a while and see whether it helps...on question though, will this change be permanent ?

Last edited by geniuz (2010-04-19 15:03:19)

Offline

#9 2010-04-19 17:03:27

skanky
Member
From: WAIS
Registered: 2009-10-23
Posts: 1,847

Re: Wireless connection drops and doesn't reconnect (netcfg, wpa_actiond)

Depends I guess. I have a an Intel wireless card, so things may well be very different.

If you don't explicitly enable it, the only other way I know of to do so, is via laptop mode tools. The power saving there can be done on a global basis, or on a module by module one. If you're using it, firstly check /etc/laptop-mode/laptop-mode.conf for global and then any wireless confs under /etc/laptop-mode/conf.d as specified in the first conf file.

also

iwpriv eth0

will tell you if there are any private settings that may be (being) used - that's what my laptop-mode tools uses (I don't know how much it varies with hardware differences).

If that command works, you could put it in rc.local.


"...one cannot be angry when one looks at a penguin."  - John Ruskin
"Life in general is a bit shit, and so too is the internet. And that's all there is." - scepticisle

Offline

#10 2010-04-19 22:15:53

geniuz
Member
Registered: 2010-04-10
Posts: 127

Re: Wireless connection drops and doesn't reconnect (netcfg, wpa_actiond)

Hmm...laptop-mode looks interesting, however I'm seeing there are some issues its causing with HD's spinning up/down too often ?
Anyway, I've temporarily installed it and checked the config files, there's no way for me to set power management for my wireless card in laptop-mode. I'm quite reluctant to use it however until I figure this HD issue out.

But I can tell that my laptop is running for about 7.5 hours now without losing connection. Which I find strange since according to one of my previous threads: http://bbs.archlinux.org/viewtopic.php?id=95369 which shows the output of iwconfig right after I lost a connection says power management is off for my wireless.

Anyway I have a script ready to be set up with a cron job in case the problem comes back to keep/bring my connection to life when this happens again.

Offline

#11 2010-04-20 08:33:30

skanky
Member
From: WAIS
Registered: 2009-10-23
Posts: 1,847

Re: Wireless connection drops and doesn't reconnect (netcfg, wpa_actiond)

You can disable the HD control under laptop-mode - though it does reduce the effectiveness. I think it depends on how you use the laptop as to whether it's worth turning on. It is something I mean to look into but 90% of the time my machine is plugged in. Thanks for the heads-up though, I've added it to my todo list. smile


"...one cannot be angry when one looks at a penguin."  - John Ruskin
"Life in general is a bit shit, and so too is the internet. And that's all there is." - scepticisle

Offline

#12 2010-04-20 08:55:21

geniuz
Member
Registered: 2010-04-10
Posts: 127

Re: Wireless connection drops and doesn't reconnect (netcfg, wpa_actiond)

Yea well...my laptop is usually plugged in too, just in rare occasions where I need to quickly search something online while I'm away. I've found that laptop-mode didn't really work for me since it didn't adjust anything very usefull. The HD stuff seems dangerous and I'd rather leave that to the default settings, so that leaves only CPU control which I now regulate using cpufreq. I still get ~4-5 hours of battery life which is better than OSX.

Offline

#13 2010-05-09 13:19:22

Anton
Member
From: Lund, Sweden
Registered: 2009-12-12
Posts: 17

Re: Wireless connection drops and doesn't reconnect (netcfg, wpa_actiond)

geniuz wrote:

Hey,

I'm having this sort of problem with my Broadcom wireless card, in my case however the connection seems to drop after a period of inactivity. What you have done might solve my problem. So exactly what modification have you made in netcfg ?

This is the patch I made;

diff --git a/src/globals b/src/globals
index 2d5cf19..dcffea3 100644
--- a/src/globals
+++ b/src/globals
@@ -15,7 +15,7 @@ SUBR_DIR="/usr/lib/network/"
HOOKS_DIR="${SUBR_DIR}/hooks/"
CONN_DIR="${SUBR_DIR}/connections/"
STATE_DIR="/var/run/network/"
-
+AUTOWIRELESS_DIR="/etc/rc.d/"


### Logging/Error reporting
diff --git a/wpa_actiond/netcfg-wpa_actiond-action b/wpa_actiond/netcfg-wpa_actiond-action
index 3547fef..324d990 100755
--- a/wpa_actiond/netcfg-wpa_actiond-action
+++ b/wpa_actiond/netcfg-wpa_actiond-action
@@ -42,7 +42,12 @@ case $action in
         fi
         set_profile down "$profile"
         ;;
-    LOST|REESTABLISHED)
+    LOST)
+        if ! "$AUTOWIRELESS_DIR/net-auto-wireless" restart; then
+            exit 1
+        fi
+        ;;
+    REESTABLISHED)
         # Not handled.
         exit 0
         ;;

Offline

Board footer

Powered by FluxBB