You are not logged in.

#1 2011-02-15 14:34:06

maciejjo
Member
Registered: 2010-09-12
Posts: 21

iwconfig has to be run twice

I use TP-LINK TL-WN350GD with Atheros AR2417 chipset, and TP-LINK TD-8910G router. My card uses ath5k driver. When I start the system without network daemon, i have to run

iwconfig wlan0 essid my_essid key [1] s:my_key

twice in order to connect. Also had to configure my wi_up function in /etc/rc.d/network script, so it looks like that:

wi_up()
{
        eval iwcfg="\$wlan_${1}"
        [ "$iwcfg" = "" ] && return 0

        /sbin/ifconfig ${1} up
        /usr/sbin/iwconfig $iwcfg
        [[ -z "$WIRELESS_TIMEOUT" ]] && WIRELESS_TIMEOUT=5
        sleep $WIRELESS_TIMEOUT
        /usr/sbin/iwconfig $iwcfg

        bssid=`iwgetid $1 -ra`
        #bssid="00:19:E0:A2:F3:ED"
        #if [[ "$bssid" = "00:00:00:00:00:00" ]]; then
        #       printhl "Could not associate $1 - try increasing WIRELESS_TIMEOUT and check network is WEP or has no security"
        #       return 1
        #fi
        return 0
}

And that way it works. Dmesg says:

wlan0: authenticate with 00:19:e0:a2:f3:ed (try 1)
wlan0: 00:19:e0:a2:f3:ed denied authentication (status 13)
wlan0: authenticate with 00:19:e0:a2:f3:ed (try 1)
wlan0: authenticated
wlan0: associate with 00:19:e0:a2:f3:ed (try 1)
wlan0: RX AssocResp from 00:19:e0:a2:f3:ed (capab=0x431 status=0 aid=1)
wlan0: associated

I have no idea why this is happening.

Last edited by maciejjo (2011-02-15 14:34:42)

Offline

Board footer

Powered by FluxBB