# madwifi atheos card cannot associate with AP[solved]

## jhow

SOLVED

A stupid mistake on my part. My access point enforced mac address acls by default but obviously with no mac addresses listed in it. It worked fine once I added my mac address  :Embarassed: 

There were other issues in getting it started so I may as well describe the additional things I did.

I have kernel 2.6.16-r7

I used 

madwifi-old

madwifi-old-tools

The UNMASKED current version of wpa_supplicant 4.8

The UNMASKED current version of baselayout

in wpa_supplicant.conf I set 

ap_scan=0

bssid=###########

in /etc/conf.d/net I added

iwconfig_ath0="mode managed"

then I ran

/etc/init.d/net.ath0 start

and everything worked!!!

also dont forget to remerge wpa_supplicant any time you emerge madwifi packages!! 

Hi I am having problems with my Netgear WG311T Wireless PCI connecting to my access point.

There are no error messages in kernel log and everything seems to working except I cannot associate with my access point.

I can scan and get a list of the access points available using wpa_gui or iwlist ath0 scan

I have tried wpa_supplicant,wireless tool ( WPA WEP and plain text ). 

The consistient problem using all these tools has been my inability to assocoate with the access point.

My installed packages are

wireless-tools-28

madwifi-ng-0.1531.20060427

madwifi-ng-tools-0.1531.20060427

baselayout-1.11.14-r8

Associated configuration files

/etc/wpa_supplicant.conf:

network={

ssid="wirelesspoint"

psk=##############################

}

/etc/conf.d/net:

modules=( "wpa_supplicant" )

iwconfig_ath0="mode managed"

wpa_supplicant_ath0="-Dmadwifi"

wpa_timeout_ath0=60

sleep_associate_ath0="10"

lspci -v returns:

```

02:0c.0 Ethernet controller: Atheros Communications, Inc. AR5212 802.11abg NIC (rev 01)

        Subsystem: Netgear Netgear WG311T Wireless PCI Adapter

        Flags: bus master, medium devsel, latency 168, IRQ 201

        Memory at fbfe0000 (32-bit, non-prefetchable) [size=64K]

        Capabilities: [44] Power Management version 2

```

relevant dmesg returns 

```

ath_hal: module license 'Proprietary' taints kernel.

ath_hal: 0.9.16.16 (AR5210, AR5211, AR5212, RF5111, RF5112, RF2413, RF5413)

wlan: 0.8.4.2 (svn 1531)

wlan: mac acl policy registered

ath_rate_sample: 1.2 (svn 1531)

ath_pci: 0.9.4.5 (svn 1531)

ACPI: PCI Interrupt 0000:02:0c.0[A] -> GSI 20 (level, low) -> IRQ 201

wifi0: 11b rates: 1Mbps 2Mbps 5.5Mbps 11Mbps

wifi0: 11g rates: 1Mbps 2Mbps 5.5Mbps 11Mbps 6Mbps 9Mbps 12Mbps 18Mbps 24Mbps 36Mbps 48Mbps 54Mbps

wifi0: turboG rates: 6Mbps 12Mbps 18Mbps 24Mbps 36Mbps 48Mbps 54Mbps

wifi0: H/W encryption support: WEP AES AES_CCM TKIP

wifi0: mac 5.9 phy 4.3 radio 4.6

wifi0: Use hw queue 1 for WME_AC_BE traffic

wifi0: Use hw queue 0 for WME_AC_BK traffic

wifi0: Use hw queue 2 for WME_AC_VI traffic

wifi0: Use hw queue 3 for WME_AC_VO traffic

wifi0: Use hw queue 8 for CAB traffic

wifi0: Use hw queue 9 for beacons

wifi0: Atheros 5212: mem=0xfbfe0000, irq=201

```

running wpa_supplicant returns

