# Wireless auto reconnect with baselayout (Somewhat SOLVED)

## msalerno

net-wireless/wpa_supplicant-0.5.7

net-wireless/madwifi-ng-0.9.3-r2 

sys-apps/baselayout-1.12.9-r2

I recently upgraded my router firmware to X-wrt, but for some reason my linux box disconnects at random times.  I can get it to re-connect by trying to ping something on the internet, but that does me no good when I am at work trying to access my system at home.  I have read through the forums and read posts stating that I can do it with baselayout, but I have not found any instructions.  I know I could setup a cron job to take care of it, but if there is a mechanism already in place, I would prefer to use it.

Does anyone have any tips?

Thanks

/etc/wpa_supplicant.conf

```
ctrl_interface=/var/run/wpa_supplicant

ctrl_interface_group=0

eapol_version=1

fast_reauth=1

network={

        ssid="FatYogi"

        scan_ssid=1

        proto=WPA2

        key_mgmt=WPA-PSK

        psk="D95B4BC374CC1B51F11F1B4D81"

        priority=2

}

```

/etc/conf.d/net

```
config_ath0=( "192.168.10.5 netmask 255.255.255.0" )

modules=( "wpa_supplicant" )

wpa_timeout_ath0=60

wpa_supplicant_ath0="-Dmadwifi"

associate_timeout_ath0=90

routes_ath0=( "default gw 192.168.10.1" )

```

Last edited by msalerno on Mon Jun 04, 2007 2:44 pm; edited 1 time in total

----------

## msalerno

Bump

----------

## UberLord

 *msalerno wrote:*   

> I have read through the forums and read posts stating that I can do it with baselayout

 

Really? I maintain baselayout and have no idea how you would do that?

Why not setup a cron job to ping every few minutes?

----------

## msalerno

Sorry, I thought that I remembered reading a thread that pointed someone in the direction of baselayout.  

I searched again and I found a few posts from you that state:

wpa_supplicant with baselayout-1.12 will do this

baselayout-1.12.0 supports wpa_supplicant-0.4.x re-associating and bringing the network back up.

So the function of reconnecting would be coming from wpa_supplicant, and not baselayout.  So does wpa_supplicant automatically reconnect?  If now, how do I enable it?

I have no problem setting up the cron job, but if the functionality of reconnecting is already in place but not being used, I would rather enable it than setup the job.

As always, thanks for the help UberLord.

----------

## UberLord

It's wpa_supplicant that handles that, not baselayout. And wpa_supplicant is only has good as the driver underneath it. So if the driver thinks it's associated and all is good, wpa_supplicant won't do much.

I'd try the cron job and seeing if that helps. If so, open a driver bug for madwifi.

----------

## msalerno

Thanks for the info, I'll go with the cron job.

----------

## msalerno

Just as a follow up I added the following to the root crontab:

0,10,20,30,40,50 * * * * /bin/wpa_cli scan

and in my wpa_supplicant (although I believe it's the default value anyway)

ap_scan=1

Everything seems to be running fine now.

----------

