# [partly SOLVED] madwifi - could not associate

## herrzattacke

Hi,

I've tried the madwifi-old and madwifi-ng ebuilds but none of them is able to connect to a unencrpted network.

No errors in dmesg or /var/log so i got no clue.

I'm totally f***ed up.

I've also tried to set up the essid, MAC-Adress and channel with iwconfig but the link quality stays at 0/94.

The card ist working with windose so there is no Hardware bug.

any help apreciated.

regards

   HerrZattackeLast edited by herrzattacke on Thu May 11, 2006 2:22 pm; edited 2 times in total

----------

## TheRAt

What wireless card ?

Also, I am assuming that you are able to connect to an encrypted network, ie you are getting some connection in linux with that card ?

What version of madwifi-ng and base-layout?

----------

## herrzattacke

 *Quote:*   

> 
> 
> What wireless card ? 
> 
> 

 

it is a IBM T43p with a atheros mini-PCI card.

```

lspci |grep -i atheros

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

```

 *Quote:*   

> Also, I am assuming that you are able to connect to an encrypted network, ie you are getting some connection in linux with that card ? 

 

no never tried any encryption ... at home I'm wired ... i only need it at university where the whole campus has a wireless network.

versions:

```
madwifi-ng-0.1443.20060207 

baselayout-1.11.14-r8 
```

btw: i had this card working with gentoo but then i got to reinstall due to HDD crash ;(

so I had used the madwifi-driver ebuild (before namespace change) and it worked flawlessly

regards

HerrZattacke

----------

## TheRAt

You might like to try a more recent baselayout, and/or madwifi-ng

I am running :

```
* net-wireless/madwifi-ng 

     Available versions:  0.1401.20060117 0.1420.20060201 0.1440.20060206 0.1443.20060207 0.1473.20060312 0.1485.20060325 0.1502.20060414 0.1531.20060427

     Installed:           0.1531.20060427

     Homepage:            http://www.madwifi.org/

     Description:         Next Generation driver for Atheros based IEEE 802.11a/b/g wireless LAN cards

* sys-apps/baselayout 

     Available versions:  1.11.13-r2 1.11.14-r8 1.11.15-r1 1.11.15-r3 1.12.0_pre18-r1 1.12.0_pre19 1.12.0_pre19-r2

     Installed:           1.12.0_pre19-r1

     Homepage:            http://www.gentoo.org/

     Description:         Filesystem baselayout and init scripts
```

and have the same wireless nic

```
0a:05.0 Ethernet controller: Atheros Communications, Inc. AR5212 802.11abg NIC (rev 01)
```

Working flawlessly here ...

----------

## herrzattacke

ok now ive canged to a recent ~x86 version of madwifi and baselayout ... that cleaned out some other issues (e.g. ifplugd) but wireless still does not work

now i've tried to set channel, essid, mode ... by hand

but as soon as the interface it put up it starts hopping channels.

no beacons no packets .... that's driving me mad...

I'm NOT new to gentoo, i'm using it for more than 3 years and i had never had such problems.

I'm using atheros cards for over a year now and again had never so much problems.

regards

----------

## mpytasz

Hi,

I laso have some wifi issues here on a desktop with atheros. Seems like a bug (in baselayout?) to me.

Here is the story:

in /etc/conf.d/wireless I have:

preferred_aps_ath0=( "DOM_MP" )

config_DOM_MP=( "10.10.4.20 netmask 255.255.255.0" )

routes_DOM_MP=( "default via 10.10.4.1" )

key_DOM_MP="somekey"

no wpa_supplicant here (for now).

When I run /etc/init.d/net.ath0 start I see:

 * Starting ath0

 *   Configuring wireless network for ath0

 *   WEP key is not set for "Dom" - not connecting

 *   Couldn't associate with any access points on ath0

 *   Failed to configure wireless for ath0                                                                                          [ !! ]

"Dom" seems like my neighbour's AP, I can see it with my laptop as well.

however if at first I try:

ifconfig ath0 up

the above has been mentioned in docs at madwifi.

I get a desired result with etc/init.d/net.ath0 start:

 * Starting ath0

 *   Configuring wireless network for ath0

 *     ath0 connected to ESSID "DOM_MP" at 00:4F:62:05:68:35

 *     in managed mode on channel 12 (WEP enabled - restricted)

 *   Bringing up ath0

 *     10.10.4.20                                                                                                                   [ ok ]

 *   Adding routes

 *     default via 10.10.4.1 ...  

The problem does not occur in my laptow with ipw2915 (ipw2200 driver), however wifi card is eth2 there (not ath).

Moreover I can see one more weird (to me) thing, another network interface appared - wlan0. Attempting to start it (instead of ath0) ends up with:

 * Starting wlan0

 *   Configuration not set for wlan0 - assuming DHCP

 *   No DHCP client installed                 

Laptop (where it all works fine) is x86 (~x86 keyword).

Desktop - with atheros problem is amd64, some details below.

# lspci

00:00.0 Host bridge: VIA Technologies, Inc. K8T800Pro Host Bridge

00:00.1 Host bridge: VIA Technologies, Inc. K8T800Pro Host Bridge

00:00.2 Host bridge: VIA Technologies, Inc. K8T800Pro Host Bridge

00:00.3 Host bridge: VIA Technologies, Inc. K8T800Pro Host Bridge

00:00.4 Host bridge: VIA Technologies, Inc. K8T800Pro Host Bridge

00:00.7 Host bridge: VIA Technologies, Inc. K8T800Pro Host Bridge

00:01.0 PCI bridge: VIA Technologies, Inc. VT8237 PCI bridge [K8T800/K8T890 South]

00:06.0 Ethernet controller: Atheros Communications, Inc. AR5212 802.11abg NIC (rev 01)

00:07.0 Multimedia video controller: Conexant CX23880/1/2/3 PCI Video and Audio Decoder (rev 03)

00:07.1 Multimedia controller: Conexant CX23880/1/2/3 PCI Video and Audio Decoder [Audio Port] (rev 03)

00:0b.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8169 Gigabit Ethernet (rev 10)

00:0f.0 IDE interface: VIA Technologies, Inc. VT82C586A/B/VT82C686/A/B/VT823x/A/C PIPC Bus Master IDE (rev 06)

00:10.0 USB Controller: VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1 Controller (rev 81)

00:10.1 USB Controller: VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1 Controller (rev 81)

00:10.2 USB Controller: VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1 Controller (rev 81)

00:10.3 USB Controller: VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1 Controller (rev 81)

00:10.4 USB Controller: VIA Technologies, Inc. USB 2.0 (rev 86)

00:11.0 ISA bridge: VIA Technologies, Inc. VT8237 ISA bridge [KT600/K8T800/K8T890 South]

00:11.5 Multimedia audio controller: VIA Technologies, Inc. VT8233/A/8235/8237 AC97 Audio Controller (rev 60)

00:18.0 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] HyperTransport Technology Configuration

