You are not logged in.

#1 2008-11-24 15:28:26

ikaruga
Member
Registered: 2007-12-31
Posts: 10

Keep wifi connection alive

Hi. I've noticed that after moving from opensuse to arch, my wifi connection dies on me after inactivity. I've tried this workaround:

* Add a crontab to ping a website every 15 minutes. I'm using this command:
* ping -c 4 www.google.com

However, the connection still dies. Is there a better way to keep my connection alive? Perhaps if I increase the number of packets?

Offline

#2 2008-11-24 15:37:40

thomasknowles
Member
From: England
Registered: 2008-11-23
Posts: 38

Re: Keep wifi connection alive

Do you experince this on other routers and/or operating systems?

Offline

#3 2008-11-24 17:15:21

ikaruga
Member
Registered: 2007-12-31
Posts: 10

Re: Keep wifi connection alive

No, only on my desktop running arch. Wifi ran fine before on the same setup before using suse (same hardware, same router, etc.).

Not ripping arch here, just trying to find a workaround.

Offline

#4 2008-11-25 17:47:44

ikaruga
Member
Registered: 2007-12-31
Posts: 10

Re: Keep wifi connection alive

As per this ubuntu forum post, I found something that might do the trick

http://ubuntuforums.org/showthread.php?t=420959

Adapted to arch, this may work:

#!/bin/sh

HOST=www.google.com
ping -c 1 -W 10 $HOST &>/dev/null
if  [ $? -eq 0 ]; then
        #ping is ok
        exit
else
        #first try
        ifconfig wlan0 down
        sleep 3
        ifconfig wlan0 up
        sleep 10
        ping -c 1 -W 10 $HOST &>/dev/null
        if  [ $? -eq 0 ]; then
                exit
        else
                #second try
                /etc/rc.d/wlan restart
                /etc/rc.d/network restart
                iwconfig wlan0 essid NOAH_S_ARK
                sleep 10
                ping -c 1 -W 10 $HOST &>/dev/null
        fi
fi

The corresponding root crontab entry to run it every 20 minutes is

*/20 * * * * <nameofscript>

Gonna try when I get home.

Offline

#5 2008-11-25 18:01:41

xdeusx
Member
Registered: 2007-10-15
Posts: 168

Re: Keep wifi connection alive

Well you could always connect manually, for instance by using wpa_supplicant. And if the disconnect occurs, just look at the output...

Offline

Board footer

Powered by FluxBB