```

wpa_supplicant -w -Dmadwifi -iath0 -c/etc/wpa_supplicant.conf -dd 

Initializing interface 'ath0' conf '/etc/wpa_supplicant.conf' driver 'madwifi' ctrl_interface 'N/A' bridge 'N/A'

Configuration file '/etc/wpa_supplicant.conf' -> '/etc/wpa_supplicant.conf'

Reading configuration file '/etc/wpa_supplicant.conf'

ctrl_interface='/var/run/wpa_supplicant'

ctrl_interface_group=0

eapol_version=1

ap_scan=2

fast_reauth=1

Line: 361 - start of a new network block

ssid - hexdump_ascii(len=13):

     77 69 72 65 6c 65 73 73 70 6f 69 6e 74            wirelesspoint

PSK - hexdump(len=32): [REMOVED]

Priority group 0

   id=0 ssid='wirelesspoint'

Initializing interface (2) 'ath0'

EAPOL: SUPP_PAE entering state DISCONNECTED

EAPOL: KEY_RX entering state NO_KEY_RECEIVE

EAPOL: SUPP_BE entering state INITIALIZE

EAP: EAP entering state DISABLED

EAPOL: External notification - portEnabled=0

EAPOL: External notification - portValid=0

SIOCGIWRANGE: WE(compiled)=19 WE(source)=13 enc_capa=0xf

  capabilities: key_mgmt 0xf enc 0xf

WEXT: Operstate: linkmode=1, operstate=5

Own MAC address: 00:0f:b5:22:35:4b

wpa_driver_madwifi_del_key: keyidx=0

wpa_driver_madwifi_del_key: keyidx=1

wpa_driver_madwifi_del_key: keyidx=2

wpa_driver_madwifi_del_key: keyidx=3

wpa_driver_madwifi_set_countermeasures: enabled=0

wpa_driver_madwifi_set_drop_unencrypted: enabled=1

Setting scan request: 0 sec 100000 usec

Added interface ath0

Wireless event: cmd=0x8b06 len=8

Ignore event for foreign ifindex 2

RTM_NEWLINK, IFLA_IFNAME: Interface 'ath0' added

RTM_NEWLINK, IFLA_IFNAME: Interface 'ath0' added

State: DISCONNECTED -> SCANNING

Trying to associate with SSID 'wirelesspoint'

Cancelling scan request

WPA: clearing own WPA/RSN IE

Automatic auth_alg selection: 0x1

WPA: No WPA/RSN IE available from association info

WPA: Set cipher suites based on configuration

WPA: Selected cipher suites: group 30 pairwise 24 key_mgmt 3

WPA: clearing AP WPA IE

WPA: clearing AP RSN IE

WPA: using GTK CCMP

WPA: using PTK CCMP

WPA: using KEY_MGMT 802.1X

WPA: Set own WPA IE default - hexdump(len=22): 30 14 01 00 00 0f ac 04 01 00 00 0f ac 04 01 00 00 0f ac 01 00 00

No keys have been configured - skip key clearing

wpa_driver_madwifi_set_drop_unencrypted: enabled=1

State: SCANNING -> ASSOCIATING

WEXT: Operstate: linkmode=-1, operstate=5

wpa_driver_madwifi_associate

Setting authentication timeout: 60 sec 0 usec

EAPOL: External notification - portControl=Auto

Wireless event: cmd=0x8b1a len=22

Wireless event: cmd=0x8b19 len=8

Received 1304 bytes of scan results (6 BSSes)

Scan results: 6

Authentication with 00:00:00:00:00:00 timed out.

Added BSSID 00:00:00:00:00:00 into blacklist

State: ASSOCIATING -> DISCONNECTED

WEXT: Operstate: linkmode=-1, operstate=5

No keys have been configured - skip key clearing

EAPOL: External notification - portEnabled=0

EAPOL: External notification - portValid=0

Setting scan request: 0 sec 0 usec

State: DISCONNECTED -> SCANNING

Trying to associate with SSID 'wirelesspoint'

Cancelling scan request

WPA: clearing own WPA/RSN IE

Automatic auth_alg selection: 0x1

WPA: No WPA/RSN IE available from association info

WPA: Set cipher suites based on configuration

WPA: Selected cipher suites: group 30 pairwise 24 key_mgmt 3

WPA: clearing AP WPA IE

WPA: clearing AP RSN IE

WPA: using GTK CCMP

WPA: using PTK CCMP

WPA: using KEY_MGMT 802.1X

WPA: Set own WPA IE default - hexdump(len=22): 30 14 01 00 00 0f ac 04 01 00 00 0f ac 04 01 00 00 0f ac 01 00 00

No keys have been configured - skip key clearing

wpa_driver_madwifi_set_drop_unencrypted: enabled=1

State: SCANNING -> ASSOCIATING

WEXT: Operstate: linkmode=-1, operstate=5

wpa_driver_madwifi_associate

Setting authentication timeout: 60 sec 0 usec

EAPOL: External notification - portControl=Auto

Wireless event: cmd=0x8b1a len=22

```

then 

```

iwconfig

ath0      IEEE 802.11g  ESSID:"wirelesspoint"

          Mode:Managed  Frequency:2.462 GHz  Access Point: Not-Associated

          Bit Rate:1 Mb/s   Tx-Power:15 dBm   Sensitivity=0/3

          Retry:off   RTS thr:off   Fragment thr:off

          Encryption key:off

          Power Management:off

          Link Quality=94/94  Signal level=-1 dBm  Noise level=-95 dBm

          Rx invalid nwid:3814  Rx invalid crypt:0  Rx invalid frag:0

          Tx excessive retries:0  Invalid misc:0   Missed beacon:0

```

trying

```

/etc/init.d/net.ath0 start

 * Starting ath0

 *   Starting wpa_supplicant on ath0  [ ok ]

 *     timed out

```

then using WEP (wireless tools ) instead of WPA

```

iwconfig ath0 essid wirelesspoint key mykey

```

then

```

iwconfig

ath0      IEEE 802.11g  ESSID:"wirelesspoint"

          Mode:Managed  Frequency:2.462 GHz  Access Point: Not-Associated

          Bit Rate:1 Mb/s   Tx-Power:15 dBm   Sensitivity=0/3

          Retry:off   RTS thr:off   Fragment thr:off

          Encryption key:off

          Power Management:off

          Link Quality=94/94  Signal level=-1 dBm  Noise level=-95 dBm

          Rx invalid nwid:3814  Rx invalid crypt:0  Rx invalid frag:0

          Tx excessive retries:0  Invalid misc:0   Missed beacon:0

```

then I tried no encryption

```

iwconfig ath0 essid wirelesspoint

```

and

```

 /etc/init.d/net.ath0 start

 * Starting ath0

 *   Configuring wireless network for ath0

 *   Couldn't associate with any access points on ath0

 *   Failed to configure wireless for ath0        

```

I have tried so many different ways and read so many posts that I am losing track of what I have done  :Embarassed: 

I can no longer see the forest for the trees.

Is there anything obvious that I have missed?

Any help would be greatly appreciated

Jason

----------

## jcopper

How did you create ath0 so that you can add it rc-update default so that it starts on boot

----------

## jhow

I am racking my brain.... I believe it was created automatically when I emerge all the packages I listed at the top.

I just did the following

rc-update add net.ath0 default

but check out this

http://gentoo-wiki.com/HOWTO_Wireless_Configuration_and_Startup

and this 

http://madwifi.org/wiki/UserDocs/FirstTimeHowTo

The last link has some useful tips in it.

Hope this helps

----------

## opopanax

you've most likely got to create the symlink:

```

cd /etc/init.d/

ln -s net.lo net.ath0

```

----------