00:18.1 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] Address Map

00:18.2 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] DRAM Controller

00:18.3 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] Miscellaneous Control

01:00.0 VGA compatible controller: ATI Technologies Inc RV350 AS [Radeon 9550]

01:00.1 Display controller: ATI Technologies Inc RV350 ?? [Radeon 9550] (Secondary)

# emerge --info

Portage 2.1_pre10-r2 (default-linux/amd64/2006.0, gcc-4.1.0, glibc-2.4-r2, 2.6.16-gentoo-r6 x86_64)

=================================================================

System uname: 2.6.16-gentoo-r6 x86_64 AMD Athlon(tm) 64 Processor 3200+

Gentoo Base System version 1.12.0_pre19

dev-lang/python:     2.3.5-r2, 2.4.3-r1

dev-util/ccache:     [Not Present]

dev-util/confcache:  [Not Present]

sys-apps/sandbox:    1.2.18

sys-devel/autoconf:  2.13, 2.59-r7

sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2

sys-devel/binutils:  2.16.1-r2

sys-devel/libtool:   1.5.22

virtual/os-headers:  2.6.16

ACCEPT_KEYWORDS="amd64 ~amd64"

AUTOCLEAN="yes"

CBUILD="x86_64-pc-linux-gnu"

CFLAGS="-O2 -march=athlon64 -pipe -ffast-math -fomit-frame-pointer"

CHOST="x86_64-pc-linux-gnu"

CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/kde/3/share/config /usr/share/X11/xkb /usr/share/config /var/qmail/control"

CONFIG_PROTECT_MASK="/etc/eselect/compiler /etc/gconf /etc/revdep-rebuild /etc/terminfo /etc/texmf/web2c /etc/env.d"

CXXFLAGS="-O2 -march=athlon64 -pipe -ffast-math -fomit-frame-pointer"

DISTDIR="/usr/portage/distfiles"

FEATURES="autoconfig distlocks metadata-transfer sfperms strict"

GENTOO_MIRRORS="http://gentoo.prz.rzeszow.pl/ http://gentoo.po.opole.pl"

