# [solved by using ndiswrapper]weird wireless networking

## caslca

Hello and thanks for reading!

[update]

I ended up using ndiswrapper instead of madwifi-ng.

[/update]

I'm trying to setup my wireless G card to work. here's my setup:

router/AP: Linksys WRT300N

wirelessN card: Linksys WPN300N v1 via ndiswrapper

wirelessG card: Netgear RangeMax WPN511 via madwifi-ng drivers.

Router is setup with:

disabled broadcast,

mixed mode (G,N)

WEP encryption

The wireless N card works without any problems

The wireless G card, I setup with:

sudo /sbin/iwconfig ath0 essid my.essid.net

sudo /sbin/iwconfig ath0 key my_hex_key

sudo /sbin/ifconfig ath0 192.168.1.153

sudo /sbin/route add default gw 192.168.1.1

What happens is that the G card cannot associate with the AP. The weird portion of all this is that I can see the AP with iwlist:

~ $ iwlist ath0 scan

          Cell 04 - Address: SOME_HEX_ADDRESS

                    ESSID:"my.essid.net"

                    Mode:Master

                    Frequency:2.462 GHz (Channel 11)

                    Quality=43/94  Signal level=-52 dBm  Noise level=-95 dBm

                    Encryption key:on

                    Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 18 Mb/s

                              24 Mb/s; 36 Mb/s; 54 Mb/s; 6 Mb/s; 9 Mb/s

                              12 Mb/s; 48 Mb/s

                    Extra:bcn_int=50