LC_ALL="pl_PL"

LINGUAS="pl en"

MAKEOPTS="-j2"

PKGDIR="/usr/portage/packages"

PORTAGE_TMPDIR="/var/tmp"

PORTDIR="/usr/portage"

PORTDIR_OVERLAY="/usr/local/portage"

SYNC="rsync://rsync.gentoo.org/gentoo-portage"

USE="amd64 7zip X aac acpi alsa avi berkdb bitmap-fonts cli crypt cups dbus dri dvd dvdr eds emboss encode font-server foomaticdb fortran gif glx gpm gstreamer gtk gtk2 hal imlib ipv6 isdnlog jpeg jpeg2k kde kdeenablefinal lm_sensors logitech-mouse lzw lzw-tiff madwifi mp3 mpeg ncurses nls nptl nptlonly nsplugin oggvorbis opengl pam pcre pdflib perl png pppd python qt quicktime rdesktop readline reflection sdl session speedo spell spl ssl tcpd tiff truetype-fonts type1 type1-fonts usb v4l vorbis wifi xinerama xmms xorg xpm xprint xv xvid zlib elibc_glibc kernel_linux linguas_pl linguas_en userland_GNU video_cards_ati video_cards_none video_cards_radeon video_cards_-fglrx"

Unset:  ASFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LDFLAGS

In both cases (fully and not fully woring) I have the same gcc and baselayout.

Baselayout is 1.12.0_pre19-r2 (I can't see -r2 above, so writting it down here)

Let me know if any other information would be neccessary,

Regards, 

Michal

----------

## herrzattacke

i've experimented a while but had no luck...

now i sometimes can do a "iwlist ath0 scan" and get results and sometimes not .... very strange.

i'm getting mad with this

----------

## TheRAt

 *herrzattacke wrote:*   

> i've experimented a while but had no luck...
> 
> now i sometimes can do a "iwlist ath0 scan" and get results and sometimes not .... very strange.
> 
> i'm getting mad with this

 

Are you able to connect to encrypted networks ?

----------

## RoundsToZero

You should really try using wpa_supplicant for everything.  It can handle unencrypted and plain WEP just fine, in addition to its WPA and 802.1X features.  You can enable it in /etc/conf.d/net (you said you have been using Gentoo for a while so I'll spare you the details).

If you use that method with the net.ath0 initscript, you will need to dive right into configuring wpa_supplicant.conf for it to work.  However, if you run wpa_supplicant yourself from the command line, then bring the interface up manually (ifconfig ath0 up), you can then run wpa_gui to scan, configure, and connect to networks.  It is QT based, but I think it is well worth it if you don't want to have to write a config file just to connect to wireless.

In any case, the config file part in your case should be pretty simple since its unencrypted.  It looks like this:

```

network={

        ssid="123"

        key_mgmt=NONE

}

```

A plain WEP one would look like this:

```

network={

        ssid="xyz"

        key_mgmt=NONE

        wep_key0=xxxxxxxxxxxxxxxxxxxxxxxxxx

        wep_tx_keyidx=0

        auth_alg=OPEN

}

```

Anything higher than that is actually documented in the sample config file.

----------

## herrzattacke

i've managed it to get it working by hand, finally.

The initscript won't work

what i've done:

```

iwconfig ath0 essid WLAN mode managed channel <number> ap 00:DE:AD:BE:AF:00

ipconfig ath0 up

dhcpcd ath0

```

I've tried this before but it didn't work. after the 20th emerge of madwifi-old/ng now it works and i don't know why.

now i can try wpa_supplicant

regards

----------

## TheRAt

post results..

most strange..

also post your config files..

----------

## DaggyStyle

this problem is very similar to mine, cant find access point when running net.ath0 but can init using script/hand command

dagg

----------

## wildcart

I also have the problem of "not finding any access point" when running /etc/init.d/net.ath0. When I run the following commands by hand everything works fine:

```

ifconfig ath0 up

iwconfig ath0 channel 3

dhcpcd -d ath0

```

After playing around a little bit I could track down the problem to the madwifi-ng drivers. I then 'downgraded' to madwifi-old and everything works fine again. I know that it was working with the madwifi-ng driver before because I was wondering about the wlan0 device ifconfig displayed. I will probably be trying all versions of the madwifi-ng drivers sometime next week to see which version(s) 'breaks' net.ath0 for me.

----------

## dmitrio

I locked my card within the cannel by athchans command (see README file of the package madwifi-ng)

but still not sure is it correct way to do or not.

```
athchans -i ath0 6-6
```

----------