ifconfig seems to report problems on the wifi0 interface ( I've no idea what this interface is):

wifi0     Link encap:UNSPEC  HWaddr 00-0F-B5-A9-0B-59-38-80-00-00-00-00-00-00-00-00

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:37108 errors:0 dropped:0 overruns:0 frame:340

          TX packets:32983 errors:18 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:199

          RX bytes:2058255 (1.9 Mb)  TX bytes:1122238 (1.0 Mb)

          Interrupt:5

iwconfig reports:

ath0      IEEE 802.11g  ESSID:"my.essid.net"  Nickname:""

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

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

          Retry:off   RTS thr:off   Fragment thr:off

          Power Management:off

          Link Quality=39/94  Signal level=-55 dBm  Noise level=-94 dBm

          Rx invalid nwid:3187  Rx invalid crypt:0  Rx invalid frag:0

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

What gives?Last edited by caslca on Mon Jun 04, 2007 5:54 am; edited 1 time in total

----------

## GivePeaceAChance

Have you tried something like:

```
iwconfig ath0 essid "YourSSID" nickname "[whatever you wanna call it]" key [1] 1234567890 open
```

where [1] is beside key, you would put the number of the key you set up (at least on my router setup, I can specify different keys, and specify which key to use at the current time) and 'open' is whether it's an open or shared key.

----------

## caslca

Thanks for the suggestion, but still no go:

```

lappy ~ # iwconfig ath0 essid caslca.net nickname "homeNet" key [1] 730CBA75F828A9C7832FBB8C82 restricted

lappy ~ # iwconfig

eth0      no wireless extensions.

lo        no wireless extensions.

wifi0     no wireless extensions.

ath0      IEEE 802.11b  ESSID:"caslca.net"  Nickname:"homeNet"

          Mode:Managed  Channel:0  Access Point: Not-Associated

          Bit Rate:0 kb/s   Tx-Power:0 dBm   Sensitivity=0/3

          Retry:off   RTS thr:off   Fragment thr:off

          Encryption key:730C-BA75-F828-A9C7-832F-BB8C-82   Security mode:restricted

          Power Management:off

          Link Quality:0  Signal level:0  Noise level:0

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

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

lappy ~ # dhcpcd ath0

Error, ath0: timed out

lappy ~ # iwconfig

eth0      no wireless extensions.

lo        no wireless extensions.

wifi0     no wireless extensions.

ath0      IEEE 802.11g  ESSID:"caslca.net"  Nickname:"homeNet"

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

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

          Retry:off   RTS thr:off   Fragment thr:off

          Encryption key:730C-BA75-F828-A9C7-832F-BB8C-82   Security mode:open

          Power Management:off

          Link Quality=46/94  Signal level=-46 dBm  Noise level=-92 dBm

          Rx invalid nwid:471  Rx invalid crypt:0  Rx invalid frag:0

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

lappy ~ #

```

----------

## GivePeaceAChance

Can you try a different SSID? I was having trouble with an SSID with a space in between (i.e. Home Network) so perhaps the thing that's giving you trouble is caslca.net.  If you're permitted to change the SSID, can you try something like calsca_net?

Also, I noticed in the first iwconfig printout you've got the encryption as "restricted" and the second as "open". That was just to try the two out I'm assuming?

----------

## caslca

Yes, that was indeed me trying out in both open and restricted modes. I tried with essid="caslcanet" but still no go... Thanks for your time though!

----------

## GivePeaceAChance

Hm. Well I'm a newbie at all this (you probably know more than I), so I think my "usefullness" has run it's course. Hopefully someone more knowledgeable will come your way. Good luck!  :Smile: 

----------

## andyandrews35

Worth a quick try with no encryption.  

You want udev to be up to date.

You need the right driver. This is why the below works, the driver makes eth1 available.

```

iwconfig eth1 essid default

dhcpcd eth1

ifconfig eth1 up

```

----------

## caslca

I run a ~x86 system and keeping it up-to-date twice a week or so. udev is:

```

These are the packages that would be merged, in order:

Calculating dependencies... done!

[ebuild   R   ] sys-fs/udev-111-r3  USE="(-selinux)" 0 kB

```

Since hw loads fine, drivers are initiated properly, and I can scan the range and see my network as available, I doubt this is a hardware/driver issue. A run with all security disabled still doesn't work. I also tried every madwifi-ng driver version in portage with same rate of success. My issue seems to be related to http://madwifi.org/ticket/1081 since I see the "Rx invalid nwid" number grow. Unlike all posters there, I can't connect even once. Next I'll probably try it with ndiswrapper....

fyi, my emerge --info:

```
Portage 2.1.2.9 (default-linux/x86/2007.0, gcc-4.1.2, glibc-2.5-r3, 2.6.21-gentoo-r2 i686)

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

System uname: 2.6.21-gentoo-r2 i686 Mobile Intel(R) Pentium(R) 4 CPU 3.20GHz

Gentoo Base System release 1.12.10

Timestamp of tree: Mon, 04 Jun 2007 02:30:01 +0000

ccache version 2.4 [enabled]

dev-java/java-config: 1.3.7, 2.0.33-r1

dev-lang/python:     2.5.1-r2

dev-python/pycrypto: 2.0.1-r5

dev-util/ccache:     2.4-r7

sys-apps/sandbox:    1.2.18.1

sys-devel/autoconf:  2.13, 2.61

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

sys-devel/binutils:  2.17

sys-devel/gcc-config: 1.3.16

sys-devel/libtool:   1.5.23b

virtual/os-headers:  2.6.21

ACCEPT_KEYWORDS="x86 ~x86"

AUTOCLEAN="yes"

CBUILD="i686-pc-linux-gnu"

CFLAGS="-O2 -march=pentium4 -fomit-frame-pointer -mmmx -msse -msse2 -pipe"

CHOST="i686-pc-linux-gnu"

CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/X11/xkb /usr/share/config"

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

CXXFLAGS="-O2 -march=pentium4 -fomit-frame-pointer -mmmx -msse -msse2 -pipe"

DISTDIR="/usr/portage/distfiles"

FEATURES="ccache distlocks metadata-transfer parallel-fetch sandbox sfperms strict"

GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo"

LDFLAGS="-Wl,-O1 -Wl,--enable-new-dtags -Wl,--sort-common -s"

LINGUAS="en_GB"

MAKEOPTS="-j3"

PKGDIR="/usr/portage/packages"

PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --filter=H_**/files/digest-*"

PORTAGE_TMPDIR="/var/tmp"

PORTDIR="/usr/portage"

PORTDIR_OVERLAY="/usr/local/portage"

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

USE="X a52 aac acl acpi addbookmarks alias alsa apache2 arts artswrappersuid audiofile bash-completion berkdb bitmap-fonts bluetooth bzip2 cairo cdda cddb cdr cli cracklib crypt cscope cups curl d dbus deprecated devil dga divx doc dri dvd dvdr dvdread eds emboss encode esd examples exif fam ffmpeg fftw firefox flac foomaticdb fortran ftp gd gdbm gif ginac glut gmedia gmp gnome gphoto2 gpm graphviz gs gstreamer gtk guile hal iconv imagemagick imlib ipv6 irc isdnlog jpeg jpeg2k kde kerberos lapack latex ldap libg++ libgda libwww mad matroska midi mikmod mime mjpeg mmap mmx mng motif mozcalendar mp3 mpeg mplayer msn mudflap musepack ncurses nls nptl nptlonly nsplugin offensive ogg openal opengl openmp oss pcre pdf perl pic plotutils png postgres povray ppds pppd python qt4 quicktime rdesktop readline reflection regex rtc ruby sdl session spell spl sse sse2 ssl svg tcpd tetex theora threads tiff timidity tk tools truetype truetype-fonts type1-fonts unicode usb videos vim vim-pager vim-syntax vim-with-x vorbis wifi wma wmf wmp x86 xanim xcf xcomposite xine xinerama xml xmlrpc xorg xpm xscreensaver xsl xv xvid xvmc yahoo zeroconf zlib" ALSA_CARDS="intel8x0" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mulaw multi null plug rate route share shm softvol" ELIBC="glibc" INPUT_DEVICES="keyboard mouse kbd" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en_GB" USERLAND="GNU" VIDEO_CARDS="nvidia"

Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS

```

----------

## caslca

OK well, I'm posting this through my ndiswrapped windoze driver (installer didn't want to unzip so I had to run the netgear installer through wine to get to the inf files...). It worked without any special tweaking and my "nwid" stays at 0.

I guess a bug with madwifi-ng team is in order.

Thanks for reading and all the help.

----------

